Re: [PATCH 2/3] ns: pad refcount

From: Oleg Nesterov
Date: Mon Nov 24 2025 - 13:25:39 EST


On 11/23, Mateusz Guzik wrote:
>
> On Sun, Nov 23, 2025 at 7:58 PM Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
> >
> > On 11/23, Mateusz Guzik wrote:
> > >
> > > struct ns_common {
> > > + struct {
> > > + refcount_t __ns_ref; /* do not use directly */
> > > + } ____cacheline_aligned_in_smp;
> >
> > Cough... stupid question. Why not just
> >
> > refcount_t __ns_ref ____cacheline_aligned_in_smp;
> >
> > ? why do we need the anonymous struct?
> >
>
> This would merely align the offset of the field, with the rest
> directly following.

Ah. I didn't bother to read the changelog and misunderstood the intent.

OK, thanks. At least I have warned you that my question is stupid ;)

Oleg.