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

From: Mateusz Guzik

Date: Sun Nov 23 2025 - 14:48:00 EST


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.