Skip to content

Commit 94e7073

Browse files
Shrikanth HegdePeter Zijlstra
authored andcommitted
sched/fair: Change likelyhood of nohz.nr_cpus
These days most of the system have multi cores. The likelyhood of at least one or more CPUs in nohz (idle state) is higher. Give accurate hint to the branch predictor. 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-3-sshegde@linux.ibm.com
1 parent 6b67c8a commit 94e7073

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

kernel/sched/fair.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12459,9 +12459,9 @@ static void nohz_balancer_kick(struct rq *rq)
1245912459

1246012460
/*
1246112461
* None are in tickless mode and hence no need for NOHZ idle load
12462-
* balancing:
12462+
* balancing
1246312463
*/
12464-
if (likely(!atomic_read(&nohz.nr_cpus)))
12464+
if (unlikely(!atomic_read(&nohz.nr_cpus)))
1246512465
return;
1246612466

1246712467
if (rq->nr_running >= 2) {

0 commit comments

Comments
 (0)