From: Minchan Kim <minchan@kernel.org>
To: Huangzhaoyang <huangzhaoyang@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Zhaoyang Huang <zhaoyang.huang@unisoc.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Nitin Gupta <ngupta@vflare.org>,
Sergey Senozhatsky <senozhatsky@chromium.org>
Subject: Re: [PATCH] mm: zram: amend SLAB_RECLAIM_ACCOUNT on zspage_cachep
Date: Fri, 18 Jun 2021 15:02:47 -0700 [thread overview]
Message-ID: <YM0YB6p2i346Zzhz@google.com> (raw)
In-Reply-To: <1623137297-29685-1-git-send-email-huangzhaoyang@gmail.com>
On Tue, Jun 08, 2021 at 03:28:17PM +0800, Huangzhaoyang wrote:
> From: Zhaoyang Huang <zhaoyang.huang@unisoc.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@unisoc.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.
next prev parent reply other threads:[~2021-06-18 22:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-08 7:28 Huangzhaoyang
2021-06-18 22:02 ` Minchan Kim [this message]
2021-06-21 2:35 ` Zhaoyang Huang
2021-06-22 23:38 ` Minchan Kim
2021-06-23 5:46 ` Zhaoyang Huang
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=YM0YB6p2i346Zzhz@google.com \
--to=minchan@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=huangzhaoyang@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ngupta@vflare.org \
--cc=senozhatsky@chromium.org \
--cc=zhaoyang.huang@unisoc.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