Re: [PATCH v2 3/4] fsnotify: count all objects with attached connectors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 11, 2021 at 2:37 PM Jan Kara <jack@xxxxxxx> wrote:
>
> On Tue 10-08-21 18:12:19, Amir Goldstein wrote:
> > Rename s_fsnotify_inode_refs to s_fsnotify_connectors and count all
> > objects with attached connectors, not only inodes with attached
> > connectors.
> >
> > This will be used to optimize fsnotify() calls on sb without any
> > type of marks.
> >
> > Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx>
>
> ... just a minor nit below ...
>
> > diff --git a/include/linux/fs.h b/include/linux/fs.h
> > index 640574294216..d48d2018dfa4 100644
> > --- a/include/linux/fs.h
> > +++ b/include/linux/fs.h
> > @@ -1507,8 +1507,8 @@ struct super_block {
> >       /* Number of inodes with nlink == 0 but still referenced */
> >       atomic_long_t s_remove_count;
> >
> > -     /* Pending fsnotify inode refs */
> > -     atomic_long_t s_fsnotify_inode_refs;
> > +     /* Number of inode/mount/sb objects that are being watched */
> > +     atomic_long_t s_fsnotify_connectors;
>
> I've realized inode watches will be double-accounted because we increment
> s_fsnotify_connectors both when attaching a connector and when grabbing
> inode reference. It doesn't really matter and avoiding this would require
> special treatment of inode connectors (we need to decrement
> s_fsnotify_connectors only after dropping inode reference). So I'll just
> reflect this in the comment here so that we don't forget.

Great!
I actually have a patch to make the inode reference optional
per backend/mark [1], so keeping double account makes things
a lot easier for that code as well.

Thanks,
Amir.

[1] https://github.com/amir73il/linux/commits/fsnotify-volatile



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux