aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/cpu/intel_rdt_rdtgroup.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
index 8ce5d038c43b..64c5ff97ee0d 100644
--- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
+++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
@@ -1149,6 +1149,7 @@ static struct dentry *rdt_mount(struct file_system_type *fs_type,
1149 struct dentry *dentry; 1149 struct dentry *dentry;
1150 int ret; 1150 int ret;
1151 1151
1152 cpus_read_lock();
1152 mutex_lock(&rdtgroup_mutex); 1153 mutex_lock(&rdtgroup_mutex);
1153 /* 1154 /*
1154 * resctrl file system can only be mounted once. 1155 * resctrl file system can only be mounted once.
@@ -1198,12 +1199,12 @@ static struct dentry *rdt_mount(struct file_system_type *fs_type,
1198 goto out_mondata; 1199 goto out_mondata;
1199 1200
1200 if (rdt_alloc_capable) 1201 if (rdt_alloc_capable)
1201 static_branch_enable(&rdt_alloc_enable_key); 1202 static_branch_enable_cpuslocked(&rdt_alloc_enable_key);
1202 if (rdt_mon_capable) 1203 if (rdt_mon_capable)
1203 static_branch_enable(&rdt_mon_enable_key); 1204 static_branch_enable_cpuslocked(&rdt_mon_enable_key);
1204 1205
1205 if (rdt_alloc_capable || rdt_mon_capable) 1206 if (rdt_alloc_capable || rdt_mon_capable)
1206 static_branch_enable(&rdt_enable_key); 1207 static_branch_enable_cpuslocked(&rdt_enable_key);
1207 1208
1208 if (is_mbm_enabled()) { 1209 if (is_mbm_enabled()) {
1209 r = &rdt_resources_all[RDT_RESOURCE_L3]; 1210 r = &rdt_resources_all[RDT_RESOURCE_L3];
@@ -1226,6 +1227,7 @@ out_cdp:
1226out: 1227out:
1227 rdt_last_cmd_clear(); 1228 rdt_last_cmd_clear();
1228 mutex_unlock(&rdtgroup_mutex); 1229 mutex_unlock(&rdtgroup_mutex);
1230 cpus_read_unlock();
1229 1231
1230 return dentry; 1232 return dentry;
1231} 1233}