mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 23:22:31 +02:00
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>
This commit is contained in:
parent
103b08709e
commit
6cfeddbf4a
|
|
@ -1432,6 +1432,26 @@ static bool isolated_cpus_can_update(struct cpumask *add_cpus,
|
|||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
* prstate_housekeeping_conflict - check for partition & housekeeping conflicts
|
||||
* @prstate: partition root state to be checked
|
||||
* @new_cpus: cpu mask
|
||||
* Return: true if there is conflict, false otherwise
|
||||
*
|
||||
* CPUs outside of boot_hk_cpus, if defined, can only be used in an
|
||||
* isolated partition.
|
||||
*/
|
||||
static bool prstate_housekeeping_conflict(int prstate, struct cpumask *new_cpus)
|
||||
{
|
||||
if (!have_boot_isolcpus)
|
||||
return false;
|
||||
|
||||
if ((prstate != PRS_ISOLATED) && !cpumask_subset(new_cpus, boot_hk_cpus))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void update_isolation_cpumasks(bool isolcpus_updated)
|
||||
{
|
||||
int ret;
|
||||
|
|
@ -1727,26 +1747,6 @@ static void remote_cpus_update(struct cpuset *cs, struct cpumask *xcpus,
|
|||
remote_partition_disable(cs, tmp);
|
||||
}
|
||||
|
||||
/*
|
||||
* prstate_housekeeping_conflict - check for partition & housekeeping conflicts
|
||||
* @prstate: partition root state to be checked
|
||||
* @new_cpus: cpu mask
|
||||
* Return: true if there is conflict, false otherwise
|
||||
*
|
||||
* CPUs outside of boot_hk_cpus, if defined, can only be used in an
|
||||
* isolated partition.
|
||||
*/
|
||||
static bool prstate_housekeeping_conflict(int prstate, struct cpumask *new_cpus)
|
||||
{
|
||||
if (!have_boot_isolcpus)
|
||||
return false;
|
||||
|
||||
if ((prstate != PRS_ISOLATED) && !cpumask_subset(new_cpus, boot_hk_cpus))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* update_parent_effective_cpumask - update effective_cpus mask of parent cpuset
|
||||
* @cs: The cpuset that requests change in partition root state
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user