From nobody Sun Feb 8 05:36:59 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 82294394469; Fri, 16 Jan 2026 14:53:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768575191; cv=none; b=lvVUPb0CIzyF7pu9PaJxCMaCwIxrqSL5u7qZT3WRBLbvXlMvwfirzLkItc+jNQn5+c+DK9Duv3oeXYfw6lOlieqCINX2QQ5JmgeqJ+Vw9z8hvzO413rLlWGIQCYKMXMjusbNGGPSvUhWUKNSZqjWs7yZINm3OZBCL0Eqmn7labc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768575191; c=relaxed/simple; bh=TzrKoRirKu2E+jAiuhlzsln8JBhROUV36dDGy9tKFsw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AoKRgsphjvgq1vvRKGW7EKP4fS904kY+Bcnm4m+bsXGEnNqw5Xrf4QI01cZwUN+Z6ykuPCZ9WFzm0ABA+Qw4deG2Kj+WPPW39TpGDWht8CoBURnsCRyWFMpa76OSzJUd7oKi85xolKthrbps3gNEcPH1xwfoR/Zy9loYU7+HxkM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AUnnY7SK; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AUnnY7SK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4A0FC19421; Fri, 16 Jan 2026 14:53:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768575191; bh=TzrKoRirKu2E+jAiuhlzsln8JBhROUV36dDGy9tKFsw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AUnnY7SK3ALhVTftF+V//K5xP8H7lrjkEswZ+U2Y2mPJfJsD3b2iS1zkZM/21hkDb otcvgtr3VNOsAa5lRYT6msuhiOEdltnRqueCWPAs3RmlhuxjPkj0MoZRyQYXkCVkp+ EEa529KqpaVkr3RPuZTwr5AB9LQEXD1IOjZhct9kLv/VlIEdQtP5Pg0qGxOgAtdzuG zKl2D/2NbJb9yEWBpc2c6pyOL9cKpOdjPb072dxVwl4v4i2PACLu684MJTdcq35VeG yuc16NjatOamu0X8Rn+5hd5bF/GzfXEYSr+6rWj9yP9o2l3izkMwerxfrSQRHI6L2Y YEhsuz1tKeRPA== From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , "Christophe Leroy (CS GROUP)" , "Rafael J. Wysocki" , Alexander Gordeev , Anna-Maria Behnsen , Ben Segall , Boqun Feng , Christian Borntraeger , Dietmar Eggemann , Heiko Carstens , Ingo Molnar , Jan Kiszka , Joel Fernandes , Juri Lelli , Kieran Bingham , Madhavan Srinivasan , Mel Gorman , Michael Ellerman , Neeraj Upadhyay , Nicholas Piggin , "Paul E . McKenney" , Peter Zijlstra , Steven Rostedt , Sven Schnelle , Thomas Gleixner , Uladzislau Rezki , Valentin Schneider , Vasily Gorbik , Vincent Guittot , Viresh Kumar , Xin Zhao , linux-pm@vger.kernel.org, linux-s390@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH 07/15] cpufreq: ondemand: Simplify idle cputime granularity test Date: Fri, 16 Jan 2026 15:52:00 +0100 Message-ID: <20260116145208.87445-8-frederic@kernel.org> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20260116145208.87445-1-frederic@kernel.org> References: <20260116145208.87445-1-frederic@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Acked-by: Rafael J. Wysocki (Intel) Acked-by: Viresh Kumar --- drivers/cpufreq/cpufreq_ondemand.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_o= ndemand.c index a6ecc203f7b7..2d52ee035702 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_db= s) static int od_init(struct dbs_data *dbs_data) { struct od_dbs_tuners *tuners; - u64 idle_time; - int cpu; =20 tuners =3D kzalloc(sizeof(*tuners), GFP_KERNEL); if (!tuners) return -ENOMEM; =20 - cpu =3D get_cpu(); - idle_time =3D get_cpu_idle_time_us(cpu, NULL); - put_cpu(); - if (idle_time !=3D -1ULL) { + if (tick_nohz_enabled) { /* Idle micro accounting is supported. Use finer thresholds */ dbs_data->up_threshold =3D MICRO_FREQUENCY_UP_THRESHOLD; } else { --=20 2.51.1