On Mon, Jul 07, 2025 at 10:00:38PM +0200, Max Kellermann wrote: > Sorry Al, I don't get it. > I understand that objects that are still referenced must not be freed, > and of course a dentry that has started the process of dying by > __dentry_kill() needs to remain in the tree, and that its parent must > not be freed either. Of course! > > But none of this explains why you added this "d_lockref.count<0" > check, which I doubt is correct because it causes a busy loop, burning > CPU cycles without doing anything. Busy loop here means that everything in the tree is either busy or already in process of being torn down *by* *another* *thread*. And that's already in process - not just selected for it (see collect2 in the same loop). What *can* we do in that case? On the level of shrink_dcache_parent(), that is. Ignore that these suckers are there? Fine, but that means we are failing to evict the stuff that has no busy descendents. The interesting question is what the other thread is doing...