Re: [PATCH 3/4] s390/idle: Provide arch specific kcpustat_field_idle()/kcpustat_field_iowait()
From: Heiko Carstens
Date: Wed Jun 17 2026 - 10:34:05 EST
On Wed, Jun 17, 2026 at 04:18:14PM +0200, Uwe Kleine-König wrote:
> Hello,
>
> On Wed, May 13, 2026 at 04:01:28PM +0200, Heiko Carstens wrote:
> > The former s390 specific arch_cpu_idle_time() implementation was
> > removed, since its implementation was racy and reported idle time
> > could go backwards [1].
> >
> > However this removal was not necessary, since independently of the s390
> > architecture specific races there exists the iowait counter update race,
> > which can also lead to reported idle time going backwards [2].
> >
> > With Frederic Weisbecker's recent cpu idle time accounting refactoring
> > kernel_cpustat got a sequence counter. Use this to implement s390 specific
> > variants of kcpustat_field_idle() and kcpustat_field_iowait(). This is
> > logically a revert of [1] and moves cpu idle time accounting back into s390
> > architecture code, which is also more precise than the dyntick idle time
> > accounting by nohz/scheduler.
> >
> > For comparing cross cpu time stamps it is necessary to use the stcke
> > instead of the stckf instruction in irq entry path. Furthermore this
> > open-codes a sequence lock in assembler and C code, which is required to
> > update the irq entry time stamp to the per cpu idle_data structure in a
> > race free manner.
> >
> > [1] commit be76ea614460 ("s390/idle: remove arch_cpu_idle_time() and corresponding code")
> > [2] commit ead70b752373 ("timers/nohz: Add a comment about broken iowait counter update race")
> >
> > Signed-off-by: Heiko Carstens <hca@xxxxxxxxxxxxx>
>
> This patch became 670e057744e0cc8047bf96d15d18c46e16ae2e93 and is
> included in next-20260616.
>
> s390 allmodconfig fails to build with:
>
> ERROR: modpost: "arch_kcpustat_field_idle" [drivers/leds/trigger/ledtrig-activity.ko] undefined!
> ERROR: modpost: "arch_kcpustat_field_iowait" [drivers/leds/trigger/ledtrig-activity.ko] undefined!
Ah, looks like I missed to add EXPORT_SYMBOLS(). Will fix.
Thanks for reporting!