Re: [RFC PATCH v2 15/18] struct filename: saner handling of long names

Al Viro <[email protected]>
Newsgroups org.kernel.vger.audit,org.kernel.vger.io-uring,org.kernel.vger.linux-fsdevel
Message-ID <20251130040622.GO3538@ZenIV>
On Sat, Nov 29, 2025 at 06:33:22PM +0100, Mateusz Guzik wrote:

> This makes sizeof struct filename 152 bytes. At the same time because
> of the SLAB_HWCACHE_ALIGN flag, the obj is going to take 192 bytes.
> 
> I don't know what would be the nice way to handle this in Linux, but
> as is this is just failing to take advantage of memory which is going
> to get allocated anyway.
> 
> Perhaps the macro could be bumped to 168 and the size checked with a
> static assert on 64 bit platforms?

Could be done, even though I wonder how much would that really save.

> Or some magic based on reported
> cache line size.

No comments.  At least, none suitable for polite company.

BTW, one thing that might make sense is storing the name length in there...
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.