public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Max Kellermann <max.kellermann@ionos.com>,
	Peter Zijlstra <peterz@infradead.org>
Cc: Suren Baghdasaryan <surenb@google.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	linux-kernel@vger.kernel.org
Subject: Re: Bad psi_group_cpu.tasks[NR_MEMSTALL] counter
Date: Thu, 21 Nov 2024 22:02:04 +0800	[thread overview]
Message-ID: <ad888abe-2ffc-41bf-b60f-e4508374b5c1@linux.alibaba.com> (raw)
In-Reply-To: <CAKPOu+-X8P8WdSEcTX_EVgA9wiMdSdXdzA58Z5vvkQKc+Oz-PQ@mail.gmail.com>



On 2024/6/12 18:20, Max Kellermann wrote:
> On Wed, Jun 12, 2024 at 11:49 AM Peter Zijlstra <peterz@infradead.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

  reply	other threads:[~2024-11-21 14:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-04  7:16 Bad psi_group_cpu.tasks[NR_MEMSTALL] counter Max Kellermann
2024-06-10  8:28 ` Max Kellermann
2024-06-12  5:01 ` Suren Baghdasaryan
2024-06-12  6:49   ` Max Kellermann
2024-06-12  9:48     ` Peter Zijlstra
2024-06-12 10:20       ` Max Kellermann
2024-11-21 14:02         ` Gao Xiang [this message]
2024-06-12 15:17     ` Suren Baghdasaryan
2024-08-05 12:34   ` Max Kellermann
2024-08-06 15:56     ` Suren Baghdasaryan
2024-08-12  8:06       ` Max Kellermann
2024-08-12 21:33         ` Suren Baghdasaryan
2024-11-20 16:30       ` Max Kellermann
2024-11-20 16:56         ` Suren Baghdasaryan
2024-11-21  4:51           ` Christoph Hellwig
2024-11-21  8:43             ` Max Kellermann
2024-11-21 13:18               ` Gao Xiang
2024-11-28 10:00                 ` Max Kellermann
2024-11-28 10:46                   ` Gao Xiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ad888abe-2ffc-41bf-b60f-e4508374b5c1@linux.alibaba.com \
    --to=hsiangkao@linux.alibaba.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=max.kellermann@ionos.com \
    --cc=peterz@infradead.org \
    --cc=surenb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox