* [PATCH] writeback: avoid to move skipped wb in offline_cgwbs list
@ 2024-01-18 20:31 Kemeng Shi
0 siblings, 0 replies; only message in thread
From: Kemeng Shi @ 2024-01-18 20:31 UTC (permalink / raw)
To: akpm, linux-mm, linux-kernel
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-01-18 12:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-18 20:31 [PATCH] writeback: avoid to move skipped wb in offline_cgwbs list Kemeng Shi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox