mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ian Kent <raven@themaw.net>
To: NeilBrown <neil@brown.name>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	 Christian Brauner	 <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
	Amir Goldstein <amir73il@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jake Edge <jake@lwn.net>
Subject: Re: [PATCH v4 0/5] Fix easy bits of the negative dentry problem
Date: Mon, 19 Oct 2026 09:59:01 +0800	[thread overview]
Message-ID: <f1c42d0bd125c6b1c39f1ebaee41340b5f6f03f6.camel@themaw.net> (raw)
In-Reply-To: <20261019000810.1837917-1-neilb@ownmail.net>

On Mon, 2026-10-19 at 11:00 +1100, NeilBrown wrote:
> For this v4 I decided to focus on just fsnotify, as that is where
> I've
> received the most useful review, and that is where problem reports
> seem
> to focus.
> 
> Other places that walk the ->d_children list (and don't already use
> cond_resched()) are specific to just one file-system-type.  fsnotify
> can
> affect (almost) any file-system.  So it is reasonable that it gets
> priority.
> 
> So here we just fix the refcount overflow, and the ->d_children walk
> for
> fsnotify.
> 
> If/when this lands, I can suggest patches to various file-system
> maintainers.
> 
> Thanks,
> NeilBrown
> 
> 
> Original intro - revised:
> 
>  I was reading about the negative dentry problem in
>  https://lwn.net/Articles/1079407/ and thought I would have a go at
> the
>  easy bits.  Given how involved some of that was I'm glad I didn't
> try
>  the tricky bits!
> 
>  So I didn't try to reduce the number of negative dentries or handle
>  them differently to positive dentries.  I just tried to address
>  specific symptoms.
> 
>  This series addresses two reported symptoms.
>   1/ refcounts on parents can potentially overflow if there are
> billions
>      of (negative) children.  This was the easiest easy bit.  The
> first
>      patch is all that is needed.
> 
>   2/ Walking the ->d_children list can take arbitrarily long and can
>      trigger soft lockups.  I haven't addresses the "arbitrarily
> long"
>      part, but the "soft lockups" is relatively easy.
>      With this in place I would feel more confident addressing
>      the "arbitrarily long" part if that seemed worth while.
> 
>  The core idea is to use a common helper for all walking of
>  ->d_children, and teach it to drop the lock and schedule when
> needed,
>  inserting a cursor to keep its place.  This simple idea requires
> that
>  nothing should be holding any other lock while walking ->d_children

As is so often the case you've come up with an interesting and useful
proposal, ;)

Nothing stood to me out as problematic given the scope of the series.

> 
> 
>  [PATCH v4 1/5] VFS: don't count references through ->d_parent
>  [PATCH v4 2/5] fsnotify: update children flags only when adding mask
>  [PATCH v4 3/5] fsnotify: don't hold i_lock while walking d_children
>  [PATCH v4 4/5] Add d_for_each_positive_child family of iterators
>  [PATCH v4 5/5] Use d_for_each_positive_child() in fsnotify.

Did you have any thoughts on how to contain the number of negative
dentries, (perhaps) including directory entry counts, in an intelligent
way (meaning "as you go" rather than "brute force" when needed)?

A significant problem, particularly on systems that count their memory
in TBs rather than GBs.

Ian

  parent reply	other threads:[~2026-10-19  1:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19  0:00 NeilBrown
2026-10-19  0:00 ` [PATCH v4 1/5] VFS: don't count references through ->d_parent NeilBrown
2026-10-19  0:00 ` [PATCH v4 2/5] fsnotify: update children flags only when adding mask bits NeilBrown
2026-10-19  0:00 ` [PATCH v4 3/5] fsnotify: don't hold i_lock while walking d_children in fsnotify_set_children_dentry_flags() NeilBrown
2026-10-19  0:00 ` [PATCH v4 4/5] Add d_for_each_positive_child family of iterators NeilBrown
2026-10-19  0:00 ` [PATCH v4 5/5] Use d_for_each_positive_child() in fsnotify NeilBrown
2026-10-19  1:59 ` Ian Kent [this message]
2026-10-19  2:29   ` [PATCH v4 0/5] Fix easy bits of the negative dentry problem NeilBrown
2026-10-20  1:29     ` Ian Kent

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f1c42d0bd125c6b1c39f1ebaee41340b5f6f03f6.camel@themaw.net \
    --to=raven@themaw.net \
    --cc=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=jake@lwn.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®