All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huangzhaoyang <huangzhaoyang@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Minchan Kim <minchan@kernel.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: [PATCH] mm: zram: amend SLAB_RECLAIM_ACCOUNT on zspage_cachep
Date: Tue,  8 Jun 2021 15:28:17 +0800	[thread overview]
Message-ID: <1623137297-29685-1-git-send-email-huangzhaoyang@gmail.com> (raw)

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
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);
 	if (!pool->zspage_cachep) {
 		kmem_cache_destroy(pool->handle_cachep);
 		pool->handle_cachep = NULL;
-- 
1.9.1


             reply	other threads:[~2021-06-08  7:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08  7:28 Huangzhaoyang [this message]
2021-06-18 22:02 ` [PATCH] mm: zram: amend SLAB_RECLAIM_ACCOUNT on zspage_cachep Minchan Kim
2021-06-21  2:35   ` Zhaoyang Huang
2021-06-21  2:35     ` Zhaoyang Huang
2021-06-22 23:38     ` Minchan Kim
2021-06-23  5:46       ` Zhaoyang Huang
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=1623137297-29685-1-git-send-email-huangzhaoyang@gmail.com \
    --to=huangzhaoyang@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.