Re: [PATCH 04/20] dissolve external_name.u into separate members

Al Viro
2025-01-10T16:46:38Z

On Fri, Jan 10, 2025 at 07:34:11AM +0000, David Howells wrote:
> Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> > struct external_name {
> > - struct {
> > - atomic_t count; // ->count and ->head can't be combined
> > - struct rcu_head head; // see take_dentry_name_snapshot()
> > - } u;
> > + atomic_t count; // ->count and ->head can't be combined
> > + struct rcu_head head; // see take_dentry_name_snapshot()
> > unsigned char name[];
> > };
>
> This gets you a 4-byte hole between count and head on a 64-bit system. Did
> you want to flip the order of count and head?

Umm... Could do, but that probably wouldn't be that much of a win - we use
those for names >= 40 characters long, and currently the size is 25 + len
bytes. And it's kmalloc'ed, so anything in range 40...71 goes into kmalloc-96.

Reordering those would have 40..43 land in kmalloc-64, leaving the rest as-is.
Might as well...