[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ad888abe-2ffc-41bf-b60f-e4508374b5c1@linux.alibaba.com>
Date: Thu, 21 Nov 2024 22:02:04 +0800
From: Gao Xiang <hsiangkao@...ux.alibaba.com>
To: Max Kellermann <max.kellermann@...os.com>,
Peter Zijlstra <peterz@...radead.org>
Cc: Suren Baghdasaryan <surenb@...gle.com>,
Johannes Weiner <hannes@...xchg.org>, linux-kernel@...r.kernel.org
Subject: Re: Bad psi_group_cpu.tasks[NR_MEMSTALL] counter
On 2024/6/12 18:20, Max Kellermann wrote:
> On Wed, Jun 12, 2024 at 11:49 AM Peter Zijlstra <peterz@...radead.org> wrote:
>> The erofs one is also not entirely obvious, but irrelevant if you're not using
>> it... the below should make it a little more obvious, but what do I know.
>
> We do use erofs a lot, and I read that very function the other day -
> it is weird code with two loop levels plus continue and even goto; but
> I thought it was okay. psi_memstall_enter() is only ever called if
The outer loop handles the whole inflight chain (all compression
extents that need to be decompressed).
The inner loop handles each compression extent (called as a pcluster
-- physical cluster in EROFS) in the chain, and it could contain
several consecutive physical blocks so it needs a loop:
If the physical block doesn't need a real I/O (due to cached data
for example), it will "continue;"
Or it will check if i/o is consecutive, if not, submit the current bio;
then get a new bio if needed and add the physical block to the bio;
if the physical block cannot be added to the bio, retry:
-- some similiar logic can also be found in:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/mpage.c?h=v6.12#n298
Hopefully it helps.
Thanks,
Gao Xiang
Powered by blists - more mailing lists