diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2020-05-27 16:29:08 +0200 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2020-06-15 14:10:03 +0200 |
commit | 043eb8e1051143a24811e6f35c276e35ae8247b6 (patch) | |
tree | 19eaec0b052cdcaba74b1a48fcff7085d6d1a03d /kernel/kthread.c | |
parent | psi: eliminate kthread_worker from psi trigger scheduling mechanism (diff) | |
download | linux-043eb8e1051143a24811e6f35c276e35ae8247b6.tar.xz linux-043eb8e1051143a24811e6f35c276e35ae8247b6.zip |
kthread: Switch to cpu_possible_mask
Next patch will switch unbound kernel threads mask to
housekeeping_cpumask(), a subset of cpu_possible_mask. So in order to
ease bisection, lets first switch kthreads default affinity from
cpu_all_mask to cpu_possible_mask.
It looks safe to do so as cpu_possible_mask seem to be initialized
at setup_arch() time, way before kthreadd is created.
Suggested-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200527142909.23372-2-frederic@kernel.org
Diffstat (limited to 'kernel/kthread.c')
-rw-r--r-- | kernel/kthread.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/kthread.c b/kernel/kthread.c index 8e3d2d7fdf5e..b86d37cda109 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c @@ -383,7 +383,7 @@ struct task_struct *__kthread_create_on_node(int (*threadfn)(void *data), * The kernel thread should not inherit these properties. */ sched_setscheduler_nocheck(task, SCHED_NORMAL, ¶m); - set_cpus_allowed_ptr(task, cpu_all_mask); + set_cpus_allowed_ptr(task, cpu_possible_mask); } kfree(create); return task; @@ -608,7 +608,7 @@ int kthreadd(void *unused) /* Setup a clean context for our children to inherit. */ set_task_comm(tsk, "kthreadd"); ignore_signals(tsk); - set_cpus_allowed_ptr(tsk, cpu_all_mask); + set_cpus_allowed_ptr(tsk, cpu_possible_mask); set_mems_allowed(node_states[N_MEMORY]); current->flags |= PF_NOFREEZE; |