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: linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH v3 8/8] fsnotify: optimize away srcu_read_lock() for events on directories
Date: Fri, 5 Oct 2018 01:05:57 +0300	[thread overview]
Message-ID: <CAOQ4uxhW+eLw0KQA32L8RFPTtsn+Z+E=CShNSdecfTdiCtE70A@mail.gmail.com> (raw)
In-Reply-To: <20181004112618.GB28384@quack2.suse.cz>

On Thu, Oct 4, 2018 at 2:26 PM Jan Kara <jack@suse.cz> wrote:
>
> On Thu 04-10-18 13:30:38, Amir Goldstein wrote:
> > On Thu, Oct 4, 2018 at 12:09 PM Jan Kara <jack@suse.cz> wrote:
> > >
> > > On Thu 04-10-18 00:25:39, Amir Goldstein wrote:
> > > > inotify and dnotify are always interested in events on directories.
> > > > fanotify is interested in events on directories only if user requested
> > > > them by flag FAN_ONDIR.
> > > >
> > > > For the fanotify supported events on directories (open/access/close),
> > > > if there is no inotify/dnotify associated marks and if none of the
> > > > associated fanotify marks have the FS_ISDIR flag, we can skip iterating
> > > > the marks and we avoid taking the srcu_read_lock() for all events on
> > > > directories.
> > > >
> > > > In order to enable this check in fsnotify() we set the FS_ISDIR flag
> > > > explicitly on all dnotify/inotify marks.
> > > >
> > > > Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> > > > ---
> > > >  fs/notify/dnotify/dnotify.c      | 5 +++--
> > > >  fs/notify/fsnotify.c             | 9 ++++++++-
> > > >  fs/notify/inotify/inotify_user.c | 4 ++--
> > > >  3 files changed, 13 insertions(+), 5 deletions(-)
> > >
> > > Looks good, except I think you forgot to convert kernel/audit_watch.c and
> > > kernel/audit_fsnotify.c which also need to set FS_ISDIR...
> > >
> >
> > Oops. Right.
> > So would you rather I come back with a fixed version after I ran
> > some performance tests?
> > Or will you fix and test it yourself?
>
> Let's postpone this patch for a bit later. I'll merge the remaining seven
> patches to my tree for this merge window.
>

For the records, On my small test system, I wasn't able to measure a
difference in performance of parallel opendir/readdir/closedir workload
(filebench listdirs) with and without a mount mark regardless of the
optimization patch.

Benchmark reports 40K~42K ops/sec for the compound op of "listdir".

Perhaps more complex workloads that actually have SRCU sleeps
would benefit from this optimization, but it doesn't look like avoiding
the memory barrier alone moves the niddle. Not very surprising
considering that readdir takes a shared lock anyway.

So dropping the patch until further notice.

Thanks,
Amir.

      reply	other threads:[~2018-10-05  5:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-03 21:25 [PATCH v3 0/8] New fanotify event info API Amir Goldstein
2018-10-03 21:25 ` [PATCH v3 1/8] fanotify: fix collision of internal and uapi mark flags Amir Goldstein
2018-10-03 21:25 ` [PATCH v3 2/8] fsnotify: generalize handling of extra event flags Amir Goldstein
2018-10-03 21:25 ` [PATCH v3 3/8] fanotify: simplify handling of FAN_ONDIR Amir Goldstein
2018-10-03 21:25 ` [PATCH v3 4/8] fanotify: deprecate uapi FAN_ALL_* constants Amir Goldstein
2018-10-03 21:25 ` [PATCH v3 5/8] fsnotify: convert runtime BUG_ON() to BUILD_BUG_ON() Amir Goldstein
2018-10-03 21:25 ` [PATCH v3 6/8] fanotify: add BUILD_BUG_ON() to count the bits of fanotify constants Amir Goldstein
2018-10-04  8:41   ` Jan Kara
2018-10-04 10:24     ` Amir Goldstein
2018-10-03 21:25 ` [PATCH v3 7/8] fanotify: support reporting thread id instead of process id Amir Goldstein
2018-10-04  8:46   ` Jan Kara
2018-10-04 10:27     ` Amir Goldstein
2018-10-11 10:16   ` Jan Kara
2018-10-12  2:43     ` Nixiaoming
2018-10-16 12:06       ` Jan Kara
2018-10-03 21:25 ` [PATCH v3 8/8] fsnotify: optimize away srcu_read_lock() for events on directories Amir Goldstein
2018-10-04  9:09   ` Jan Kara
2018-10-04 10:30     ` Amir Goldstein
2018-10-04 11:26       ` Jan Kara
2018-10-04 22:05         ` Amir Goldstein [this message]

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='CAOQ4uxhW+eLw0KQA32L8RFPTtsn+Z+E=CShNSdecfTdiCtE70A@mail.gmail.com' \
    --to=amir73il@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --subject='Re: [PATCH v3 8/8] fsnotify: optimize away srcu_read_lock() for events on directories' \
    /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

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).