lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 20 Sep 2019 17:22:40 -0700
From:   Randy Dunlap <rdunlap@...radead.org>
To:     Hui Zhu <teawaterz@...ux.alibaba.com>, sjenning@...hat.com,
        ddstreet@...e.org, akpm@...ux-foundation.org, mhocko@...e.com,
        willy@...radead.org, chris@...is-wilson.co.uk, hannes@...xchg.org,
        ziqian.lzq@...fin.com, osandov@...com, ying.huang@...el.com,
        aryabinin@...tuozzo.com, vovoy@...omium.org,
        richard.weiyang@...il.com, jgg@...pe.ca, dan.j.williams@...el.com,
        rppt@...ux.ibm.com, jglisse@...hat.com, b.zolnierkie@...sung.com,
        axboe@...nel.dk, dennis@...nel.org, josef@...icpanda.com,
        tj@...nel.org, oleg@...hat.com, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org
Subject: Re: [RFC v2] zswap: Add CONFIG_ZSWAP_IO_SWITCH to handle swap IO
 issue

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@...ux.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ