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

Commit 6b05f7f3 authored by Blagovest Kolenichev's avatar Blagovest Kolenichev
Browse files

Revert "sched/core: Fix migration to invalid CPU in __set_cpus_allowed_ptr()"



This reverts commit 5d498864.

This is a preparation change for merging android-4.14-q.149 into
msm-4.14 branch.The reverted change is committed already as:

98164f45 sched/core: Fix warning introduced in __set_cpus_allowed_ptr

Change-Id: I9381e1518e3c4494b8abf6adedcf5c4459662bf3
Signed-off-by: default avatarBlagovest Kolenichev <bkolenichev@codeaurora.org>
parent 80f767f3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1124,8 +1124,7 @@ static int __set_cpus_allowed_ptr(struct task_struct *p,
	if (cpumask_equal(&p->cpus_allowed, new_mask))
		goto out;

	dest_cpu = cpumask_any_and(cpu_valid_mask, new_mask);
	if (dest_cpu >= nr_cpu_ids) {
	if (!cpumask_intersects(new_mask, cpu_valid_mask)) {
		ret = -EINVAL;
		goto out;
	}
@@ -1146,6 +1145,7 @@ static int __set_cpus_allowed_ptr(struct task_struct *p,
	if (cpumask_test_cpu(task_cpu(p), new_mask))
		goto out;

	dest_cpu = cpumask_any_and(cpu_valid_mask, new_mask);
	if (task_running(rq, p) || p->state == TASK_WAKING) {
		struct migration_arg arg = { p, dest_cpu };
		/* Need help from migration thread: drop lock and wait. */