From: "Huang\, Ying" <ying.huang@intel.com>
To: Andrea Righi <andrea.righi@canonical.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Minchan Kim <minchan@kernel.org>,
Anchal Agarwal <anchalag@amazon.com>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: swap: introduce fixed-size readahead policy
Date: Mon, 13 Apr 2020 09:24:14 +0800 [thread overview]
Message-ID: <87d08c89fl.fsf@yhuang-dev.intel.com> (raw)
In-Reply-To: <20200412150449.GA740985@xps-13> (Andrea Righi's message of "Sun, 12 Apr 2020 17:04:49 +0200")
Andrea Righi <andrea.righi@canonical.com> writes:
> Introduce a new fixed-size swap-in readahead policy that can be selected
> at run-time.
>
> The global swap-in readahead policy takes in account the previous access
> patterns, using a scaling heuristic to determine the optimal readahead
> chunk dynamically.
>
> This works pretty well in most cases, but like any heuristic there are
> specific cases when this approach is not ideal, for example the swapoff
> scenario.
>
> During swapoff we just want to load back into memory all the swapped-out
> pages and for this specific use case a fixed-size readahead is more
> efficient.
>
> This patch introduces a new sysfs interface
> (/sys/kernel/mm/swap/swap_ra_policy) that can be set as following:
>
> - 0: current scaling swap-in readahead policy (default)
> - 1: fixed-size readahead policy (size is determined by
> vm.page-cluster)
>
> The specific use case this patch is addressing is to improve swapoff
> performance when a VM has been hibernated, resumed and all memory needs
> to be forced back to RAM by disabling swap (see the test case below).
I don't know whether the use case is important or not. Usually the
performance of swapoff doesn't matter. Maybe you can provide some
information on this.
Even if it's important, I don't think we really need to add another ABI.
You can just optimize the swapoff performance inside kernel. And we may
not even need to add a new policy, just use cluster readahead and
increase swapin_readahead_hits in swapoff if cluster readahead is used.
Best Regards,
Huang, Ying
next prev parent reply other threads:[~2020-04-13 1:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-12 15:04 Andrea Righi
2020-04-13 1:24 ` Huang, Ying [this message]
2020-04-13 8:59 ` Andrea Righi
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=87d08c89fl.fsf@yhuang-dev.intel.com \
--to=ying.huang@intel.com \
--cc=akpm@linux-foundation.org \
--cc=anchalag@amazon.com \
--cc=andrea.righi@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
/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