Merge "sched: core: Exclude isolated cpus in sched_getaffinity cpumask"
This commit is contained in:
commit
20ab01289c
1 changed files with 9 additions and 0 deletions
|
@ -4914,6 +4914,15 @@ long sched_getaffinity(pid_t pid, struct cpumask *mask)
|
||||||
|
|
||||||
raw_spin_lock_irqsave(&p->pi_lock, flags);
|
raw_spin_lock_irqsave(&p->pi_lock, flags);
|
||||||
cpumask_and(mask, &p->cpus_allowed, cpu_active_mask);
|
cpumask_and(mask, &p->cpus_allowed, cpu_active_mask);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The userspace tasks are forbidden to run on
|
||||||
|
* isolated CPUs. So exclude isolated CPUs from
|
||||||
|
* the getaffinity.
|
||||||
|
*/
|
||||||
|
if (!(p->flags & PF_KTHREAD))
|
||||||
|
cpumask_andnot(mask, mask, cpu_isolated_mask);
|
||||||
|
|
||||||
raw_spin_unlock_irqrestore(&p->pi_lock, flags);
|
raw_spin_unlock_irqrestore(&p->pi_lock, flags);
|
||||||
|
|
||||||
out_unlock:
|
out_unlock:
|
||||||
|
|
Loading…
Add table
Reference in a new issue