Re: [External] : Re: [PATCH 0/1] fsnotify: Check parent watches without child dentry flags
From: Jan Kara
Date: Mon Nov 16 2026 - 14:29:59 EST
On Mon 16-11-26 18:16:41, Jan Kara wrote:
> On Fri 06-11-26 12:10:50, Partha Satapathy wrote:
> > On 22-10-2026 13:17, Partha Satapathy wrote:
> > > On 13-10-2026 12:08, Partha Satapathy wrote:
> > >> Please compile : fsnotify_parent_ref_bench.c -o
> > >> fsnotify_parent_ref_bench. After that
> > >> run the script ./run_parent_ref_scale.sh
> > >>
> > >> Thanks
> > >> Partha
> > >
> > > Hi Honza,
> > >
> > > A gentle ping on the benchmark program, Have you had a chance to try it
> > > on your setup? Please let me know if any further tests or information
> > > would be helpful.
> > >
> > > Thanks,
> > > Partha
> >
> >
> >
> > Hi Honza,
> >
> > Have you had a chance to try the benchmark on your setup? Please let me
> > know if you need any further tests from my side to move this patch forward.
>
> I'm sorry for the delay. I didn't get to this yet because with the firehose
> of LLM generated reports & fixes things get postponed. But I'm looking into
> this now.
So I did the benchmarking with your benchmark (thank you for that!). I was
running it like:
./fsnotify_benchmark /dev/shm/benchmark/ 64 1000000 none
and what I'm seeing (avg of 10 runs) is:
writes per second
vanilla 7.4-rc2: 79.75m
7.4-rc2 + your patch: 5.47m
and perf for the kernel with the patch applied clearly shows vast majority
of time spent in lockref manipulations as I expected. The reason why you
didn't see a difference is likely that fsnotify_parent() has this guard:
if (!fsnotify_sb_has_watchers(inode->i_sb))
return 0;
which avoids even looking at the parent if nobody watches anything in the
filesystem. So to really benchmark changed fsnotify code I had to do:
tail -f /dev/shm/watchfile
before running the benchmark to neutralize this shortcut. I guess now you
see why PARENT_WATCHED flag is really essential in keeping decent
performance when inotify is *not* used for some directory in a filesystem.
Honza
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR