Skip to content

Commit 043eb8e

Browse files
matosattiPeter Zijlstra
authored andcommitted
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 <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 461daba commit 043eb8e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/kthread.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ struct task_struct *__kthread_create_on_node(int (*threadfn)(void *data),
383383
* The kernel thread should not inherit these properties.
384384
*/
385385
sched_setscheduler_nocheck(task, SCHED_NORMAL, &param);
386-
set_cpus_allowed_ptr(task, cpu_all_mask);
386+
set_cpus_allowed_ptr(task, cpu_possible_mask);
387387
}
388388
kfree(create);
389389
return task;
@@ -608,7 +608,7 @@ int kthreadd(void *unused)
608608
/* Setup a clean context for our children to inherit. */
609609
set_task_comm(tsk, "kthreadd");
610610
ignore_signals(tsk);
611-
set_cpus_allowed_ptr(tsk, cpu_all_mask);
611+
set_cpus_allowed_ptr(tsk, cpu_possible_mask);
612612
set_mems_allowed(node_states[N_MEMORY]);
613613

614614
current->flags |= PF_NOFREEZE;

0 commit comments

Comments
 (0)