aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReinette Chatre <reinette.chatre@intel.com>2018-07-01 01:17:33 -0400
committerThomas Gleixner <tglx@linutronix.de>2018-07-03 02:38:40 -0400
commit33dc3e410a0d99f394905143b26d34f1fd64c962 (patch)
treeb09468f8123e257842860e657d6d2b7417681bc6
parent392487def48e4b596526a4a8c2c2ec4cfe73bf13 (diff)
x86/intel_rdt: Make CPU information accessible for pseudo-locked regions
When a resource group enters pseudo-locksetup mode it reflects that the platform supports cache pseudo-locking and the resource group is unused, ready to be used for a pseudo-locked region. Until it is set up as a pseudo-locked region the resource group is "locked down" such that no new tasks or cpus can be assigned to it. This is accomplished in a user visible way by making the cpus, cpus_list, and tasks resctrl files inaccassible (user cannot read from or write to these files). When the resource group changes to pseudo-locked mode it represents a cache pseudo-locked region. While not appropriate to make any changes to the cpus assigned to this region it is useful to make it easy for the user to see which cpus are associated with the pseudo-locked region. Modify the permissions of the cpus/cpus_list file when the resource group changes to pseudo-locked mode to support reading (not writing). The information presented to the user when reading the file are the cpus associated with the pseudo-locked region. 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/12756b7963b6abc1bffe8fb560b87b75da827bd1.1530421961.git.reinette.chatre@intel.com
-rw-r--r--Documentation/x86/intel_rdt_ui.txt3
-rw-r--r--arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c3
-rw-r--r--arch/x86/kernel/cpu/intel_rdt_rdtgroup.c8
3 files changed, 12 insertions, 2 deletions
diff --git a/Documentation/x86/intel_rdt_ui.txt b/Documentation/x86/intel_rdt_ui.txt
index acac30b67c62..f662d3c530e5 100644
--- a/Documentation/x86/intel_rdt_ui.txt
+++ b/Documentation/x86/intel_rdt_ui.txt
@@ -178,6 +178,9 @@ All groups contain the following files:
178 CPUs to/from this group. As with the tasks file a hierarchy is 178 CPUs to/from this group. As with the tasks file a hierarchy is
179 maintained where MON groups may only include CPUs owned by the 179 maintained where MON groups may only include CPUs owned by the
180 parent CTRL_MON group. 180 parent CTRL_MON group.
181 When the resouce group is in pseudo-locked mode this file will
182 only be readable, reflecting the CPUs associated with the
183 pseudo-locked region.
181 184
182 185
183"cpus_list": 186"cpus_list":
diff --git a/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c b/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c
index 5dfe4008c58f..751c78f9992f 100644
--- a/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c
+++ b/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c
@@ -1303,6 +1303,9 @@ int rdtgroup_pseudo_lock_create(struct rdtgroup *rdtgrp)
1303 1303
1304 rdtgrp->mode = RDT_MODE_PSEUDO_LOCKED; 1304 rdtgrp->mode = RDT_MODE_PSEUDO_LOCKED;
1305 closid_free(rdtgrp->closid); 1305 closid_free(rdtgrp->closid);
1306 rdtgroup_kn_mode_restore(rdtgrp, "cpus", 0444);
1307 rdtgroup_kn_mode_restore(rdtgrp, "cpus_list", 0444);
1308
1306 ret = 0; 1309 ret = 0;
1307 goto out; 1310 goto out;
1308 1311
diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
index c20b51afd62d..d6d7ea7349d0 100644
--- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
+++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
@@ -265,8 +265,12 @@ static int rdtgroup_cpus_show(struct kernfs_open_file *of,
265 rdtgrp = rdtgroup_kn_lock_live(of->kn); 265 rdtgrp = rdtgroup_kn_lock_live(of->kn);
266 266
267 if (rdtgrp) { 267 if (rdtgrp) {
268 seq_printf(s, is_cpu_list(of) ? "%*pbl\n" : "%*pb\n", 268 if (rdtgrp->mode == RDT_MODE_PSEUDO_LOCKED)
269 cpumask_pr_args(&rdtgrp->cpu_mask)); 269 seq_printf(s, is_cpu_list(of) ? "%*pbl\n" : "%*pb\n",
270 cpumask_pr_args(&rdtgrp->plr->d->cpu_mask));
271 else
272 seq_printf(s, is_cpu_list(of) ? "%*pbl\n" : "%*pb\n",
273 cpumask_pr_args(&rdtgrp->cpu_mask));
270 } else { 274 } else {
271 ret = -ENOENT; 275 ret = -ENOENT;
272 } 276 }