mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 02:01:18 -04:00
sched/fair: Use sched_energy_enabled()
Use helper sched_energy_enabled() everywhere we want to test if EAS is enabled instead of mixing sched_energy_enabled() and direct call to static_branch_unlikely(). No functional change Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://patch.msgid.link/20260327132013.2800517-1-vincent.guittot@linaro.org
This commit is contained in:
committed by
Peter Zijlstra
parent
b049b81bdf
commit
2d4cc371ba
@@ -273,7 +273,7 @@ void rebuild_sched_domains_energy(void)
|
||||
static int sched_energy_aware_handler(const struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int ret, state;
|
||||
int ret;
|
||||
|
||||
if (write && !capable(CAP_SYS_ADMIN))
|
||||
return -EPERM;
|
||||
@@ -289,8 +289,7 @@ static int sched_energy_aware_handler(const struct ctl_table *table, int write,
|
||||
|
||||
ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
|
||||
if (!ret && write) {
|
||||
state = static_branch_unlikely(&sched_energy_present);
|
||||
if (state != sysctl_sched_energy_aware)
|
||||
if (sysctl_sched_energy_aware != sched_energy_enabled())
|
||||
rebuild_sched_domains_energy();
|
||||
}
|
||||
|
||||
@@ -388,11 +387,11 @@ static void destroy_perf_domain_rcu(struct rcu_head *rp)
|
||||
|
||||
static void sched_energy_set(bool has_eas)
|
||||
{
|
||||
if (!has_eas && static_branch_unlikely(&sched_energy_present)) {
|
||||
if (!has_eas && sched_energy_enabled()) {
|
||||
if (sched_debug())
|
||||
pr_info("%s: stopping EAS\n", __func__);
|
||||
static_branch_disable_cpuslocked(&sched_energy_present);
|
||||
} else if (has_eas && !static_branch_unlikely(&sched_energy_present)) {
|
||||
} else if (has_eas && !sched_energy_enabled()) {
|
||||
if (sched_debug())
|
||||
pr_info("%s: starting EAS\n", __func__);
|
||||
static_branch_enable_cpuslocked(&sched_energy_present);
|
||||
|
||||
Reference in New Issue
Block a user