Skip to content

Commit e25a7a9

Browse files
Valentin SchneiderPeter Zijlstra
authored andcommitted
sched/fair: Comment some nohz_balancer_kick() kick conditions
We now have a comment explaining the first sched_domain based NOHZ kick, so might as well comment them all. While at it, unwrap a line that fits under 80 characters. Co-authored-by: Peter Zijlstra <[email protected]> Signed-off-by: Valentin Schneider <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Dave Hansen <[email protected]> Cc: [email protected] Cc: H. Peter Anvin <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 4c47acd commit e25a7a9

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

kernel/sched/fair.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9612,15 +9612,24 @@ static void nohz_balancer_kick(struct rq *rq)
96129612

96139613
sd = rcu_dereference(rq->sd);
96149614
if (sd) {
9615-
if ((rq->cfs.h_nr_running >= 1) &&
9616-
check_cpu_capacity(rq, sd)) {
9615+
/*
9616+
* If there's a CFS task and the current CPU has reduced
9617+
* capacity; kick the ILB to see if there's a better CPU to run
9618+
* on.
9619+
*/
9620+
if (rq->cfs.h_nr_running >= 1 && check_cpu_capacity(rq, sd)) {
96179621
flags = NOHZ_KICK_MASK;
96189622
goto unlock;
96199623
}
96209624
}
96219625

96229626
sd = rcu_dereference(per_cpu(sd_asym_packing, cpu));
96239627
if (sd) {
9628+
/*
9629+
* When ASYM_PACKING; see if there's a more preferred CPU
9630+
* currently idle; in which case, kick the ILB to move tasks
9631+
* around.
9632+
*/
96249633
for_each_cpu_and(i, sched_domain_span(sd), nohz.idle_cpus_mask) {
96259634
if (sched_asym_prefer(i, cpu)) {
96269635
flags = NOHZ_KICK_MASK;

0 commit comments

Comments
 (0)