Skip to content

Commit 018961a

Browse files
rchatreKAGA-KOKO
authored andcommitted
x86/intel_rdt: Pseudo-lock region creation/removal core
The user requests a pseudo-locked region by providing a schemata to a resource group that is in the pseudo-locksetup mode. This is the functionality that consumes the parsed user data and creates the pseudo-locked region. First, required information is deduced from user provided data. This includes, how much memory does the requested bitmask represent, which CPU the requested region is associated with, and what is the cache line size of that cache (to learn the stride needed for locking). Second, a contiguous block of memory matching the requested bitmask is allocated. Finally, pseudo-locking is performed. The resource group already has the allocation that reflects the requested bitmask. With this class of service active and interference minimized, the allocated memory is loaded into the cache. Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/67391160bbf06143bc62d856d3d234eb152008b7.1529706536.git.reinette.chatre@intel.com
1 parent f2a1772 commit 018961a

File tree

2 files changed

+353
-1
lines changed

2 files changed

+353
-1
lines changed

arch/x86/kernel/cpu/intel_rdt.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,26 @@ struct mongroup {
129129
* @d: RDT domain to which this pseudo-locked region
130130
* belongs
131131
* @cbm: bitmask of the pseudo-locked region
132+
* @lock_thread_wq: waitqueue used to wait on the pseudo-locking thread
133+
* completion
134+
* @thread_done: variable used by waitqueue to test if pseudo-locking
135+
* thread completed
136+
* @cpu: core associated with the cache on which the setup code
137+
* will be run
138+
* @line_size: size of the cache lines
139+
* @size: size of pseudo-locked region in bytes
140+
* @kmem: the kernel memory associated with pseudo-locked region
132141
*/
133142
struct pseudo_lock_region {
134143
struct rdt_resource *r;
135144
struct rdt_domain *d;
136145
u32 cbm;
146+
wait_queue_head_t lock_thread_wq;
147+
int thread_done;
148+
int cpu;
149+
unsigned int line_size;
150+
unsigned int size;
151+
void *kmem;
137152
};
138153

139154
/**
@@ -505,6 +520,8 @@ int rdtgroup_locksetup_enter(struct rdtgroup *rdtgrp);
505520
int rdtgroup_locksetup_exit(struct rdtgroup *rdtgrp);
506521
bool rdtgroup_cbm_overlaps_pseudo_locked(struct rdt_domain *d, u32 _cbm);
507522
bool rdtgroup_pseudo_locked_in_hierarchy(struct rdt_domain *d);
523+
int rdtgroup_pseudo_lock_create(struct rdtgroup *rdtgrp);
524+
void rdtgroup_pseudo_lock_remove(struct rdtgroup *rdtgrp);
508525
struct rdt_domain *get_domain_from_cpu(int cpu, struct rdt_resource *r);
509526
int update_domains(struct rdt_resource *r, int closid);
510527
void closid_free(int closid);

0 commit comments

Comments
 (0)