[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1623137297-29685-1-git-send-email-huangzhaoyang@gmail.com>
Date: Tue, 8 Jun 2021 15:28:17 +0800
From: Huangzhaoyang <huangzhaoyang@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
Minchan Kim <minchan@...nel.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: [PATCH] mm: zram: amend SLAB_RECLAIM_ACCOUNT on zspage_cachep
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
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);
if (!pool->zspage_cachep) {
kmem_cache_destroy(pool->handle_cachep);
pool->handle_cachep = NULL;
--
1.9.1
Powered by blists - more mailing lists