All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Jan Kara <jack@suse.cz>,
	Matthew Bobrowski <mbobrowski@mbobrowski.org>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v2 3/4] fsnotify: count all objects with attached connectors
Date: Wed, 11 Aug 2021 13:37:41 +0200	[thread overview]
Message-ID: <20210811113741.GD14725@quack2.suse.cz> (raw)
In-Reply-To: <20210810151220.285179-4-amir73il@gmail.com>

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@gmail.com>

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

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  parent reply	other threads:[~2021-08-11 11:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10 15:12 [PATCH v2 0/4] Performance optimization for no fsnotify marks Amir Goldstein
2021-08-10 15:12 ` [PATCH v2 1/4] fsnotify: replace igrab() with ihold() on attach connector Amir Goldstein
2021-08-10 15:12 ` [PATCH v2 2/4] fsnotify: count s_fsnotify_inode_refs for attached connectors Amir Goldstein
2021-08-10 15:12 ` [PATCH v2 3/4] fsnotify: count all objects with " Amir Goldstein
2021-08-10 21:49   ` Matthew Bobrowski
2021-08-11 11:37   ` Jan Kara [this message]
2021-08-11 13:59     ` Amir Goldstein
2021-08-10 15:12 ` [PATCH v2 4/4] fsnotify: optimize the case of no marks of any type Amir Goldstein
2021-08-11 12:02 ` [PATCH v2 0/4] Performance optimization for no fsnotify marks 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=20210811113741.GD14725@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=amir73il@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mbobrowski@mbobrowski.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.