On Tue, Oct 31, 2023 at 06:12:26AM +0000, Al Viro wrote: > On Tue, Oct 31, 2023 at 01:53:51AM +0000, Al Viro wrote: > > > Carving that series up will be interesting, though... > > I think I have a sane carve-up; will post if it survives testing. OK, current variant survives local testing. Lives in git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git #work.dcache Shortlog: fast_dput(): having ->d_delete() is not reason to delay refcount decrement fast_dput(): handle underflows gracefully fast_dput(): new rules for refcount __dput_to_list(): do decrement of refcount in the caller retain_dentry(): lift decrement of ->d_count into callers __dentry_kill(): get consistent rules for ->d_count dentry_kill(): don't bother with retain_dentry() on slow path Call retain_dentry() with refcount 0 fold the call of retain_dentry() into fast_dput() don't try to cut corners in shrink_lock_dentry() fold dentry_kill() into dput() get rid of __dget() shrink_dentry_list(): no need to check that dentry refcount is marked dead to_shrink_list(): call only if refcount is 0 switch select_collect{,2}() to use of to_shrink_list() Diffstat: fs/dcache.c | 268 ++++++++++++++++++++++-------------------------------------- 1 file changed, 96 insertions(+), 172 deletions(-) Individual patches in followups. Review and testing would be welcome, and it's obviously next cycle fodder. Massage of refcounting is in the first 11 commits, last 4 are followups.