summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/cpu/intel_rdt.h
diff options
context:
space:
mode:
authorVikas Shivappa <vikas.shivappa@linux.intel.com>2017-07-25 14:14:46 -0700
committerThomas Gleixner <tglx@linutronix.de>2017-08-01 22:41:29 +0200
commita4de1dfdd726537e2a78b55759fc646d9b0a0be8 (patch)
tree7b3e16e16417ada6e732bf59c8098b1f434e12bd /arch/x86/kernel/cpu/intel_rdt.h
parent9f52425ba303d91c8370719e91d7e578bfdf309f (diff)
x86/intel_rdt/mbm: Add mbm counter initialization
MBM counters are monotonically increasing counts representing the total memory bytes at a particular time. In order to calculate total_bytes for an rdtgroup, we store the value of the counter when we create an rdtgroup or when a new domain comes online. When the total_bytes(all memory controller bytes) or local_bytes(local memory controller bytes) file in "mon_data" is read it shows the total bytes for that rdtgroup since its creation. User can snapshot this at different time intervals to obtain bytes/second. 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-28-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.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/intel_rdt.h b/arch/x86/kernel/cpu/intel_rdt.h
index 2137d5e55803..f160403324d3 100644
--- a/arch/x86/kernel/cpu/intel_rdt.h
+++ b/arch/x86/kernel/cpu/intel_rdt.h
@@ -55,6 +55,7 @@ struct rmid_read {
struct rdtgroup *rgrp;
struct rdt_domain *d;
int evtid;
+ bool first;
u64 val;
};
@@ -263,6 +264,12 @@ static inline bool is_mbm_enabled(void)
return (is_mbm_total_enabled() || is_mbm_local_enabled());
}
+static inline bool is_mbm_event(int e)
+{
+ return (e >= QOS_L3_MBM_TOTAL_EVENT_ID &&
+ e <= QOS_L3_MBM_LOCAL_EVENT_ID);
+}
+
/**
* struct rdt_resource - attributes of an RDT resource
* @rid: The index of the resource
@@ -402,5 +409,7 @@ void rmdir_mondata_subdir_allrdtgrp(struct rdt_resource *r,
unsigned int dom_id);
void mkdir_mondata_subdir_allrdtgrp(struct rdt_resource *r,
struct rdt_domain *d);
+void mon_event_read(struct rmid_read *rr, struct rdt_domain *d,
+ struct rdtgroup *rdtgrp, int evtid, int first);
#endif /* _ASM_X86_INTEL_RDT_H */