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: Linus Torvalds <torvalds@linux-foundation.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [GIT PULL] Fsnotify cleanups
Date: Mon, 11 Jun 2018 19:31:28 +0300	[thread overview]
Message-ID: <CAOQ4uxjTeR3X=cd83sc=BWLr0t-+PzhhKbDHA2CLpssOReH+MQ@mail.gmail.com> (raw)
In-Reply-To: <20180611161249.d3g64fcfuwezlxeq@quack2.suse.cz>

On Mon, Jun 11, 2018 at 7:12 PM, Jan Kara <jack@suse.cz> wrote:
> On Sat 09-06-18 11:00:17, Amir Goldstein wrote:
>> On Sat, Jun 9, 2018 at 9:57 AM, Amir Goldstein <amir73il@gmail.com> wrote:
>> > The only code that needs to test the shadow mask before following into
>> > connector is the optimization code in start of fsnotify() which was not
>> > generalized anyway and where the mask optimization is more important
>> > for mount watches.
>> >
>>
>> No. That's not true, there is also fsnotify_inode_watches_children() and
>> __fsnotify_parent(). But I think the only bits in the mask that really matter
>> for optimizing inode watches are FS_ACCESS and FS_EVENT_ON_CHILD
>> and those could be encoded in lower bits of connector pointer.
>
> Actually for children events, we have a dentry flag
> DCACHE_FSNOTIFY_PARENT_WATCHED and that should catch 99% of situation.
> FS_EVENT_ON_CHILD is used only to verify event really should be delivered
> since the DCACHE_FSNOTIFY_PARENT_WATCHED flag is cleared lazily. Or where
> do you think the performance of FS_EVENT_ON_CHILD checking matters?
>

I thought that dereferencing the connector from
fsnotify_inode_watches_children()
is not a good idea, so we can set that bit  in connector pointer during
fsnotify_recalc_mask().

> Also I'm not 100% sure just having FS_ACCESS checked quickly is going to
> buy us that much. We have quite a few event types and if someone is
> watching for a different event type than the current event (just not
> FS_ACCESS), we'll just have to pay the cost of srcu_read_lock and
> indirection. So it just depends whether we consider such loads worthwhile
> or not...

I just though user could generate FS_ACCESS callbacks on an inode
at higher rate than any other event types, so for other event types
optimization is going to be less noticeable. Not sure that is true.

Thanks,
Amir.

  reply	other threads:[~2018-06-11 16:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-07 15:02 [GIT PULL] Fsnotify cleanups Jan Kara
2018-06-07 16:34 ` Linus Torvalds
2018-06-08 13:27   ` Jan Kara
2018-06-08 20:34     ` Linus Torvalds
2018-06-09  6:57       ` Amir Goldstein
2018-06-09  8:00         ` Amir Goldstein
2018-06-11 16:12           ` Jan Kara
2018-06-11 16:31             ` Amir Goldstein [this message]
2018-06-09 17:30         ` Linus Torvalds
2018-06-09 18:46           ` Amir Goldstein
2018-06-10 17:49             ` Amir Goldstein
2018-06-11 13:36               ` Jan Kara
2018-06-11 13:58                 ` Amir Goldstein
2018-06-11 16:03                   ` Jan Kara
2018-06-11 16:38                     ` Amir Goldstein
2018-06-11 19:51                       ` Amir Goldstein
2018-06-13 13:21                         ` Jan Kara
2018-06-13 13:56                           ` Amir Goldstein
2018-06-13 22:17                             ` Amir Goldstein
2018-06-22 16:44                               ` Jan Kara
2018-06-23  7:42                                 ` Amir Goldstein
2018-06-11 11:08       ` 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='CAOQ4uxjTeR3X=cd83sc=BWLr0t-+PzhhKbDHA2CLpssOReH+MQ@mail.gmail.com' \
    --to=amir73il@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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).