[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aYZsol2OIzMxoJXv@pavilion.home>
Date: Fri, 6 Feb 2026 23:35:14 +0100
From: Frederic Weisbecker <frederic@...nel.org>
To: LKML <linux-kernel@...r.kernel.org>
Cc: "Christophe Leroy (CS GROUP)" <chleroy@...nel.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
Anna-Maria Behnsen <anna-maria@...utronix.de>,
Ben Segall <bsegall@...gle.com>, Boqun Feng <boqun.feng@...il.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Heiko Carstens <hca@...ux.ibm.com>, Ingo Molnar <mingo@...hat.com>,
Jan Kiszka <jan.kiszka@...mens.com>,
Joel Fernandes <joelagnelf@...dia.com>,
Juri Lelli <juri.lelli@...hat.com>,
Kieran Bingham <kbingham@...nel.org>,
Madhavan Srinivasan <maddy@...ux.ibm.com>,
Mel Gorman <mgorman@...e.de>, Michael Ellerman <mpe@...erman.id.au>,
Neeraj Upadhyay <neeraj.upadhyay@...nel.org>,
Nicholas Piggin <npiggin@...il.com>,
"Paul E . McKenney" <paulmck@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Steven Rostedt <rostedt@...dmis.org>,
Sven Schnelle <svens@...ux.ibm.com>,
Thomas Gleixner <tglx@...utronix.de>,
Uladzislau Rezki <urezki@...il.com>,
Valentin Schneider <vschneid@...hat.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Viresh Kumar <viresh.kumar@...aro.org>,
Xin Zhao <jackzxcui1989@....com>, linux-pm@...r.kernel.org,
linux-s390@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
Shrikanth Hegde <sshegde@...ux.ibm.com>
Subject: Re: [PATCH 12/15] tick/sched: Consolidate idle time fetching APIs
Le Fri, Feb 06, 2026 at 03:22:42PM +0100, Frederic Weisbecker a écrit :
> +static u64 get_cpu_sleep_time_us(int cpu, enum cpu_usage_stat idx,
> + bool compute_delta, u64 *last_update_time)
> +{
> + ktime_t now = ktime_get();
> + u64 res;
> +
> + if (vtime_generic_enabled_cpu(cpu))
> + res = kcpustat_field(idx, cpu);
> + else
> + res = kcpustat_field_dyntick(cpu, idx, compute_delta, now);
> +
> + do_div(res, NSEC_PER_USEC);
> +
> + if (last_update_time)
> + *last_update_time = res;
Urgh, this should be *last_update_time = ktime_to_us(now)
--
Frederic Weisbecker
SUSE Labs
Powered by blists - more mailing lists