Commit 6b67c8a
sched/fair: Move checking for nohz cpus after time check
Current code does.
- Read nohz.nr_cpus
- Check if the time has passed to do NOHZ idle balance
Instead do this.
- Check if the time has passed to do NOHZ idle balance
- Read nohz.nr_cpus
This will skip the read most of the time in normal system usage.
i.e when there are nohz.nr_cpus (system is not 100% busy).
Note that when there are no idle CPUs(100% busy), even if the flag gets
set to NOHZ_STATS_KICK | NOHZ_NEXT_KICK, find_new_ilb will fail and
there will be no NOHZ idle balance. In such cases there will be a very
narrow window where, kick_ilb will be called un-necessarily.
However current functionality is still retained.
Note: This patch doesn't solve any cacheline overheads. No improvement
in performance apart from saving a few cycles of reading nohz.nr_cpus
Reviewed-and-tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://patch.msgid.link/20260115073524.376643-2-sshegde@linux.ibm.com1 parent 553255c commit 6b67c8a
1 file changed
Lines changed: 16 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12441 | 12441 | | |
12442 | 12442 | | |
12443 | 12443 | | |
12444 | | - | |
12445 | | - | |
12446 | | - | |
12447 | | - | |
12448 | | - | |
12449 | | - | |
12450 | | - | |
12451 | 12444 | | |
12452 | 12445 | | |
12453 | 12446 | | |
12454 | 12447 | | |
| 12448 | + | |
| 12449 | + | |
| 12450 | + | |
| 12451 | + | |
| 12452 | + | |
| 12453 | + | |
| 12454 | + | |
| 12455 | + | |
| 12456 | + | |
12455 | 12457 | | |
12456 | 12458 | | |
12457 | 12459 | | |
| 12460 | + | |
| 12461 | + | |
| 12462 | + | |
| 12463 | + | |
| 12464 | + | |
| 12465 | + | |
| 12466 | + | |
12458 | 12467 | | |
12459 | 12468 | | |
12460 | 12469 | | |
| |||
0 commit comments