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

Commit ca8a1961 authored by Lingutla Chandrasekhar's avatar Lingutla Chandrasekhar Committed by Satya Durga Srinivasu Prabhala
Browse files

sched: core: Exclude isolated cpus in sched_getaffinity cpumask



User space tasks will have the same semantics for hotplug and isolation.
Currently the sched_getaffinity() include isolated CPU on which user
space tasks are forbidden to run. So fix this by excluding isolated cpus
while returning cpu mask for user space tasks in sched_getaffinity().

Change-Id: Ib6a8ca864754f73bbaf809c3ceaef5f91d567ca9
Signed-off-by: default avatarLingutla Chandrasekhar <clingutla@codeaurora.org>
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent b9fbf75b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -5026,6 +5026,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: