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.

sched_ext: idle: clarify comments

Add a comments to clarify about the usage of cpumask_intersects().

Moreover, update scx_select_cpu_dfl() description clarifying that the
final step of the idle selection logic involves searching for any idle
CPU in the system that the task can use.

Reviewed-by: Yury Norov <yury.norov@gmail.com>
Signed-off-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Andrea Righi and committed by
Tejun Heo
02f034dc 9cf9acee

+6
+6
kernel/sched/ext.c
··· 3180 3180 * scx_pick_idle_cpu() can get caught in an infinite loop as 3181 3181 * @cpu is never cleared from idle_masks.smt. Ensure that @cpu 3182 3182 * is eventually cleared. 3183 + * 3184 + * NOTE: Use cpumask_intersects() and cpumask_test_cpu() to 3185 + * reduce memory writes, which may help alleviate cache 3186 + * coherence pressure. 3183 3187 */ 3184 3188 if (cpumask_intersects(smt, idle_masks.smt)) 3185 3189 cpumask_andnot(idle_masks.smt, idle_masks.smt, smt); ··· 3411 3407 * 3412 3408 * 4. Pick a CPU within the same NUMA node, if enabled: 3413 3409 * - choose a CPU from the same NUMA node to reduce memory access latency. 3410 + * 3411 + * 5. Pick any idle CPU usable by the task. 3414 3412 * 3415 3413 * Step 3 and 4 are performed only if the system has, respectively, multiple 3416 3414 * LLC domains / multiple NUMA nodes (see scx_selcpu_topo_llc and