Re: [RFC PATCH 2/3] s390/idle: Provide arch specific kcpustat_field_idle()/kcpustat_field_iowait()

From: Heiko Carstens

Date: Fri Mar 20 2026 - 08:35:20 EST


On Wed, Mar 11, 2026 at 05:13:59PM +0100, Frederic Weisbecker wrote:
> Le Wed, Feb 25, 2026 at 03:51:45PM +0100, Heiko Carstens a écrit :
> > diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
> > index 4873fe9d891b..19fd1541a0f3 100644
> > --- a/arch/s390/kernel/entry.S
> > +++ b/arch/s390/kernel/entry.S
> > @@ -378,8 +378,13 @@ SYM_CODE_END(pgm_check_handler)
> > SYM_CODE_START(\name)
> > STMG_LC %r8,%r15,__LC_SAVE_AREA
> > GET_LC %r13
> > - stckf __LC_INT_CLOCK(%r13)
> > + lg %r12,__LC_IDLE_DATA(%r13)
> > + asi __IDLE_SEQUENCE(%r12),1
> > + stcke __LC_INT_CLOCK(%r13)
> > stpt __LC_SYS_ENTER_TIMER(%r13)
> > + mvc __IDLE_CLOCK_EXIT(16,%r12),__LC_INT_CLOCK(%r13)
> > + ALTERNATIVE "bcr 15,0", "bcr 14,0", ALT_FACILITY(45)
> > + asi __IDLE_SEQUENCE(%r12),1
>
> Would it be possible to instead do that with &kc->idle_sleeptime_seq ?
> This should sum up to a simple increment as well. This way you don't need
> those nested seqcounts.

Yes, that was my first thought when implementing this. But decided
against it since I thought it wouldn't be such a good idea to directly
access members of common code locking structures from asm
code. However, since you mention this too, I'll reconsider :)

Please move forward with your current patch set and ignore this patch
for now. I'll provide an updated version later, however will be on
vacation for now.