All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] erofs: fix PSI memstall accounting
@ 2024-11-27  8:52 ` Gao Xiang
  0 siblings, 0 replies; 17+ messages in thread
From: Gao Xiang @ 2024-11-27  8:52 UTC (permalink / raw)
  To: linux-erofs; +Cc: Gao Xiang, Max Kellermann, LKML

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 related	[flat|nested] 17+ messages in thread

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

Thread overview: 17+ 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-11-27  8:52 ` Gao Xiang
2024-12-02 21:52 ` Sandeep Dhavale via Linux-erofs
2024-12-02 21:52   ` Sandeep Dhavale
2024-12-03  1:42   ` Gao Xiang
2024-12-03  8:02     ` Max Kellermann via Linux-erofs
2024-12-03  8:02       ` Max Kellermann
2024-12-03  8:15       ` Gao Xiang
2024-12-03  8:20         ` Max Kellermann via Linux-erofs
2024-12-03  8:20           ` Max Kellermann
2024-12-03 13:30         ` Max Kellermann via Linux-erofs
2024-12-03 13:30           ` Max Kellermann
2024-12-03 14:00           ` Max Kellermann via Linux-erofs
2024-12-03 14:00             ` Max Kellermann
2024-12-04  2:12             ` Gao Xiang
2024-12-12 14:19 ` Chao Yu via Linux-erofs
2024-12-12 14:19   ` Chao Yu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.