Revert "FROMGIT: sched: Always clear user_cpus_ptr in do_set_cpus_allowed()"

This reverts commit 448eb7ef25.

This series is responsible for a functional regression with task
affinity failing to take into account offline CPUs. Although this has
been reported upstream, work to fix the problem is ongoing and we're
better off reverting these changes from android13-5.15.

Link: https://lore.kernel.org/lkml/20230131221719.3176-1-will@kernel.org/
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 263926519
Bug: 264940090
Change-Id: I93cc0f0a9b8c562686834812b7b7f129ffbed205
This commit is contained in:
Will Deacon
2023-02-06 12:33:41 +00:00
parent 97c7d8de1d
commit 0f54a1c923

View File

@@ -2576,20 +2576,14 @@ __do_set_cpus_allowed(struct task_struct *p, struct affinity_context *ctx)
set_next_task(rq, p);
}
/*
* Used for kthread_bind() and select_fallback_rq(), in both cases the user
* affinity (if any) should be destroyed too.
*/
void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask)
{
struct affinity_context ac = {
.new_mask = new_mask,
.user_mask = NULL,
.flags = SCA_USER, /* clear the user requested mask */
.flags = 0,
};
__do_set_cpus_allowed(p, &ac);
kfree(ac.user_mask);
}
int dup_user_cpus_ptr(struct task_struct *dst, struct task_struct *src,