Re: [PATCH v2] fs: hide names_cache behind runtime const machinery
From: Al Viro
Date: Tue Dec 02 2025 - 01:32:25 EST
On Tue, Dec 02, 2025 at 07:18:16AM +0100, Mateusz Guzik wrote:
> The claim was not that your idea results in insurmountable churn. The
> claim was *both* your idea and runtime const require churn on per kmem
> cache basis. Then the question is if one is going to churn it
> regardless, why this way over runtime const. I do think the runtime
> thing is a little bit less churn and less work on the mm side to get
> it going, but then the runtime thing *itself* needs productizing
> (which I'm not signing up to do).
Umm... runtime thing is lovely for shifts, but for pointers it's
going to be a headache on a bunch of architectures; for something
like dentry_hashtable it's either that or the cost of dereference,
but for kmem_cache I'd try it - if architecture has a good way for
"load a 64bit constant into a register staying within I$", I'd
expect the code generated for &global_variable to be not worse than
that, after all.
Churn is pretty much negligible in case of core kernel caches either
way.
As for the amount of churn in mm/*... Turns out to be fairly minor;
kmem_cache_args allows to propagate it without any calling convention
changes.
I'll post when I get it to reasonable shape - so far it looks easy...