[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251204175405.1511340-3-srikar@linux.ibm.com>
Date: Thu, 4 Dec 2025 23:23:50 +0530
From: Srikar Dronamraju <srikar@...ux.ibm.com>
To: linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
Peter Zijlstra <peterz@...radead.org>
Cc: Ben Segall <bsegall@...gle.com>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Ingo Molnar <mingo@...nel.org>, Juri Lelli <juri.lelli@...hat.com>,
K Prateek Nayak <kprateek.nayak@....com>,
Madhavan Srinivasan <maddy@...ux.ibm.com>,
Mel Gorman <mgorman@...e.de>, Michael Ellerman <mpe@...erman.id.au>,
Nicholas Piggin <npiggin@...il.com>,
Shrikanth Hegde <sshegde@...ux.ibm.com>,
Srikar Dronamraju <srikar@...ux.ibm.com>,
Steven Rostedt <rostedt@...dmis.org>,
Swapnil Sapkal <swapnil.sapkal@....com>,
Thomas Huth <thuth@...hat.com>,
Valentin Schneider <vschneid@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
virtualization@...ts.linux.dev, Yicong Yang <yangyicong@...ilicon.com>,
Ilya Leoshkevich <iii@...ux.ibm.com>
Subject: [PATCH 02/17] powerpc/lpar: Reorder steal accounting calculation
There is no functional change. Calculated steal could be used in the
subsequent changes. Hence reordering the function.
Signed-off-by: Srikar Dronamraju <srikar@...ux.ibm.com>
---
arch/powerpc/platforms/pseries/lpar.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 6a415febc53b..dde12b27ba60 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -662,15 +662,20 @@ machine_device_initcall(pseries, vcpudispatch_stats_procfs_init);
u64 pseries_paravirt_steal_clock(int cpu)
{
struct lppaca *lppaca = &lppaca_of(cpu);
+ unsigned long steal;
+
+ steal = be64_to_cpu(READ_ONCE(lppaca->ready_enqueue_tb));
+ steal += be64_to_cpu(READ_ONCE(lppaca->enqueue_dispatch_tb));
/*
* VPA steal time counters are reported at TB frequency. Hence do a
- * conversion to ns before returning
+ * conversion to ns before using.
*/
- return tb_to_ns(be64_to_cpu(READ_ONCE(lppaca->enqueue_dispatch_tb)) +
- be64_to_cpu(READ_ONCE(lppaca->ready_enqueue_tb)));
+ steal = tb_to_ns(steal);
+
+ return steal;
}
-#endif
+#endif /* CONFIG_PARAVIRT_TIME_ACCOUNTING */
#endif /* CONFIG_PPC_SPLPAR */
--
2.43.7
Powered by blists - more mailing lists