From mboxrd@z Thu Jan 1 00:00:00 1970 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 EFA4A287510; Fri, 8 May 2026 13:18:13 +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=1778246294; cv=none; b=TYCVqZGv3Xf/JShLgEOIvFu7Z9P+86dRXqj/qHfpXhuE8XWgjac3BjkQiQnTJr/IMck1maCvLI1ebGp2qJhX3Mz7y4OVlzhQWToM6KnLJ5y+l1iZMUjem+FgXrTUGaMNFmvn8Od4AZsKdEyALkx9SZI8nxvPhtxoHA4QdVQn7G4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778246294; c=relaxed/simple; bh=io8KrTBtq3aJ0dhYedSg6U8IhcLJD6XwOWmo7Hj3GGA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=e8sO4oyjgkbd4Ic6eb9wI8CbW/jBwAzaYDrtdQqPfvSvvUT4C1GFQ/xC99LhIsCmBO/cjtKvhXHxPrLjGa+exTdZEKRLutzHnS0WpQgA65pRwOe2Qtt2C8JIFZU5mDtsN62rsCOH8NTKvcewmk8Gv7gdVz4aMMs0Gg82um30hZQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c7kaX+Hp; 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="c7kaX+Hp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AC48C2BCF4; Fri, 8 May 2026 13:18:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778246293; bh=io8KrTBtq3aJ0dhYedSg6U8IhcLJD6XwOWmo7Hj3GGA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c7kaX+HpxT9hK7ECL2jsK351GfD7WROm3hbyW+Wg3u8NNzz91ipj3ampGwqVUNFVw iKIN7zRlETgkKLvkE2a8ud8XkYj3IoQgP3haZu54yNH2riW1kxVBA2u084Uwuoxqug a8TOGGU0whl5mklifqizpKBkI7d9MumfKI8+K/Qxcm6NVVpsPPhjjHgsbfn8opTeJt IUDkr+VL6vXyC0YQ9melD2ClEdwBycY3ZgIQFFBrDU74ekJwC6wvhffbMw9bhC4tlD Ptl/w+hZHq6daCsDuo1c7EPjoElFSlHMH9QaGIwXKwtGJem9xrytyOHmqcs/N1IzsB EIkt+AufnCm5w== 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 , 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 , Sashiko, 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 08/15] tick/sched: Remove nohz disabled special case in cputime fetch Date: Fri, 8 May 2026 15:16:40 +0200 Message-ID: <20260508131647.43868-9-frederic@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260508131647.43868-1-frederic@kernel.org> References: <20260508131647.43868-1-frederic@kernel.org> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 c3efd3583cf9..cb235ec7d2d6 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_usage_stat idx, ktime_t now, idle; unsigned int seq; - if (!tick_nohz_active) - return -1; - now = ktime_get(); if (last_update_time) *last_update_time = ktime_to_us(now); @@ -839,7 +836,7 @@ static u64 get_cpu_sleep_time_us(int cpu, enum cpu_usage_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) { @@ -863,7 +860,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) { -- 2.53.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F1C6CCD3436 for ; Fri, 8 May 2026 13:18:17 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4gBqS84rQRz3bjN; Fri, 08 May 2026 23:18:16 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2600:3c0a:e001:78e:0:1991:8:25" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1778246296; cv=none; b=Pokk76Wd7z1SxsS6Fp8yo543WXWLA2xTW2OsJZ2PCekKFEboJQmBD3Vbln0HryonEPzLtGaIeN3FvqgKn6grQWJtRA3UIBMZb9gR7/1/EPhOtqiuJwG+4Gu+yXE0GmgqBG56W1w49uv0BBOsVKLPV1hLT972HUKO3xihmVOd028qzjgYq3B1GkKPlWLNBgdzYxZo7V32iADc1J1VsSMoGJG0pJEoQAFG6BAC4+dhR6p+JBGOEV4C0DvzrOI8WNum2jwT8CIHV2B9UIn5/oO9pFAVwMpgpAoYH6+/AdKOxvC4HWv7yCaRDugSzb1Q5t+TV/2cB1ulL2aan2tYPoiJSA== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1778246296; c=relaxed/relaxed; bh=DysSSD+zijAkT9g3xvIyMU4mSeKMOgmNgfs72VkPB9s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T3p0k6xzDVFnWDyhtwPsAATaWc6NqK/ezTkC/RNFzIb5PLGOUpKBFuhxAZTDDV6zuQNSr0QFqeOnqsyaVWvHo5qoH4SCZ7IN0pqDgxxrGyKxkk0hoj9ZBGicneNNI5INQNUxpDhAm45MtXPtXcGjaUqeS1Nj3ezBLELmZC2yRBYd/noE4ciEXRJTN4r1UjqdmPCYD3LLmAv2brlPKErTYQrZ2welgu5DNt2S80B+VMfrB2RnG3TC0/q+e1vgJ8Vtv4HIkEIfzUkkMKsbqefbERs02RKfdtCnPErYN1VCSLLX2BwVI/h9jU/U6Dt5399aekdbCvW+cm/tXXJgnBEfbQ== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=c7kaX+Hp; dkim-atps=neutral; spf=pass (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=frederic@kernel.org; receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=c7kaX+Hp; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=frederic@kernel.org; receiver=lists.ozlabs.org) Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4gBqS75r5Cz30V2 for ; Fri, 08 May 2026 23:18:15 +1000 (AEST) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id D55FA437E8; Fri, 8 May 2026 13:18:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AC48C2BCF4; Fri, 8 May 2026 13:18:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778246293; bh=io8KrTBtq3aJ0dhYedSg6U8IhcLJD6XwOWmo7Hj3GGA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c7kaX+HpxT9hK7ECL2jsK351GfD7WROm3hbyW+Wg3u8NNzz91ipj3ampGwqVUNFVw iKIN7zRlETgkKLvkE2a8ud8XkYj3IoQgP3haZu54yNH2riW1kxVBA2u084Uwuoxqug a8TOGGU0whl5mklifqizpKBkI7d9MumfKI8+K/Qxcm6NVVpsPPhjjHgsbfn8opTeJt IUDkr+VL6vXyC0YQ9melD2ClEdwBycY3ZgIQFFBrDU74ekJwC6wvhffbMw9bhC4tlD Ptl/w+hZHq6daCsDuo1c7EPjoElFSlHMH9QaGIwXKwtGJem9xrytyOHmqcs/N1IzsB EIkt+AufnCm5w== 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 , 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 , Sashiko@lists.ozlabs.org, 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 08/15] tick/sched: Remove nohz disabled special case in cputime fetch Date: Fri, 8 May 2026 15:16:40 +0200 Message-ID: <20260508131647.43868-9-frederic@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260508131647.43868-1-frederic@kernel.org> References: <20260508131647.43868-1-frederic@kernel.org> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 c3efd3583cf9..cb235ec7d2d6 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_usage_stat idx, ktime_t now, idle; unsigned int seq; - if (!tick_nohz_active) - return -1; - now = ktime_get(); if (last_update_time) *last_update_time = ktime_to_us(now); @@ -839,7 +836,7 @@ static u64 get_cpu_sleep_time_us(int cpu, enum cpu_usage_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) { @@ -863,7 +860,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) { -- 2.53.0