On 5/25/22 23:36, Linus Torvalds wrote: > Because it used to be that stack depot users were fairly easy to > figure out. It was all about pretty special debug options that enable > a lot of very special code (KASAN and PAGE_OWNER - is there anything > else?). Some parts of DRM debugging and looks like also recently networking through ref_tracker, which also seems to be debugging. > Very clearly just debug builds. > > But this slab change means that now it's basically *always* enabled as > an option, and that means that now it had better do sane things > because it's enabled by default and not something that can easily be > ignored any more. > > The kernel config phase is something I'm very sensitive to, because > honestly, it's just about the worst part of building a kernel. > Everything else is pretty easy. The kernel config is painful. > > That means that we should not ask insane questions - and asking what > static size you want for a data structure that 99% of all people have > absolutely _zero_ idea about or interest in is wrong. Understood. > So the problem here is two-fold: > > (a) it introduces a new compile-time question that isn't sane to ask > a regular user, but is now exposed to regular users. > > (b) this by default uses 1MB of memory for a feature that didn't in > the past, so now if you have small machines you need to make sure you > make a special kernel config for them. > > And (a) happens unconditionally, while (b) is conditional. And it's > now clear exactly what all triggers the actual allocation in (b). > > I _hope_ it's never triggered unless you actively enable slub debug, > but at least from a quick grep it wasn't obvious. > > For example, if you happen to have rcutorture enabled, do you get the > allocation then just because rcutorture uses > > kcp = kmem_cache_create("rcuscale", 136, 8, SLAB_STORE_USER, NULL); > > even if you have nothing else that would enable slaub debugging? It > *looked* that way to me from a quick grep, but I could easily have > missed something. Yes, running rcutorture will trigger that stackdepot allocation, but as that's in RCU debugging part of config, I considered it in the same category as enabling slub debugging. But yeah I realize it might become a problem if someone wants to run rcutorture on m68k :/ > Linus