Skip to content

Commit fb064e5

Browse files
joelagnelIngo Molnar
authored andcommitted
sched/nohz: Update comments about NEWILB_KICK
How ILB is triggered without IPIs is cryptic. Out of mercy for future code readers, document it in code comments. The comments are derived from a discussion with Vincent in a past review. Signed-off-by: Joel Fernandes (Google) <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 1b7ef2d commit fb064e5

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

kernel/sched/fair.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12005,8 +12005,19 @@ static bool nohz_idle_balance(struct rq *this_rq, enum cpu_idle_type idle)
1200512005
}
1200612006

1200712007
/*
12008-
* Check if we need to run the ILB for updating blocked load before entering
12009-
* idle state.
12008+
* Check if we need to directly run the ILB for updating blocked load before
12009+
* entering idle state. Here we run ILB directly without issuing IPIs.
12010+
*
12011+
* Note that when this function is called, the tick may not yet be stopped on
12012+
* this CPU yet. nohz.idle_cpus_mask is updated only when tick is stopped and
12013+
* cleared on the next busy tick. In other words, nohz.idle_cpus_mask updates
12014+
* don't align with CPUs enter/exit idle to avoid bottlenecks due to high idle
12015+
* entry/exit rate (usec). So it is possible that _nohz_idle_balance() is
12016+
* called from this function on (this) CPU that's not yet in the mask. That's
12017+
* OK because the goal of nohz_run_idle_balance() is to run ILB only for
12018+
* updating the blocked load of already idle CPUs without waking up one of
12019+
* those idle CPUs and outside the preempt disable / irq off phase of the local
12020+
* cpu about to enter idle, because it can take a long time.
1201012021
*/
1201112022
void nohz_run_idle_balance(int cpu)
1201212023
{

0 commit comments

Comments
 (0)