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] [thread-next>] [day] [month] [year] [list]
Message-ID: <YM0YB6p2i346Zzhz@google.com>
Date:   Fri, 18 Jun 2021 15:02:47 -0700
From:   Minchan Kim <minchan@...nel.org>
To:     Huangzhaoyang <huangzhaoyang@...il.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Zhaoyang Huang <zhaoyang.huang@...soc.com>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, Nitin Gupta <ngupta@...are.org>,
        Sergey Senozhatsky <senozhatsky@...omium.org>
Subject: Re: [PATCH] mm: zram: amend SLAB_RECLAIM_ACCOUNT on zspage_cachep

On Tue, Jun 08, 2021 at 03:28:17PM +0800, Huangzhaoyang wrote:
> From: Zhaoyang Huang <zhaoyang.huang@...soc.com>
> 
> Zspage_cachep is found be merged with other kmem cache during test, which
> is not good for debug things(zs_pool->zspage_cachep present to be another
> kmem cache in memory dumpfile). It is also neccessary to do so as shrinker has

It's not a only problem of zsmalloc because slab want to minimize
fragmentation so try to merge several objects if it's allowed.
So I don't think it's particular problem of zsmalloc.
I guess slub has some option maybe "nomerge" if you want it.

> been registered for zspage. Amending this flag can help kernel to calculate
> SLAB_RECLAIMBLE correctly.
> 
> Signed-off-by: Zhaoyang Huang <zhaoyang.huang@...soc.com>
> ---
>  mm/zsmalloc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
> index 19b563b..0b0addd 100644
> --- a/mm/zsmalloc.c
> +++ b/mm/zsmalloc.c
> @@ -328,7 +328,7 @@ static int create_cache(struct zs_pool *pool)
>  		return 1;
>  
>  	pool->zspage_cachep = kmem_cache_create("zspage", sizeof(struct zspage),
> -					0, 0, NULL);
> +					0, SLAB_RECLAIM_ACCOUNT, NULL);

How does zspage become SLAB_RECLAIM_ACCOUNT?

I took the flag as "cacheable" object. IOW, when the shrinker
ask to reclaim the object, it should reclaim(e.g., discarding)
those objects for reclaming. However, that's not the case
in zsmalloc.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ