From a63fa747f0eaa49ccbdba02818733f6a1e54f931 Mon Sep 17 00:00:00 2001 From: Stephen Dickey Date: Tue, 15 Feb 2022 13:19:10 -0800 Subject: [PATCH] sched/walt: rename to sched_get_cpu_util_pct Cleanup to give units to sched_get_cpu_util. Change-Id: If04a3b38d7ff0c6c0a53edb0ed6014e7698b5195 Signed-off-by: Stephen Dickey --- kernel/sched/walt/core_ctl.c | 13 +++++++------ kernel/sched/walt/sched_avg.c | 2 +- kernel/sched/walt/walt.h | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/kernel/sched/walt/core_ctl.c b/kernel/sched/walt/core_ctl.c index 0f856727a16e..52e78df1cd2d 100644 --- a/kernel/sched/walt/core_ctl.c +++ b/kernel/sched/walt/core_ctl.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2014-2021, The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */ #define pr_fmt(fmt) "core_ctl: " fmt @@ -50,7 +51,7 @@ struct cluster_data { struct cpu_data { bool is_busy; - unsigned int busy; + unsigned int busy_pct; unsigned int cpu; bool not_preferred; struct cluster_data *cluster; @@ -328,7 +329,7 @@ static ssize_t show_global_state(const struct cluster_data *state, char *buf) "\tFirst CPU: %u\n", cluster->first_cpu); count += scnprintf(buf + count, PAGE_SIZE - count, - "\tBusy%%: %u\n", c->busy); + "\tBusy%%: %u\n", c->busy_pct); count += scnprintf(buf + count, PAGE_SIZE - count, "\tIs busy: %u\n", c->is_busy); count += scnprintf(buf + count, PAGE_SIZE - count, @@ -811,13 +812,13 @@ static bool eval_need(struct cluster_data *cluster) list_for_each_entry(c, &cluster->lru, sib) { bool old_is_busy = c->is_busy; - if (c->busy >= cluster->busy_up_thres[thres_idx] || + if (c->busy_pct >= cluster->busy_up_thres[thres_idx] || sched_cpu_high_irqload(c->cpu)) c->is_busy = true; - else if (c->busy < cluster->busy_down_thres[thres_idx]) + else if (c->busy_pct < cluster->busy_down_thres[thres_idx]) c->is_busy = false; - trace_core_ctl_set_busy(c->cpu, c->busy, old_is_busy, + trace_core_ctl_set_busy(c->cpu, c->busy_pct, old_is_busy, c->is_busy); need_cpus += c->is_busy; } @@ -984,7 +985,7 @@ void core_ctl_check(u64 window_start) if (!cluster || !cluster->inited) continue; - c->busy = sched_get_cpu_util(cpu); + c->busy_pct = sched_get_cpu_util_pct(cpu); } spin_unlock_irqrestore(&state_lock, flags); diff --git a/kernel/sched/walt/sched_avg.c b/kernel/sched/walt/sched_avg.c index cdf0e431498a..7fb3e0672e53 100644 --- a/kernel/sched/walt/sched_avg.c +++ b/kernel/sched/walt/sched_avg.c @@ -248,7 +248,7 @@ void sched_update_nr_prod(int cpu, int enq) /* * Returns the CPU utilization % in the last window. */ -unsigned int sched_get_cpu_util(int cpu) +unsigned int sched_get_cpu_util_pct(int cpu) { struct rq *rq = cpu_rq(cpu); u64 util; diff --git a/kernel/sched/walt/walt.h b/kernel/sched/walt/walt.h index a6036d8da2bb..96ba533bc618 100644 --- a/kernel/sched/walt/walt.h +++ b/kernel/sched/walt/walt.h @@ -161,7 +161,7 @@ extern void walt_boost_init(void); extern int sched_pause_cpus(struct cpumask *pause_cpus); extern int sched_unpause_cpus(struct cpumask *unpause_cpus); -extern unsigned int sched_get_cpu_util(int cpu); +extern unsigned int sched_get_cpu_util_pct(int cpu); extern void sched_update_hyst_times(void); extern int sched_boost_handler(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos);