On Sat, May 11, 2024 at 11:26:26AM -0700, Linus Torvalds wrote: > Yafang Shao reports that he has seen loads that generate billions of > negative dentries in a directory, which then when the directory is > removed causes excessive latencies for other users because the dentry > shrinking is done under the directory inode lock. > > There seems to be no actual reason for holding the inode lock any more > by the time we get rid of the now uninteresting negative dentries, and > it's an effect of just code layout (the shared error path). > > Reorganize the code trivially to just have a separate success path, > which simplifies the code (since 'd_delete_notify()' is only called in > the success path anyway) and makes it trivial to just move the dentry > shrinking outside the inode lock. Wait, I thought he had confirmed that in the setup in question directories were *not* removed, hadn't he? I've no objections against that patch, but if the above is accurate it's not going to help...