From nobody Wed Apr 1 11:04:09 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 6A2473DFC9D; Tue, 31 Mar 2026 13:17:25 +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=1774963045; cv=none; b=sO+Q9/j5BpaDmcSnBNJGV8Fzd0Y6WlfM8vO6R79VRrphaTl8z+lxMO+Iqj54bo29DrZh+FD7N1s59BpRivyKkCJ5BBDTOafeBlcFqWjUzJCaPS7peDNAeJVr4lL0c2OBsKVQeWBbxAvod5Z7qeDMFOi6pbEYzd2zm4FCJCpxVsw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774963045; c=relaxed/simple; bh=Xsd0PjsmWwW/3jYc4ig871UilSeg7MyzpojJFWzDitk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M8hBTzGfgJA/mdLZI03G0iMn362Eaysg+QXLz2QOVj5d5mvzF3uhRyyjn65YF0DTJ61PzinkXAuf+BeR+RhrSOSkMt6sG4uAUsplC8vna1Ni2O6Lv6vxoQbcu0XMCtroNo0xC5o1wzgtC/Jc3bDwwbI/YHHc6/jtnGdVZurAjns= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lIah65/w; 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="lIah65/w" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23640C2BC9E; Tue, 31 Mar 2026 13:17:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774963045; bh=Xsd0PjsmWwW/3jYc4ig871UilSeg7MyzpojJFWzDitk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lIah65/wzsxzwGZ99T9GeGNiYWhsGOJU59bgHBoNcb7G3lAfWXIXJ4FrxMM3oqT5q 1iNy13Cf/k4ifDJ7LTHwnR9FAyw95Z+HjmSnij8ZkZ0Sv/GemvfLSFI0g9C0+a87is x4lsfqYOO/YMoNPsRMW34kGGFbpygDjM//8wsaN0d2AXrdR3rgMLzeCD51vrOFg86p 95NERasKnzLq/53XXi1taHs6DkO38r5snxxz6UAHODARv1pGayZ5xBxuE6HixFR9HI DIlqDoayQzKuUjJ5ycv4aBChjmLHRPHgBaRgyixnybB/geaMr4+Fvj58dgdg8LKLU9 ioskn+maxujGg== 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 , Shrikanth Hegde , 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/14] tick/sched: Remove nohz disabled special case in cputime fetch Date: Tue, 31 Mar 2026 15:16:15 +0200 Message-ID: <20260331131622.30505-8-frederic@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260331131622.30505-1-frederic@kernel.org> References: <20260331131622.30505-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" Even when nohz is not runtime enabled, the dynticks idle cputime accounting can run and the common idle cputime accessors are still relevant. Remove the nohz disabled special case accordingly. Signed-off-by: Frederic Weisbecker Tested-by: Shrikanth Hegde --- kernel/time/tick-sched.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 2c0f0b81f452..6cd7777755dd 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -795,9 +795,6 @@ static u64 get_cpu_sleep_time_us(int cpu, enum cpu_usag= e_stat idx, ktime_t now, idle; unsigned int seq; =20 - if (!tick_nohz_active) - return -1; - now =3D ktime_get(); if (last_update_time) *last_update_time =3D ktime_to_us(now); @@ -838,7 +835,7 @@ static u64 get_cpu_sleep_time_us(int cpu, enum cpu_usag= e_stat idx, * This time is measured via accounting rather than sampling, * and is as accurate as ktime_get() is. * - * Return: -1 if NOHZ is not enabled, else total idle time of the @cpu + * Return: -1 if generic vtime is enabled, else total idle time of the @cpu */ u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time) { @@ -862,7 +859,7 @@ EXPORT_SYMBOL_GPL(get_cpu_idle_time_us); * This time is measured via accounting rather than sampling, * and is as accurate as ktime_get() is. * - * Return: -1 if NOHZ is not enabled, else total iowait time of @cpu + * Return: -1 if generic vtime is enabled, else total iowait time of @cpu */ u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time) { --=20 2.53.0