On Thu, Sep 2, 2021 at 4:15 PM Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote: > > .... > > + if (lock) > > + local_irq_save(flags); > > with actively misleading names ("lock"? WTF? There's no lock there!) > and just disgusting semantics with conditionals etc. .. and I see that "mm, slub: convert kmem_cpu_slab protection to local_lock" makes that local_irq_save() make it use a local_lock, which may have been the cause of the naming. But that doesn't make my other objections about this go away. Instead of having it lock/unlock halfway through the function (and have magic "Oh, the caller already holds the lock, so don't lock" semantics except with misleading names) I really think that function should just have been split in two, and then the locked region can be minimized in the caller only taking it for the first part. Linus