Re: [PATCH v2 12/12] s390/preempt: Enable HAS_SEPARATE_PREEMPT_RESCHED_BITS
From: Heiko Carstens
Date: Thu May 28 2026 - 11:39:29 EST
On Thu, May 28, 2026 at 07:41:24AM -0700, Boqun Feng wrote:
> On Thu, May 28, 2026 at 12:53:25PM +0200, Peter Zijlstra wrote:
> > On Tue, May 26, 2026 at 08:21:48AM -0700, Boqun Feng wrote:
> > > From: Heiko Carstens <hca@xxxxxxxxxxxxx>
> > > diff --git a/arch/s390/include/asm/lowcore.h b/arch/s390/include/asm/lowcore.h
> > > index 50ffe75adeb4..0974ab278169 100644
> > > --- a/arch/s390/include/asm/lowcore.h
> > > +++ b/arch/s390/include/asm/lowcore.h
> > > @@ -160,10 +160,15 @@ struct lowcore {
> > > /* SMP info area */
> > > __u32 cpu_nr; /* 0x03a0 */
> > > __u32 softirq_pending; /* 0x03a4 */
> > > - __s32 preempt_count; /* 0x03a8 */
> > > - __u32 spinlock_lockval; /* 0x03ac */
> > > - __u32 spinlock_index; /* 0x03b0 */
> > > - __u8 pad_0x03b4[0x03b8-0x03b4]; /* 0x03b4 */
> > > + union {
Ä> > > + struct {
> > > + __u32 need_resched; /* 0x03a8 */
> > > + __u32 count; /* 0x03ac */
> > > + } preempt;
> > > + __u64 preempt_count; /* 0x03a8 */
> > > + };
> >
> > I'm a little confused by this union; afaict it isn't actually used.
>
> (TIL: s390 is big endian)
>
> In preempt_count() the union is used for reading the lower 32bits in an
> asm block.
Yes, it is used there to read only the lower 32 bits (count) in order
to avoid masking out the higher 32 bits, which would be required with
a 64 bit load.