linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Josef Bacik <josef@toxicpanda.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [LSF/MM/BPF TOPIC] Changing reference counting rules for inodes
Date: Tue, 4 Mar 2025 22:44:52 +0000	[thread overview]
Message-ID: <Z8eCZAbwPyBILnu3@casper.infradead.org> (raw)
In-Reply-To: <20250303170029.GA3964340@perftesting>

On Mon, Mar 03, 2025 at 12:00:29PM -0500, Josef Bacik wrote:
> I've recently gotten annoyed with the current reference counting rules that
> exist in the file system arena, specifically this pattern of having 0 referenced
> objects that indicate that they're ready to be reclaimed.
> 
> We do this everywhere, with inodes, dentries, and folios, but I specifically

Folios?  I don't think so.  The only exceptions I know to the rule of
"when a folio refcount reaches 0 it is reclaimed" are:

 - Frozen folios.  Filesystems should never see a frozen folio.
 - Devmem folios.  They were freed when their refcount reached 1.
   Alistair has that fixed in -next

If there's something you don't like about the folio refcount, please let
me know.  I have Some Thoughts:

 - It's silly that the pagecache takes 2^order references on the folio.
   It should be just 1
 - We play with the refcount in too many places.  In conjunction with
   the first point, what I'd like is if filemap_add_folio() consumed the
   refcount on the folio passed to it.  That is, today we allocate the
   folio (refcount 1), pass it to filemap_add_folio() which increments
   the refcount by 2^n and then put the refcount in readahead_folio().
   We should do noe of that; just have the pagecacahe assume the
   refcount that was passed in.  There are a few filesystems this would
   break today ... need to finish some more conversions.

Anyway, what's your problem with the folio refcount?  Filesystems
shouldn't need to care about folio refcounts (other than fuse which
decided to get all up in the mm's business).

  parent reply	other threads:[~2025-03-04 22:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-03 17:00 [LSF/MM/BPF TOPIC] Changing reference counting rules for inodes Josef Bacik
2025-03-04  8:04 ` Dave Chinner
2025-03-04 15:02   ` Josef Bacik
2025-03-04 22:23     ` Dave Chinner
2025-03-04 10:19 ` Christian Brauner
2025-03-04 14:56   ` Josef Bacik
2025-03-04 22:44 ` Matthew Wilcox [this message]
2025-03-04 23:34 ` Christoph Hellwig

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=Z8eCZAbwPyBILnu3@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).