From: Randy Dunlap <rdunlap@infradead.org>
To: Hui Zhu <teawaterz@linux.alibaba.com>,
sjenning@redhat.com, ddstreet@ieee.org,
akpm@linux-foundation.org, mhocko@suse.com, willy@infradead.org,
chris@chris-wilson.co.uk, hannes@cmpxchg.org,
ziqian.lzq@antfin.com, osandov@fb.com, ying.huang@intel.com,
aryabinin@virtuozzo.com, vovoy@chromium.org,
richard.weiyang@gmail.com, jgg@ziepe.ca,
dan.j.williams@intel.com, rppt@linux.ibm.com, jglisse@redhat.com,
b.zolnierkie@samsung.com, axboe@kernel.dk, dennis@kernel.org,
josef@toxicpanda.com, tj@kernel.org, oleg@redhat.com,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [RFC v2] zswap: Add CONFIG_ZSWAP_IO_SWITCH to handle swap IO issue
Date: Fri, 20 Sep 2019 17:22:40 -0700 [thread overview]
Message-ID: <fa3dcc32-e120-52a5-2365-68e55df1f1d9@infradead.org> (raw)
In-Reply-To: <1568961307-32419-1-git-send-email-teawaterz@linux.alibaba.com>
On 9/19/19 11:35 PM, Hui Zhu wrote:
> This is the second version of this patch. The previous version is in
> https://lkml.org/lkml/2019/9/11/935
> I updated the commit introduction and Kconfig because it is not clear.
>
Hi,
Just a few minor fixes (below):
>
> Signed-off-by: Hui Zhu <teawaterz@linux.alibaba.com>
> ---
> include/linux/swap.h | 3 +++
> mm/Kconfig | 18 +++++++++++++++++
> mm/page_io.c | 16 +++++++++++++++
> mm/zswap.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 92 insertions(+)
>
> diff --git a/mm/Kconfig b/mm/Kconfig
> index 56cec63..5408d65 100644
> --- a/mm/Kconfig
> +++ b/mm/Kconfig
> @@ -546,6 +546,24 @@ config ZSWAP
> they have not be fully explored on the large set of potential
> configurations and workloads that exist.
>
> +config ZSWAP_IO_SWITCH
> + bool "Compressed cache for swap pages according to the IO status"
> + depends on ZSWAP
> + def_bool n
Just drop the "def_bool n". It's already a "bool" and 'n' is the default value for it.
> + help
> + This function help the system that normal swap speed is higher
helps the system in which normal swap speed is higher
> + than zswap speed to handle the swap IO issue.
> + For example, a VM that is disk device is not set cache config or
possibly:
For example, a VM where the disk device is not set for cache config or
> + set cache=writeback.
> +
> + This function make zswap just work when the disk of the swap file
This function makes
> + is under high IO load.
> + It add two parameters read_in_flight_limit and write_in_flight_limit to
It adds two parameters (read_in_flight_limit and write_in_flight_limit) to
> + zswap. When zswap is enabled, pages will be stored to zswap only
> + when the IO in flight number of swap device is bigger than
of the swap device
> + zswap_read_in_flight_limit or zswap_write_in_flight_limit.
> + If unsure, say "n".
> +
> config ZPOOL
> tristate "Common API for compressed memory storage"
> help
> diff --git a/mm/zswap.c b/mm/zswap.c
> index 0e22744..1255645 100644
> --- a/mm/zswap.c
> +++ b/mm/zswap.c
> @@ -62,6 +62,13 @@ static u64 zswap_reject_compress_poor;
> static u64 zswap_reject_alloc_fail;
> /* Store failed because the entry metadata could not be allocated (rare) */
> static u64 zswap_reject_kmemcache_fail;
> +#ifdef CONFIG_ZSWAP_IO_SWITCH
> +/* Store failed because zswap_read_in_flight_limit or
> + * zswap_write_in_flight_limit is bigger than IO in flight number of
> + * swap device
> + */
Please use the documented multi-line comment format. E.g.:
/*
* Store failed because zswap_read_in_flight_limit or
* zswap_write_in_flight_limit is bigger than IO in flight number of
* swap device.
*/
> +static u64 zswap_reject_io;
> +#endif
> /* Duplicate store was encountered (rare) */
> static u64 zswap_duplicate_entry;
>
> @@ -114,6 +121,22 @@ static bool zswap_same_filled_pages_enabled = true;
> module_param_named(same_filled_pages_enabled, zswap_same_filled_pages_enabled,
> bool, 0644);
>
> +#ifdef CONFIG_ZSWAP_IO_SWITCH
> +/* zswap will not try to store the page if zswap_read_in_flight_limit is
> + * bigger than IO read in flight number of swap device
> + */
Use documented multi-line comment format.
> +static unsigned int zswap_read_in_flight_limit;
> +module_param_named(read_in_flight_limit, zswap_read_in_flight_limit,
> + uint, 0644);
> +
> +/* zswap will not try to store the page if zswap_write_in_flight_limit is
> + * bigger than IO write in flight number of swap device
> + */
ditto.
thanks.
--
~Randy
prev parent reply other threads:[~2019-09-21 0:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-20 6:35 Hui Zhu
2019-09-21 0:22 ` Randy Dunlap [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=fa3dcc32-e120-52a5-2365-68e55df1f1d9@infradead.org \
--to=rdunlap@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=aryabinin@virtuozzo.com \
--cc=axboe@kernel.dk \
--cc=b.zolnierkie@samsung.com \
--cc=chris@chris-wilson.co.uk \
--cc=dan.j.williams@intel.com \
--cc=ddstreet@ieee.org \
--cc=dennis@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=jgg@ziepe.ca \
--cc=jglisse@redhat.com \
--cc=josef@toxicpanda.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=oleg@redhat.com \
--cc=osandov@fb.com \
--cc=richard.weiyang@gmail.com \
--cc=rppt@linux.ibm.com \
--cc=sjenning@redhat.com \
--cc=teawaterz@linux.alibaba.com \
--cc=tj@kernel.org \
--cc=vovoy@chromium.org \
--cc=willy@infradead.org \
--cc=ying.huang@intel.com \
--cc=ziqian.lzq@antfin.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