diff options
author | Vikas Shivappa <vikas.shivappa@linux.intel.com> | 2017-07-26 00:14:38 +0300 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-08-01 23:41:26 +0300 |
commit | d89b7379015fc561060a4094676d143e6ed264e7 (patch) | |
tree | f9ada9e97ac5fa902837d70ccaecf17ed49e143f /arch/x86/kernel/cpu/intel_rdt.h | |
parent | 90c403e83101c87ee9e6df8c8d30ea8628ff8bfc (diff) | |
download | linux-d89b7379015fc561060a4094676d143e6ed264e7.tar.xz |
x86/intel_rdt/cqm: Add mon_data
Add a mon_data directory for the root rdtgroup and all other rdtgroups.
The directory holds all of the monitored data for all domains and events
of all resources being monitored.
The mon_data itself has a list of directories in the format
mon_<domain_name>_<domain_id>. Each of these subdirectories contain one
file per event in the mode "0444". Reading the file displays a snapshot
of the monitored data for the event the file represents.
For ex, on a 2 socket Broadwell with llc_occupancy being
monitored the mon_data contents look as below:
$ ls /sys/fs/resctrl/p1/mon_data/
mon_L3_00
mon_L3_01
Each domain directory has one file per event:
$ ls /sys/fs/resctrl/p1/mon_data/mon_L3_00/
llc_occupancy
To read current llc_occupancy of ctrl_mon group p1
$ cat /sys/fs/resctrl/p1/mon_data/mon_L3_00/llc_occupancy
33789096
[This patch idea is based on Tony's sample patches to organise data in a
per domain directory and have one file per event (and use the fp->priv to
store mon data bits)]
Signed-off-by: Vikas Shivappa <vikas.shivappa@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: ravi.v.shankar@intel.com
Cc: tony.luck@intel.com
Cc: fenghua.yu@intel.com
Cc: peterz@infradead.org
Cc: eranian@google.com
Cc: vikas.shivappa@intel.com
Cc: ak@linux.intel.com
Cc: davidcc@google.com
Cc: reinette.chatre@intel.com
Link: http://lkml.kernel.org/r/1501017287-28083-20-git-send-email-vikas.shivappa@linux.intel.com
Diffstat (limited to 'arch/x86/kernel/cpu/intel_rdt.h')
-rw-r--r-- | arch/x86/kernel/cpu/intel_rdt.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/intel_rdt.h b/arch/x86/kernel/cpu/intel_rdt.h index 6f070476416f..7fcaa5f82bd0 100644 --- a/arch/x86/kernel/cpu/intel_rdt.h +++ b/arch/x86/kernel/cpu/intel_rdt.h @@ -33,6 +33,27 @@ struct mon_evt { struct list_head list; }; +/** + * struct mon_data_bits - Monitoring details for each event file + * @rid: Resource id associated with the event file. + * @evtid: Event id associated with the event file + * @domid: The domain to which the event file belongs + */ +union mon_data_bits { + void *priv; + struct { + unsigned int rid : 10; + unsigned int evtid : 8; + unsigned int domid : 14; + } u; +}; + +struct rmid_read { + struct rdtgroup *rgrp; + int evtid; + u64 val; +}; + extern unsigned int intel_cqm_threshold; extern bool rdt_alloc_capable; extern bool rdt_mon_capable; @@ -46,11 +67,13 @@ enum rdt_group_type { /** * struct mongroup - store mon group's data in resctrl fs. + * @mon_data_kn kernlfs node for the mon_data directory * @parent: parent rdtgrp * @crdtgrp_list: child rdtgroup node list * @rmid: rmid for this rdtgroup */ struct mongroup { + struct kernfs_node *mon_data_kn; struct rdtgroup *parent; struct list_head crdtgrp_list; u32 rmid; @@ -209,6 +232,7 @@ static inline bool is_llc_occupancy_enabled(void) /** * struct rdt_resource - attributes of an RDT resource + * @rid: The index of the resource * @alloc_enabled: Is allocation enabled on this machine * @mon_enabled: Is monitoring enabled for this feature * @alloc_capable: Is allocation available on this machine @@ -230,6 +254,7 @@ static inline bool is_llc_occupancy_enabled(void) * @fflags: flags to choose base and info files */ struct rdt_resource { + int rid; bool alloc_enabled; bool mon_enabled; bool alloc_capable; @@ -323,6 +348,8 @@ union cpuid_0x10_x_edx { void rdt_ctrl_update(void *arg); struct rdtgroup *rdtgroup_kn_lock_live(struct kernfs_node *kn); void rdtgroup_kn_unlock(struct kernfs_node *kn); +struct rdt_domain *rdt_find_domain(struct rdt_resource *r, int id, + struct list_head **pos); ssize_t rdtgroup_schemata_write(struct kernfs_open_file *of, char *buf, size_t nbytes, loff_t off); int rdtgroup_schemata_show(struct kernfs_open_file *of, @@ -331,5 +358,7 @@ struct rdt_domain *get_domain_from_cpu(int cpu, struct rdt_resource *r); int alloc_rmid(void); void free_rmid(u32 rmid); int rdt_get_mon_l3_config(struct rdt_resource *r); +void mon_event_count(void *info); +int rdtgroup_mondata_show(struct seq_file *m, void *arg); #endif /* _ASM_X86_INTEL_RDT_H */ |