linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Ian Kent <raven@themaw.net>
Cc: Miklos Szeredi <mszeredi@redhat.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-api@vger.kernel.org, linux-man@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	Karel Zak <kzak@redhat.com>, David Howells <dhowells@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner <christian@brauner.io>
Subject: Re: [RFC PATCH 0/3] quering mount attributes
Date: Fri, 15 Sep 2023 06:06:31 +0300	[thread overview]
Message-ID: <CAOQ4uxgHxVqtvb51Z27Sgft-U=oYtXeiv+3HJbara4zdRC-FZg@mail.gmail.com> (raw)
In-Reply-To: <904a8d17-b6df-e294-fcf6-6f95459e1ffa@themaw.net>

On Fri, Sep 15, 2023 at 4:20 AM Ian Kent <raven@themaw.net> wrote:
>
> On 14/9/23 14:47, Amir Goldstein wrote:
> > On Wed, Sep 13, 2023 at 6:22 PM Miklos Szeredi <mszeredi@redhat.com> wrote:
> >> Implement the mount querying syscalls agreed on at LSF/MM 2023.  This is an
> >> RFC with just x86_64 syscalls.
> >>
> >> Excepting notification this should allow full replacement for
> >> parsing /proc/self/mountinfo.
> > Since you mentioned notifications, I will add that the plan discussed
> > in LFSMM was, once we have an API to query mount stats and children,
> > implement fanotify events for:
> > mount [mntuid] was un/mounted at [parent mntuid],[dirfid+name]
> >
> > As with other fanotify events, the self mntuid and dirfid+name
> > information can be omitted and without it, multiple un/mount events
> > from the same parent mntuid will be merged, allowing userspace
> > to listmnt() periodically only mntuid whose child mounts have changed,
> > with little risk of event queue overflow.
> >
> > The possible monitoring scopes would be the entire mount namespace
> > of the monitoring program or watching a single mount for change in
> > its children mounts. The latter is similar to inotify directory children watch,
> > where the watches needs to be set recursively, with all the weight on
> > userspace to avoid races.
>
> It's been my belief that the existing notification mechanisms don't
> quite fully satisfy the needs of users of these calls (aka. the need
> I found when implementing David's original calls into systemd).
>
> Specifically the ability to process a batch of notifications at once.
>
> Admittedly the notifications mechanism that David originally implemented
> didn't fully implement what I found I needed but it did provide for a
> settable queue length and getting a batch of notifications at a time.
>
> Am I mistaken in my belief?
>

I am not sure I understand the question.

fanotify has an event queue (16K events by default), but it can
also use unlimited size.
With a limited size queue, event queue overflow generates an
overflow event.

event listeners can read a batch of events, depending on
the size of the buffer that they provide.

when multiple events with same information are queued,
for example "something was un/mounted over parent mntuid 100"
fanotify will merged those all those events in the queue and the
event listeners will get only one such event in the batch.

> Don't misunderstand me, it would be great for the existing notification
> mechanisms to support these system calls, I just have a specific use case
> in mind that I think is important, at least to me.
>

Please explain the use case and your belief about existing fanotify
limitations. I did not understand it.

Thanks,
Amir.

  reply	other threads:[~2023-09-15  3:06 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-13 15:22 [RFC PATCH 0/3] quering mount attributes Miklos Szeredi
2023-09-13 15:22 ` [RFC PATCH 1/3] add unique mount ID Miklos Szeredi
2023-09-14  9:03   ` Christian Brauner
2023-09-14  9:30     ` Miklos Szeredi
2023-09-14  9:36       ` Christian Brauner
2023-09-14  9:43         ` Miklos Szeredi
2023-09-14 10:06           ` Christian Brauner
2023-09-15  1:31           ` Ian Kent
2023-09-13 15:22 ` [RFC PATCH 2/3] add statmnt(2) syscall Miklos Szeredi
2023-09-14  6:11   ` Amir Goldstein
2023-09-15  1:05     ` Ian Kent
2023-09-14  9:27   ` Christian Brauner
2023-09-14 10:13     ` Miklos Szeredi
2023-09-14 15:26       ` Christian Brauner
2023-09-15  8:56         ` Miklos Szeredi
2023-09-18 13:51           ` Christian Brauner
2023-09-18 14:14             ` Miklos Szeredi
2023-09-18 14:24               ` Christian Brauner
2023-09-18 14:32                 ` Miklos Szeredi
2023-09-18 14:40                   ` Christian Brauner
2023-09-18 14:51                     ` Miklos Szeredi
2023-09-18 15:22                       ` Christian Brauner
2023-09-18 15:39                         ` Miklos Szeredi
2023-09-19  0:37                           ` Matthew House
2023-09-19  8:02                             ` Miklos Szeredi
2023-09-19  9:07                               ` Christian Brauner
2023-09-19 10:51                                 ` Miklos Szeredi
2023-09-19 12:41                                   ` Christian Brauner
2023-09-19 12:59                                     ` Miklos Szeredi
2023-09-19 13:18                                       ` Christian Brauner
2023-09-19 21:28                               ` Matthew House
2023-09-20  9:42                                 ` Miklos Szeredi
2023-09-20 13:26                                   ` Matthew House
2023-09-21  7:34                                     ` Miklos Szeredi
2023-09-26 13:48               ` Florian Weimer
2023-09-26 14:06                 ` Miklos Szeredi
2023-09-26 14:19                   ` Florian Weimer
2023-09-26 14:33                     ` Miklos Szeredi
2023-09-26 14:39                       ` Florian Weimer
2023-09-26 14:36                     ` Christian Brauner
2023-09-26 14:13                 ` Christian Brauner
2023-09-18 20:58             ` Andreas Dilger
2023-09-19 12:50               ` Christian Brauner
2023-09-20  0:33                 ` Dave Chinner
2023-09-18 14:29         ` Jeff Layton
2023-09-18 14:35           ` Christian Brauner
2023-09-20  9:43           ` David Laight
2023-09-14 20:39   ` Paul Moore
2023-09-15  9:10     ` Miklos Szeredi
2023-09-17 18:18   ` Sargun Dhillon
2023-09-17 23:36     ` Ian Kent
2023-09-18 13:05       ` Christian Brauner
2023-09-25 12:57   ` Arnd Bergmann
2023-09-25 13:04     ` Christian Brauner
2023-09-25 13:13       ` Miklos Szeredi
2023-09-25 13:19         ` Christian Brauner
2023-09-25 13:20           ` Miklos Szeredi
2023-09-25 15:46             ` Arnd Bergmann
2023-09-26 10:05               ` Christian Brauner
2023-09-27  8:46             ` Miklos Szeredi
2023-09-13 15:22 ` [RFC PATCH 3/3] add listmnt(2) syscall Miklos Szeredi
2023-09-14  6:00   ` Amir Goldstein
2023-09-14  8:50     ` Miklos Szeredi
2023-09-14 10:01       ` Christian Brauner
2023-09-15  1:00     ` Ian Kent
2023-09-17  0:54   ` Matthew House
2023-09-17 14:32     ` Miklos Szeredi
2023-09-18 13:15       ` Christian Brauner
2023-09-19 16:47         ` Paul Moore
2023-09-28 10:07           ` Miklos Szeredi
2023-10-04 19:22             ` Paul Moore
2023-09-14  6:47 ` [RFC PATCH 0/3] quering mount attributes Amir Goldstein
2023-09-15  1:20   ` Ian Kent
2023-09-15  3:06     ` Amir Goldstein [this message]
2023-09-16  2:04       ` Ian Kent
2023-09-16  2:19       ` 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='CAOQ4uxgHxVqtvb51Z27Sgft-U=oYtXeiv+3HJbara4zdRC-FZg@mail.gmail.com' \
    --to=amir73il@gmail.com \
    --cc=christian@brauner.io \
    --cc=dhowells@redhat.com \
    --cc=kzak@redhat.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mszeredi@redhat.com \
    --cc=raven@themaw.net \
    --cc=torvalds@linux-foundation.org \
    --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).