On Mon, May 13, 2024 at 08:58:33AM -0700, Linus Torvalds wrote: > We *could* strive for a hybrid approach, where we handle the common > case ("not a ton of child dentries") differently, and just get rid of > them synchronously, and handle the "millions of children" case by > unhashing the directory and dealing with shrinking the children async. try_to_shrink_children()? Doable, and not even that hard to do, but as for shrinking async... We can easily move it out of inode_lock on parent, but doing that really async would either need to be tied into e.g. remount r/o logics or we'd get userland regressions. I mean, "I have an opened unlinked file, can't remount r/o" is one thing, but "I've done rm -rf ~luser, can't remount r/o for a while" when all luser's processes had been killed and nothing is holding any of that opened... ouch.