@@ -1114,7 +1114,7 @@ enum subparts_cmd {
1114
1114
* cpus_allowed can be granted or an error code will be returned.
1115
1115
*
1116
1116
* For partcmd_disable, the cpuset is being transofrmed from a partition
1117
- * root back to a non-partition root. any CPUs in cpus_allowed that are in
1117
+ * root back to a non-partition root. Any CPUs in cpus_allowed that are in
1118
1118
* parent's subparts_cpus will be taken away from that cpumask and put back
1119
1119
* into parent's effective_cpus. 0 should always be returned.
1120
1120
*
@@ -1225,7 +1225,7 @@ static int update_parent_subparts_cpumask(struct cpuset *cpuset, int cmd,
1225
1225
/*
1226
1226
* partcmd_update w/o newmask:
1227
1227
*
1228
- * addmask = cpus_allowed & parent->effectiveb_cpus
1228
+ * addmask = cpus_allowed & parent->effective_cpus
1229
1229
*
1230
1230
* Note that parent's subparts_cpus may have been
1231
1231
* pre-shrunk in case there is a change in the cpu list.
@@ -1365,12 +1365,12 @@ static void update_cpumasks_hier(struct cpuset *cs, struct tmpmasks *tmp)
1365
1365
case PRS_DISABLED :
1366
1366
/*
1367
1367
* If parent is not a partition root or an
1368
- * invalid partition root, clear the state
1369
- * state and the CS_CPU_EXCLUSIVE flag.
1368
+ * invalid partition root, clear its state
1369
+ * and its CS_CPU_EXCLUSIVE flag.
1370
1370
*/
1371
1371
WARN_ON_ONCE (cp -> partition_root_state
1372
1372
!= PRS_ERROR );
1373
- cp -> partition_root_state = 0 ;
1373
+ cp -> partition_root_state = PRS_DISABLED ;
1374
1374
1375
1375
/*
1376
1376
* clear_bit() is an atomic operation and
@@ -1937,30 +1937,28 @@ static int update_flag(cpuset_flagbits_t bit, struct cpuset *cs,
1937
1937
1938
1938
/*
1939
1939
* update_prstate - update partititon_root_state
1940
- * cs: the cpuset to update
1941
- * val: 0 - disabled, 1 - enabled
1940
+ * cs: the cpuset to update
1941
+ * new_prs: new partition root state
1942
1942
*
1943
1943
* Call with cpuset_mutex held.
1944
1944
*/
1945
- static int update_prstate (struct cpuset * cs , int val )
1945
+ static int update_prstate (struct cpuset * cs , int new_prs )
1946
1946
{
1947
1947
int err ;
1948
1948
struct cpuset * parent = parent_cs (cs );
1949
- struct tmpmasks tmp ;
1949
+ struct tmpmasks tmpmask ;
1950
1950
1951
- if ((val != 0 ) && (val != 1 ))
1952
- return - EINVAL ;
1953
- if (val == cs -> partition_root_state )
1951
+ if (new_prs == cs -> partition_root_state )
1954
1952
return 0 ;
1955
1953
1956
1954
/*
1957
1955
* Cannot force a partial or invalid partition root to a full
1958
1956
* partition root.
1959
1957
*/
1960
- if (val && cs -> partition_root_state )
1958
+ if (new_prs && ( cs -> partition_root_state < 0 ) )
1961
1959
return - EINVAL ;
1962
1960
1963
- if (alloc_cpumasks (NULL , & tmp ))
1961
+ if (alloc_cpumasks (NULL , & tmpmask ))
1964
1962
return - ENOMEM ;
1965
1963
1966
1964
err = - EINVAL ;
@@ -1978,7 +1976,7 @@ static int update_prstate(struct cpuset *cs, int val)
1978
1976
goto out ;
1979
1977
1980
1978
err = update_parent_subparts_cpumask (cs , partcmd_enable ,
1981
- NULL , & tmp );
1979
+ NULL , & tmpmask );
1982
1980
if (err ) {
1983
1981
update_flag (CS_CPU_EXCLUSIVE , cs , 0 );
1984
1982
goto out ;
@@ -1990,18 +1988,18 @@ static int update_prstate(struct cpuset *cs, int val)
1990
1988
* CS_CPU_EXCLUSIVE bit.
1991
1989
*/
1992
1990
if (cs -> partition_root_state == PRS_ERROR ) {
1993
- cs -> partition_root_state = 0 ;
1991
+ cs -> partition_root_state = PRS_DISABLED ;
1994
1992
update_flag (CS_CPU_EXCLUSIVE , cs , 0 );
1995
1993
err = 0 ;
1996
1994
goto out ;
1997
1995
}
1998
1996
1999
1997
err = update_parent_subparts_cpumask (cs , partcmd_disable ,
2000
- NULL , & tmp );
1998
+ NULL , & tmpmask );
2001
1999
if (err )
2002
2000
goto out ;
2003
2001
2004
- cs -> partition_root_state = 0 ;
2002
+ cs -> partition_root_state = PRS_DISABLED ;
2005
2003
2006
2004
/* Turning off CS_CPU_EXCLUSIVE will not return error */
2007
2005
update_flag (CS_CPU_EXCLUSIVE , cs , 0 );
@@ -2015,11 +2013,11 @@ static int update_prstate(struct cpuset *cs, int val)
2015
2013
update_tasks_cpumask (parent );
2016
2014
2017
2015
if (parent -> child_ecpus_count )
2018
- update_sibling_cpumasks (parent , cs , & tmp );
2016
+ update_sibling_cpumasks (parent , cs , & tmpmask );
2019
2017
2020
2018
rebuild_sched_domains_locked ();
2021
2019
out :
2022
- free_cpumasks (NULL , & tmp );
2020
+ free_cpumasks (NULL , & tmpmask );
2023
2021
return err ;
2024
2022
}
2025
2023
@@ -3060,7 +3058,7 @@ static void cpuset_hotplug_update_tasks(struct cpuset *cs, struct tmpmasks *tmp)
3060
3058
goto retry ;
3061
3059
}
3062
3060
3063
- parent = parent_cs (cs );
3061
+ parent = parent_cs (cs );
3064
3062
compute_effective_cpumask (& new_cpus , cs , parent );
3065
3063
nodes_and (new_mems , cs -> mems_allowed , parent -> effective_mems );
3066
3064
0 commit comments