Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kthread: Rely on HK_TYPE_DOMAIN for preferred affinity management

Unbound kthreads want to run neither on nohz_full CPUs nor on domain
isolated CPUs. And since nohz_full implies domain isolation, checking
the latter is enough to verify both.

Therefore exclude kthreads from domain isolation.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Reviewed-by: Waiman Long <longman@redhat.com>
Cc: Marco Crivellari <marco.crivellari@suse.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Waiman Long <longman@redhat.com>

+5 -3
+5 -3
kernel/kthread.c
··· 362 362 { 363 363 const struct cpumask *pref; 364 364 365 + guard(rcu)(); 366 + 365 367 if (kthread->preferred_affinity) { 366 368 pref = kthread->preferred_affinity; 367 369 } else { 368 370 if (kthread->node == NUMA_NO_NODE) 369 - pref = housekeeping_cpumask(HK_TYPE_KTHREAD); 371 + pref = housekeeping_cpumask(HK_TYPE_DOMAIN); 370 372 else 371 373 pref = cpumask_of_node(kthread->node); 372 374 } 373 375 374 - cpumask_and(cpumask, pref, housekeeping_cpumask(HK_TYPE_KTHREAD)); 376 + cpumask_and(cpumask, pref, housekeeping_cpumask(HK_TYPE_DOMAIN)); 375 377 if (cpumask_empty(cpumask)) 376 - cpumask_copy(cpumask, housekeeping_cpumask(HK_TYPE_KTHREAD)); 378 + cpumask_copy(cpumask, housekeeping_cpumask(HK_TYPE_DOMAIN)); 377 379 } 378 380 379 381 static void kthread_affine_node(void)