From: Jens Axboe <axboe@kernel.dk>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Jan Kara <jack@suse.cz>, Christian Brauner <brauner@kernel.org>,
linux-fsdevel@vger.kernel.org
Subject: Re: [RFC][PATCH] fsnotify: optimize the case of no access event watchers
Date: Tue, 9 Jan 2024 13:24:28 -0700 [thread overview]
Message-ID: <2cf86f5f-58a1-4f5c-8016-b92cb24d88f1@kernel.dk> (raw)
In-Reply-To: <91797c50-d7fc-4f58-b52a-e95823b3df52@kernel.dk>
On 1/9/24 1:12 PM, Jens Axboe wrote:
> On 1/9/24 12:48 PM, Amir Goldstein wrote:
>> Commit e43de7f0862b ("fsnotify: optimize the case of no marks of any type")
>> optimized the case where there are no fsnotify watchers on any of the
>> filesystem's objects.
>>
>> It is quite common for a system to have a single local filesystem and
>> it is quite common for the system to have some inotify watches on some
>> config files or directories, so the optimization of no marks at all is
>> often not in effect.
>>
>> Access event watchers are far less common, so optimizing the case of
>> no marks with access events could improve performance for more systems,
>> especially for the performance sensitive hot io path.
>>
>> Maintain a per-sb counter of objects that have marks with access
>> events in their mask and use that counter to optimize out the call to
>> fsnotify() in fsnotify access hooks.
>>
>> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
>> ---
>>
>> Jens,
>>
>> You may want to try if this patch improves performance for your workload
>> with SECURITY=Y and FANOTIFY_ACCESS_PERMISSIONS=Y.
>
> Ran the usual test, and this effectively removes fsnotify from the
> profiles, which (as per other email) is between 5-6% of CPU time. So I'd
> say it looks mighty appealing!
Tried with an IRQ based workload as well, as those are always impacted
more by the fsnotify slowness. This patch removes ~8% of useless
overhead in that case, so even bigger win there.
--
Jens Axboe
next prev parent reply other threads:[~2024-01-09 20:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-09 19:48 [RFC][PATCH] fsnotify: optimize the case of no access event watchers Amir Goldstein
2024-01-09 20:12 ` Jens Axboe
2024-01-09 20:24 ` Jens Axboe [this message]
2024-01-10 9:08 ` Amir Goldstein
2024-01-10 12:46 ` Matthew Wilcox
2024-01-10 12:55 ` Amir Goldstein
2024-01-11 10:05 ` Christian Brauner
2024-01-11 10:33 ` Amir Goldstein
2024-01-10 13:56 ` Jan Kara
2024-01-10 14:41 ` Amir Goldstein
2024-01-10 16:58 ` Jan Kara
2024-01-11 6:27 ` 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=2cf86f5f-58a1-4f5c-8016-b92cb24d88f1@kernel.dk \
--to=axboe@kernel.dk \
--cc=amir73il@gmail.com \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.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).