public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Kirill Tkhai <tkhai@ya.ru>
To: akpm@linux-foundation.org, tkhai@ya.ru, roman.gushchin@linux.dev,
	vbabka@suse.cz, viro@zeniv.linux.org.uk, brauner@kernel.org,
	djwong@kernel.org, hughd@google.com, paulmck@kernel.org,
	muchun.song@linux.dev, linux-mm@kvack.org,
	linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org,
	linux-kernel@vger.kernel.org, zhengqi.arch@bytedance.com,
	david@fromorbit.com
Subject: [PATCH v2 1/3] mm: vmscan: move shrinker_debugfs_remove() before synchronize_srcu()
Date: Mon,  5 Jun 2023 22:03:02 +0300	[thread overview]
Message-ID: <168599178203.70911.18350742045278218790.stgit@pro.pro> (raw)
In-Reply-To: <168599103578.70911.9402374667983518835.stgit@pro.pro>

From: Qi Zheng <zhengqi.arch@bytedance.com>

The debugfs_remove_recursive() will wait for debugfs_file_put()
to return, so there is no need to put it after synchronize_srcu()
to wait for the rcu read-side critical section to exit.

Just move it before synchronize_srcu(), which is also convenient
to put the heavy synchronize_srcu() in the delayed work later.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 mm/vmscan.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index eeca83e28c9b..a773e97e152e 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -818,11 +818,11 @@ void unregister_shrinker(struct shrinker *shrinker)
 	debugfs_entry = shrinker_debugfs_detach(shrinker, &debugfs_id);
 	mutex_unlock(&shrinker_mutex);
 
+	shrinker_debugfs_remove(debugfs_entry, debugfs_id);
+
 	atomic_inc(&shrinker_srcu_generation);
 	synchronize_srcu(&shrinker_srcu);
 
-	shrinker_debugfs_remove(debugfs_entry, debugfs_id);
-
 	kfree(shrinker->nr_deferred);
 	shrinker->nr_deferred = NULL;
 }


  reply	other threads:[~2023-06-05 19:10 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-05 19:02 [PATCH v2 0/3] mm: Make unregistration of super_block shrinker more faster Kirill Tkhai
2023-06-05 19:03 ` Kirill Tkhai [this message]
2023-06-06  0:31   ` [PATCH v2 1/3] mm: vmscan: move shrinker_debugfs_remove() before synchronize_srcu() Roman Gushchin
2023-06-05 19:03 ` [PATCH v2 2/3] mm: Split unregister_shrinker() in fast and slow part Kirill Tkhai
2023-06-07  4:49   ` kernel test robot
2023-06-07  7:33     ` Yujie Liu
2023-06-05 19:03 ` [PATCH v2 3/3] fs: Use delayed shrinker unregistration Kirill Tkhai
2023-06-06  0:38   ` Roman Gushchin
2023-06-06  1:24     ` Dave Chinner
2023-06-06  2:56       ` Roman Gushchin
2023-06-06  6:51         ` Dave Chinner
2023-06-06 15:56           ` Roman Gushchin
2023-06-06 21:21       ` Kirill Tkhai
2023-06-06 22:30         ` Dave Chinner
2023-06-08 16:36       ` Theodore Ts'o
2023-06-08 23:17         ` Dave Chinner
2023-06-09  0:27           ` Andrew Morton
2023-06-09  2:50             ` Qi Zheng
2023-06-05 22:32 ` [PATCH v2 0/3] mm: Make unregistration of super_block shrinker more faster Dave Chinner
2023-06-06 21:06   ` Kirill Tkhai
2023-06-06 22:02     ` Dave Chinner
2023-06-07  2:51       ` Qi Zheng
2023-06-08 21:58         ` Dave Chinner

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=168599178203.70911.18350742045278218790.stgit@pro.pro \
    --to=tkhai@ya.ru \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=hughd@google.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=muchun.song@linux.dev \
    --cc=paulmck@kernel.org \
    --cc=roman.gushchin@linux.dev \
    --cc=vbabka@suse.cz \
    --cc=viro@zeniv.linux.org.uk \
    --cc=zhengqi.arch@bytedance.com \
    /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