mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] erofs: fix PSI memstall accounting
@ 2024-11-27  8:52 Gao Xiang
  2024-12-02 21:52 ` Sandeep Dhavale
  2024-12-12 14:19 ` Chao Yu
  0 siblings, 2 replies; 10+ messages in thread
From: Gao Xiang @ 2024-11-27  8:52 UTC (permalink / raw)
  To: linux-erofs; +Cc: LKML, Gao Xiang, Max Kellermann

Max Kellermann recently reported psi_group_cpu.tasks[NR_MEMSTALL] is
incorrect in 6.11.9 kernel.

I think the root cause of the recent issue is that since the problematic
commit, bio can be NULL so psi_memstall_leave() could be missed in
z_erofs_submit_queue().

Reported-by: Max Kellermann <max.kellermann@ionos.com>
Closes: https://lore.kernel.org/r/CAKPOu+8tvSowiJADW2RuKyofL_CSkm_SuyZA7ME5vMLWmL6pqw@mail.gmail.com
Fixes: 9e2f9d34dd12 ("erofs: handle overlapped pclusters out of crafted images properly")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
 fs/erofs/zdata.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index 01f147505487..19ef4ff2a134 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -1792,9 +1792,9 @@ static void z_erofs_submit_queue(struct z_erofs_decompress_frontend *f,
 			erofs_fscache_submit_bio(bio);
 		else
 			submit_bio(bio);
-		if (memstall)
-			psi_memstall_leave(&pflags);
 	}
+	if (memstall)
+		psi_memstall_leave(&pflags);
 
 	/*
 	 * although background is preferred, no one is pending for submission.
-- 
2.43.5


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-12-12 14:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-27  8:52 [PATCH] erofs: fix PSI memstall accounting Gao Xiang
2024-12-02 21:52 ` Sandeep Dhavale
2024-12-03  1:42   ` Gao Xiang
2024-12-03  8:02     ` Max Kellermann
2024-12-03  8:15       ` Gao Xiang
2024-12-03  8:20         ` Max Kellermann
2024-12-03 13:30         ` Max Kellermann
2024-12-03 14:00           ` Max Kellermann
2024-12-04  2:12             ` Gao Xiang
2024-12-12 14:19 ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®