Skip to contentSkip to conversation

x86/resctrl: Initialize new resource group with default MBA values

PATCH Superseded Xiaochen Shen 1 participant 1 message Apr 10, 2019

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 x86/resctrl: Initialize new resource group with default MBA values

Currently when a new resource group is created, the allocation values of MBA resource are not initialized and remain meaningless data.

For example:
mkdir /sys/fs/resctrl/p1
cat /sys/fs/resctrl/p1/schemata
MB:0=100;1=100

echo "MB:0=10;1=20" > /sys/fs/resctrl/p1/schemata
cat /sys/fs/resctrl/p1/schemata
MB:0= 10;1= 20

rmdir /sys/fs/resctrl/p1
mkdir /sys/fs/resctrl/p2
cat /sys/fs/resctrl/p2/schemata
MB:0= 10;1= 20

When the new group is created, it is reasonable to initialize MBA resource with default values.

Initialize MBA resource and cache resources in separate functions.

---
 arch/x86/kernel/cpu/resctrl/ctrlmondata.c |   4 +-
 arch/x86/kernel/cpu/resctrl/rdtgroup.c    | 139 ++++++++++++++++--------------
 2 files changed, 75 insertions(+), 68 deletions(-)
arch/x86/kernel/cpu/resctrl/ctrlmondata.c +2 -2
index 2dbd990..576bb6a 100644
@@ -342,10 +342,10 @@ int update_domains(struct rdt_resource *r, int closid)
 	if (cpumask_empty(cpu_mask) || mba_sc)
 		goto done;
 	cpu = get_cpu();
-	/* Update CBM on this cpu if it's in cpu_mask. */
+	/* Update resource control msr on this cpu if it's in cpu_mask. */
 	if (cpumask_test_cpu(cpu, cpu_mask))
 		rdt_ctrl_update(&msr_param);
-	/* Update CBM on other cpus. */
+	/* Update resource control msr on other cpus. */
 	smp_call_function_many(cpu_mask, rdt_ctrl_update, &msr_param, 1);
 	put_cpu();
 
arch/x86/kernel/cpu/resctrl/rdtgroup.c +73 -66

166 lines not on this page · raw message

Signature · 1 line
1.8.3.1