From: Kemeng Shi <shikemeng@huaweicloud.com>
To: akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] writeback: avoid to move skipped wb in offline_cgwbs list
Date: Fri, 19 Jan 2024 04:31:19 +0800 [thread overview]
Message-ID: <20240118203119.764016-1-shikemeng@huaweicloud.com> (raw)
There is no need to move skipped wb to local list. Only move wb which is
going to be cleanup to avoid unnecessary work.
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
---
mm/backing-dev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index 039dc74b505a..681548f848c5 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -773,8 +773,6 @@ static void cleanup_offline_cgwbs_workfn(struct work_struct *work)
while (!list_empty(&offline_cgwbs)) {
wb = list_first_entry(&offline_cgwbs, struct bdi_writeback,
offline_node);
- list_move(&wb->offline_node, &processed);
-
/*
* If wb is dirty, cleaning up the writeback by switching
* attached inodes will result in an effective removal of any
@@ -790,6 +788,8 @@ static void cleanup_offline_cgwbs_workfn(struct work_struct *work)
if (!wb_tryget(wb))
continue;
+ list_move(&wb->offline_node, &processed);
+
spin_unlock_irq(&cgwb_lock);
while (cleanup_offline_cgwb(wb))
cond_resched();
--
2.30.0
reply other threads:[~2024-01-18 12:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20240118203119.764016-1-shikemeng@huaweicloud.com \
--to=shikemeng@huaweicloud.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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).