[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20240118203119.764016-1-shikemeng@huaweicloud.com>
Date: Fri, 19 Jan 2024 04:31:19 +0800
From: Kemeng Shi <shikemeng@...weicloud.com>
To: akpm@...ux-foundation.org,
linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] writeback: avoid to move skipped wb in offline_cgwbs list
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@...weicloud.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
Powered by blists - more mailing lists