Skip to content

Commit 6cfeddb

Browse files
Waiman-Longhtejun
authored andcommitted
cgroup/cpuset: Move up prstate_housekeeping_conflict() helper
Move up the prstate_housekeeping_conflict() helper so that it can be used in remote partition code. Signed-off-by: Waiman Long <longman@redhat.com> Reviewed-by: Chen Ridong <chenridong@huawei.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 103b087 commit 6cfeddb

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

kernel/cgroup/cpuset.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,6 +1432,26 @@ static bool isolated_cpus_can_update(struct cpumask *add_cpus,
14321432
return res;
14331433
}
14341434

1435+
/*
1436+
* prstate_housekeeping_conflict - check for partition & housekeeping conflicts
1437+
* @prstate: partition root state to be checked
1438+
* @new_cpus: cpu mask
1439+
* Return: true if there is conflict, false otherwise
1440+
*
1441+
* CPUs outside of boot_hk_cpus, if defined, can only be used in an
1442+
* isolated partition.
1443+
*/
1444+
static bool prstate_housekeeping_conflict(int prstate, struct cpumask *new_cpus)
1445+
{
1446+
if (!have_boot_isolcpus)
1447+
return false;
1448+
1449+
if ((prstate != PRS_ISOLATED) && !cpumask_subset(new_cpus, boot_hk_cpus))
1450+
return true;
1451+
1452+
return false;
1453+
}
1454+
14351455
static void update_isolation_cpumasks(bool isolcpus_updated)
14361456
{
14371457
int ret;
@@ -1727,26 +1747,6 @@ static void remote_cpus_update(struct cpuset *cs, struct cpumask *xcpus,
17271747
remote_partition_disable(cs, tmp);
17281748
}
17291749

1730-
/*
1731-
* prstate_housekeeping_conflict - check for partition & housekeeping conflicts
1732-
* @prstate: partition root state to be checked
1733-
* @new_cpus: cpu mask
1734-
* Return: true if there is conflict, false otherwise
1735-
*
1736-
* CPUs outside of boot_hk_cpus, if defined, can only be used in an
1737-
* isolated partition.
1738-
*/
1739-
static bool prstate_housekeeping_conflict(int prstate, struct cpumask *new_cpus)
1740-
{
1741-
if (!have_boot_isolcpus)
1742-
return false;
1743-
1744-
if ((prstate != PRS_ISOLATED) && !cpumask_subset(new_cpus, boot_hk_cpus))
1745-
return true;
1746-
1747-
return false;
1748-
}
1749-
17501750
/**
17511751
* update_parent_effective_cpumask - update effective_cpus mask of parent cpuset
17521752
* @cs: The cpuset that requests change in partition root state

0 commit comments

Comments
 (0)