|
@@ -1149,6 +1149,7 @@ static struct dentry *rdt_mount(struct file_system_type *fs_type,
|
|
|
struct dentry *dentry;
|
|
|
int ret;
|
|
|
|
|
|
+ cpus_read_lock();
|
|
|
mutex_lock(&rdtgroup_mutex);
|
|
|
/*
|
|
|
* resctrl file system can only be mounted once.
|
|
@@ -1198,12 +1199,12 @@ static struct dentry *rdt_mount(struct file_system_type *fs_type,
|
|
|
goto out_mondata;
|
|
|
|
|
|
if (rdt_alloc_capable)
|
|
|
- static_branch_enable(&rdt_alloc_enable_key);
|
|
|
+ static_branch_enable_cpuslocked(&rdt_alloc_enable_key);
|
|
|
if (rdt_mon_capable)
|
|
|
- static_branch_enable(&rdt_mon_enable_key);
|
|
|
+ static_branch_enable_cpuslocked(&rdt_mon_enable_key);
|
|
|
|
|
|
if (rdt_alloc_capable || rdt_mon_capable)
|
|
|
- static_branch_enable(&rdt_enable_key);
|
|
|
+ static_branch_enable_cpuslocked(&rdt_enable_key);
|
|
|
|
|
|
if (is_mbm_enabled()) {
|
|
|
r = &rdt_resources_all[RDT_RESOURCE_L3];
|
|
@@ -1226,6 +1227,7 @@ out_cdp:
|
|
|
out:
|
|
|
rdt_last_cmd_clear();
|
|
|
mutex_unlock(&rdtgroup_mutex);
|
|
|
+ cpus_read_unlock();
|
|
|
|
|
|
return dentry;
|
|
|
}
|