linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Jan Kara <jack@suse.cz>
Cc: Eric Paris <eparis@redhat.com>,
	Marko Rauhamaa <marko.rauhamaa@f-secure.com>,
	linux-fsdevel@vger.kernel.org
Subject: [RFC][PATCH 0/6] fanotify: super block root watch
Date: Mon, 13 Mar 2017 15:20:17 +0200	[thread overview]
Message-ID: <1489411223-12081-1-git-send-email-amir73il@gmail.com> (raw)

This is the 4th and last part of fanotify super block watch work.

I am posting this last part in preparation to the fsnotify discussion
on LSF/MM.

The issue, which this work sets to solve, is the poor scalability of
recursive inotify watches.

Other operating systems have a scalable way of watching changes on
a large file system. Windows has USN Journal, macOS has FSEvents
and BSD has kevents.

Currently, the only way in Linux to monitor file system 'filename events'
(e.g. create/delete/move) is the recursive inotify watch way and
this method scales very poorly for large enough directory trees.
Beyond the exploding probability of a need for full scan, pinning
all directory inodes wastes a lot of memory.

The efforts to merge fanotify took several steps in the direction
of solving the scalability issue, but they did not go all the way
to provide the functionality required to replace inotify.

=== For Reviewers ===

I split the work to 4 parts, which are denoted by 4 branch heads,
for convenience of reviewers:

1. A cleanup series with no functional nor performance impact [1][5].

2. Adds the super block root watch functionality to fsnotify infrastructure,
   without adding user API and without adding support in any backend [2][6].

3. Adds the user API and functionality of reporting 'filename events'
   (e.g. create/delete/rename) to the fanotify backend [3][7].

4. [This posting] Adds the user API and functionality for reporting all events
   on a super block via the fanotify backend [4].

The fanotify super block watch feature is currently being tested
by my employer and by other interested parties as well.

Adding more tests and possibly writing a dedicated testsuite has
been on my TODO list for a while. I have experimented with some
options, but not much to show for yet.
In the mean while, I started an fsnotify-TODO wiki [8] and listed
some test requirements based on some earlier discussions with Jan.

Comments and thoughts are most welcome.

Thanks!
Amir.

[1] https://github.com/amir73il/linux/commits/fsnotify_dentry
[2] https://github.com/amir73il/linux/commits/fsnotify_sb
[3] https://github.com/amir73il/linux/commits/fanotify_dentry
[4] https://github.com/amir73il/linux/commits/fanotify_sb
[5] http://marc.info/?l=linux-fsdevel&m=148198446127338&w=2
[6] http://marc.info/?l=linux-fsdevel&m=148224725519139&w=2
[7] http://marc.info/?l=linux-fsdevel&m=147612772031987&w=2
[8] https://github.com/amir73il/fsnotify-utils/wiki/fsnotify-TODO

Amir Goldstein (6):
  fanotify: add a super block root watch
  fanotify: report events to sb root with fanotify_file_event_info
  fanotify: pass file handle on sb root watcher events
  fanotify: report file name to root inode watch with FS_EVENT_ON_CHILD
  fanotify: export FAN_ONDIR to user
  fanotify: filter events by root mark mount point

 fs/notify/fanotify/fanotify.c      |  83 ++++++++++++++++++++++++------
 fs/notify/fanotify/fanotify.h      |  40 +++++++++++++--
 fs/notify/fanotify/fanotify_user.c | 102 ++++++++++++++++++++++++++-----------
 fs/notify/fsnotify.c               |  13 +++--
 include/linux/fsnotify_backend.h   |  13 +++++
 include/uapi/linux/fanotify.h      |   7 ++-
 6 files changed, 205 insertions(+), 53 deletions(-)

-- 
2.7.4

             reply	other threads:[~2017-03-13 13:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-13 13:20 Amir Goldstein [this message]
2017-03-13 13:20 ` [RFC][PATCH 1/6] fanotify: add a super block root watch Amir Goldstein
2017-03-13 13:20 ` [RFC][PATCH 2/6] fanotify: report events to sb root with fanotify_file_event_info Amir Goldstein
2017-03-13 13:20 ` [RFC][PATCH 3/6] fanotify: pass file handle on sb root watcher events Amir Goldstein
2017-03-13 13:20 ` [RFC][PATCH 4/6] fanotify: report file name to root inode watch with FS_EVENT_ON_CHILD Amir Goldstein
2017-03-13 13:20 ` [RFC][PATCH 5/6] fanotify: export FAN_ONDIR to user Amir Goldstein
2017-03-13 13:20 ` [RFC][PATCH 6/6] fanotify: filter events by root mark mount point Amir Goldstein

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=1489411223-12081-1-git-send-email-amir73il@gmail.com \
    --to=amir73il@gmail.com \
    --cc=eparis@redhat.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=marko.rauhamaa@f-secure.com \
    /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).