linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: Jim Harris <jiharris@nvidia.com>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	 "virtualization@lists.linux.dev"
	<virtualization@lists.linux.dev>,
	 "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"stefanha@redhat.com" <stefanha@redhat.com>,
	 Max Gurtovoy <mgurtovoy@nvidia.com>,
	Idan Zach <izach@nvidia.com>,
	 Roman Spiegelman <rspiegelman@nvidia.com>,
	Ben Walker <benwalker@nvidia.com>,  Oren Duer <oren@nvidia.com>
Subject: Re: Questions about FUSE_NOTIFY_INVAL_ENTRY
Date: Wed, 20 Aug 2025 10:55:12 +0200	[thread overview]
Message-ID: <CAJfpegvmhpyab2-kaud3VG47Tbjh0qG_o7G-3o6pV78M8O++tQ@mail.gmail.com> (raw)
In-Reply-To: <D5420EF2-6BA6-4789-A06A-D1105A3C33D4@nvidia.com>

On Wed, 20 Aug 2025 at 01:35, Jim Harris <jiharris@nvidia.com> wrote:

> Can we safely depend on the FUSE_NOTIFY_INVAL_ENTRY notifications to trigger FORGET commands for the associated inodes? If not, can we consider adding a new FUSE_NOTIFY_DROP_ENTRY notification that would ask the kernel to release the inode and send a FORGET command when memory pressure or clean-up is needed by the device?

As far as I understand what you want is drop the entry from the cache
*if it is unused*.  Plain FUSE_NOTIFY_INVAL_ENTRY will unhash the
dentry regardless of its refcount, of course FORGET will be sent only
after the reference is released.

FUSE_NOTIFY_INVAL_ENTRY with FUSE_EXPIRE_ONLY will do something like
your desired FUSE_NOTIFY_DROP_ENTRY operation, at least on virtiofs
(fc->delete_stale is on).  I notice there's a fuse_dir_changed() call
regardless of FUSE_EXPIRE_ONLY, which is not appropriate for the drop
case, this can probably be moved inside the !FUSE_EXPIRE_ONLY branch.

The other question is whether something more efficient should be
added. E.g. FUSE_NOTIFY_SHRINK_LOOKUP_CACHE with a num_drop argument
that tells fuse to try to drop this many unused entries?

Thanks,
Miklos

  reply	other threads:[~2025-08-20  8:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-19 23:34 Questions about FUSE_NOTIFY_INVAL_ENTRY Jim Harris
2025-08-20  8:55 ` Miklos Szeredi [this message]
2025-08-20 20:42   ` Jim Harris
2025-08-27 13:05     ` Miklos Szeredi
2025-08-27 17:45       ` Jim Harris

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=CAJfpegvmhpyab2-kaud3VG47Tbjh0qG_o7G-3o6pV78M8O++tQ@mail.gmail.com \
    --to=miklos@szeredi.hu \
    --cc=benwalker@nvidia.com \
    --cc=izach@nvidia.com \
    --cc=jiharris@nvidia.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mgurtovoy@nvidia.com \
    --cc=oren@nvidia.com \
    --cc=rspiegelman@nvidia.com \
    --cc=stefanha@redhat.com \
    --cc=virtualization@lists.linux.dev \
    /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).