sched/fair: Combine EAS check with root_domain::overutilized access
authorShrikanth Hegde <sshegde@linux.ibm.com>
Tue, 26 Mar 2024 15:26:16 +0000 (20:56 +0530)
committerIngo Molnar <mingo@kernel.org>
Thu, 28 Mar 2024 09:39:18 +0000 (10:39 +0100)
commit902e786c4a54a2c4f7462b9026bb56610888db3d
tree1562733605c2dc6a3a6b233b63bea99a8de3eef0
parentc829d6818b60c591f70c060b2bb75d76cf0cec6d
sched/fair: Combine EAS check with root_domain::overutilized access

Access to root_domainoverutilized is always used with sched_energy_enabled in
the pattern:

  if (sched_energy_enabled && !overutilized)
         do something

So modify the helper function to utilize this pattern. This is more
readable code as it would say, do something when root domain is not
overutilized. This function always return true when EAS is disabled.

No change in functionality intended.

Suggested-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20240326152616.380999-1-sshegde@linux.ibm.com
kernel/sched/fair.c