From: Johannes Weiner <hannes@cmpxchg.org>
To: Zhaoyang Huang <huangzhaoyang@gmail.com>
Cc: Vlastimil Babka <vbabka@suse.cz>,
Andrew Morton <akpm@linux-foundation.org>,
Minchan Kim <minchan@kernel.org>,
Zhaoyang Huang <zhaoyang.huang@unisoc.com>,
"open list:MEMORY MANAGEMENT" <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm : bail out from psi memstall after submit_bio in swap_readpage
Date: Wed, 8 Sep 2021 07:36:40 -0400 [thread overview]
Message-ID: <YTigSOuZWgqldGBO@cmpxchg.org> (raw)
In-Reply-To: <CAGWkznG+m0CgEHUAN4dmeenYYkBFP5JUzyLnzhfTK0Am25xXDA@mail.gmail.com>
On Wed, Sep 08, 2021 at 11:35:40AM +0800, Zhaoyang Huang wrote:
> On Tue, Sep 7, 2021 at 9:24 PM Johannes Weiner <hannes@cmpxchg.org> wrote:
> >
> > On Tue, Sep 07, 2021 at 08:15:30PM +0800, Zhaoyang Huang wrote:
> > > On Tue, Sep 7, 2021 at 8:03 PM Vlastimil Babka <vbabka@suse.cz> wrote:
> > > >
> > > > On 9/7/21 13:59, Huangzhaoyang wrote:
> > > > > From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
> > > > >
> > > > > It doesn't make sense to count IO time into psi memstall. Bail out after
> > > > > bio submitted.
> > > >
> > > > Isn't that the point if psi, to observe real stalls, which include IO?
> >
> > Yes, correct.
> >
> > > IO stalls could be observed within blk_io_schedule. The time cost of
> > > the data from block device to RAM is counted here.
> >
> > Yes, that is on purpose. The time a thread waits for swap read IO is
> > time in which the thread is not productive due to a lack of memory.
> >
> > For async-submitted IO, this happens in lock_page() called from
> > do_swap_page(). If the submitting thread directly waits after the
> > submit_bio(), then that should be accounted too.
> IMO, memstall counting should be terminated by bio submitted. blk
> driver fetching request and the operation on the real device shouldn't
> be counted in. It especially doesn't make sense in a virtualization
> system like XEN etc, where the blk driver is implemented via
> backend-frontend way that introduce memory irrelevant latency
Yes but the entire IO operation and all the associated latency only
happens due to a shortage of memory in the first place. The thread is
incurring these delays due to a lack of memory.
What is a memstall if not the latencies and wait times incurred in the
process of reloading pages that were evicted prematurely?
prev parent reply other threads:[~2021-09-08 11:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-07 11:59 Huangzhaoyang
2021-09-07 12:02 ` Vlastimil Babka
2021-09-07 12:15 ` Zhaoyang Huang
2021-09-07 13:26 ` Johannes Weiner
2021-09-08 3:35 ` Zhaoyang Huang
2021-09-08 11:36 ` Johannes Weiner [this message]
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=YTigSOuZWgqldGBO@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=akpm@linux-foundation.org \
--cc=huangzhaoyang@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=vbabka@suse.cz \
--cc=zhaoyang.huang@unisoc.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