diff options
| author | Frederic Weisbecker <frederic@kernel.org> | 2026-01-28 17:05:27 +0100 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2026-01-28 22:24:58 +0100 |
| commit | a554a25e66efea0b78fb3d24f4f19289e037c0dc (patch) | |
| tree | 39f69758cabff9e3538b039a6f3ad3aacbacfe1a /drivers | |
| parent | cc764d3bbd545d7d6f5f66ac678ffc522d75f0f9 (diff) | |
cpufreq: ondemand: Simplify idle cputime granularity test
cpufreq calls get_cpu_idle_time_us() just to know if idle cputime
accounting has a nanoseconds granularity.
Use the appropriate indicator instead to make that deduction.
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://patch.msgid.link/aXozx0PXutnm8ECX@localhost.localdomain
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/cpufreq/cpufreq_ondemand.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index a6ecc203f7b7..bb7db82930e4 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c @@ -334,17 +334,12 @@ static void od_free(struct policy_dbs_info *policy_dbs) static int od_init(struct dbs_data *dbs_data) { struct od_dbs_tuners *tuners; - u64 idle_time; - int cpu; tuners = kzalloc(sizeof(*tuners), GFP_KERNEL); if (!tuners) return -ENOMEM; - cpu = get_cpu(); - idle_time = get_cpu_idle_time_us(cpu, NULL); - put_cpu(); - if (idle_time != -1ULL) { + if (tick_nohz_is_active()) { /* Idle micro accounting is supported. Use finer thresholds */ dbs_data->up_threshold = MICRO_FREQUENCY_UP_THRESHOLD; } else { |
