linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Mel Gorman <mgorman@techsingularity.net>
Cc: Jan Kara <jack@suse.cz>, Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] fs: Do not check if there is a fsnotify watcher on pseudo inodes
Date: Mon, 15 Jun 2020 21:32:16 +0300	[thread overview]
Message-ID: <CAOQ4uxikAD0FFZdnkd_aHfst0G3j0Gt1_oGDb75z8gHpaE3ERg@mail.gmail.com> (raw)
In-Reply-To: <20200615172545.GG3183@techsingularity.net>

On Mon, Jun 15, 2020 at 8:25 PM Mel Gorman <mgorman@techsingularity.net> wrote:
>
> On Mon, Jun 15, 2020 at 07:26:38PM +0300, Amir Goldstein wrote:
> > On Mon, Jun 15, 2020 at 3:14 PM Mel Gorman <mgorman@techsingularity.net> wrote:
> > >
> > > Changelog since v1
> > > o Updated changelog
> >
> > Slipped to commit message
> >
>
> It's habit, it's the layout I generally use for mm even though others
> prefer having it below ---. I wasn't sure of fsnotify's preferred format
> for tracking major differences between versions.
>
> > >
> > > The kernel uses internal mounts created by kern_mount() and populated
> > > with files with no lookup path by alloc_file_pseudo for a variety of
> > > reasons. An example of such a mount is for anonymous pipes. For pipes,
> > > every vfs_write regardless of filesystem, fsnotify_modify() is called to
> > > notify of any changes which incurs a small amount of overhead in fsnotify
> > > even when there are no watchers. It can also trigger for reads and readv
> > > and writev, it was simply vfs_write() that was noticed first.
> > >
> > > A patch is pending that reduces, but does not eliminte, the overhead of
> >
> > typo: eliminte
> >
>
> Yes.
>
> > > fsnotify but for files that cannot be looked up via a path, even that
> > > small overhead is unnecessary. The user API for fanotify is based on
> > > the pathname and a dirfd and proc entries appear to be the only visible
> > > representation of the files. Proc does not have the same pathname as the
> > > internal entry and the proc inode is not the same as the internal inode
> > > so even if fanotify is used on a file under /proc/XX/fd, no useful events
> > > are notified.
> > >
> >
> > Note that fanotify is not the only uapi to add marks, but this is fine by me
> > I suppose if Jan wants to he can make small corrections on commit.
> >
>
> True but I didn't think inotify was materially different as it also takes
> a path. Is that wrong or are there others that matter and can attach to
> a file that cannot be looked up via a path?

There are kernel/audit* and nfsd/filecache.c users, but as far as I could
tell, there is no danger from there. I was just pointing out that the fanotify
uapi argument alone is not a full proof.

Thanks,
Amir.

  reply	other threads:[~2020-06-15 18:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15 12:13 [PATCH v2] fs: Do not check if there is a fsnotify watcher on pseudo inodes Mel Gorman
2020-06-15 16:26 ` Amir Goldstein
2020-06-15 17:25   ` Mel Gorman
2020-06-15 18:32     ` Amir Goldstein [this message]
2020-06-16  7:47   ` Jan Kara
2020-06-29 15:17     ` Eric Dumazet
2020-06-29 15:29       ` Mel Gorman
2020-06-29 18:48       ` Jan Kara

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=CAOQ4uxikAD0FFZdnkd_aHfst0G3j0Gt1_oGDb75z8gHpaE3ERg@mail.gmail.com \
    --to=amir73il@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@techsingularity.net \
    --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;
as well as URLs for NNTP newsgroup(s).