Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d03969c9 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "sched: core: Exclude isolated cpus in sched_getaffinity cpumask"

parents e8d8c679 189f8c0f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -5100,6 +5100,14 @@ long sched_getaffinity(pid_t pid, struct cpumask *mask)

	raw_spin_lock_irqsave(&p->pi_lock, flags);
	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);

out_unlock: