From: Yafang Shao <laoar.shao@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.com>, Linux MM <linux-mm@kvack.org>,
shaoyafang@didiglobal.com
Subject: Re: [PATCH] mm/vmscan: call vmpressure_prio() in kswapd reclaim path
Date: Tue, 11 Jun 2019 20:24:41 +0800 [thread overview]
Message-ID: <CALOAHbDEWBWWz5qG6xoEMu3mqOom1K895FmFrnwrwND6tWk_ow@mail.gmail.com> (raw)
In-Reply-To: <20190610141242.382cfefa2c98b618d12057fb@linux-foundation.org>
On Tue, Jun 11, 2019 at 5:12 AM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Mon, 10 Jun 2019 16:42:27 +0800 Yafang Shao <laoar.shao@gmail.com> wrote:
>
> > Once the reclaim scanning depth goes too deep, it always mean we are
> > under memory pressure now.
> > This behavior should be captured by vmpressure_prio(), which should run
> > every time when the vmscan's reclaiming priority (scanning depth)
> > changes.
> > It's possible the scanning depth goes deep in kswapd reclaim path,
> > so vmpressure_prio() should be called in this path.
> >
> > Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
>
> What effect does this change have upon userspace?
>
> Presumably you observed some behaviour(?) and that behaviour was
> undesirable(?) and the patch changed that behaviour to something
> else(?) and this new behaviour is better for some reason(?).
>
When there're few free memory,
the usespace can receive the critical memory pressure event earlier,
because when we try to do direct reclaim we always wakeup the kswapd first.
Currently the vmpressure work (vmpressure_work_fn) can only be
scheduled in direct reclaim path,
and with this change, the vmpressure work can be scheduled in kswapd
reclaim path.
I think receiving the critical memory pressure event earlier can give
the userspace more chance to do something to prevent random OOM.
With this change, the vmpressure work will be scheduled more frequent
than before when the system is under memory pressure.
Thanks
Yafang
prev parent reply other threads:[~2019-06-11 12:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-10 8:42 [PATCH] mm/vmscan: call vmpressure_prio() in kswapd reclaim path Yafang Shao
2019-06-10 21:12 ` Andrew Morton
2019-06-11 12:24 ` Yafang Shao [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=CALOAHbDEWBWWz5qG6xoEMu3mqOom1K895FmFrnwrwND6tWk_ow@mail.gmail.com \
--to=laoar.shao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=shaoyafang@didiglobal.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;
as well as URLs for NNTP newsgroup(s).