[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190529072424.GA29276@jagdpanzerIV>
Date: Wed, 29 May 2019 16:24:24 +0900
From: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To: Hui Zhu <teawaterz@...ux.alibaba.com>
Cc: minchan@...nel.org, ngupta@...are.org,
sergey.senozhatsky.work@...il.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [UPSTREAM KERNEL] mm/zsmalloc.c: Add module parameter
malloc_force_movable
On (05/29/19 09:22), Hui Zhu wrote:
> When it enabled:
> ~# echo 1 > /sys/module/zsmalloc/parameters/malloc_force_movable
> ~# echo lz4 > /sys/module/zswap/parameters/compressor
> ~# echo zsmalloc > /sys/module/zswap/parameters/zpool
> ~# echo 1 > /sys/module/zswap/parameters/enabled
> ~# swapon /swapfile
[..]
> * We assign a page to ZS_ALMOST_EMPTY fullness group when:
> * n <= N / f, where
> @@ -1479,6 +1486,9 @@ unsigned long zs_malloc(struct zs_pool *pool, size_t size, gfp_t gfp)
> if (unlikely(!size || size > ZS_MAX_ALLOC_SIZE))
> return 0;
>
> + if (zs_malloc_force_movable)
> + gfp |= __GFP_HIGHMEM | __GFP_MOVABLE;
> +
> handle = cache_alloc_handle(pool, gfp);
> if (!handle)
> return 0;
It's zsmalloc user's responsibility to pass appropriate GFP mask
to zs_malloc().
Take a loot at ZRAM, for instance,
handle = zs_malloc(zram->mem_pool, comp_len,
__GFP_KSWAPD_RECLAIM |
__GFP_NOWARN |
__GFP_HIGHMEM |
__GFP_MOVABLE);
zsmalloc should not change GFP. If zswap, for some reason,
doesn't pass __GFP_MOVABLE, then I'd suggest to patch zswap.
-ss
Powered by blists - more mailing lists