From patchwork Tue Jun 8 07:28:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhaoyang Huang X-Patchwork-Id: 12305517 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8651AC4743E for ; Tue, 8 Jun 2021 07:29:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 35DE161184 for ; Tue, 8 Jun 2021 07:29:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 35DE161184 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B87116B006E; Tue, 8 Jun 2021 03:29:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B5DAC6B0070; Tue, 8 Jun 2021 03:29:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A252B6B0071; Tue, 8 Jun 2021 03:29:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0031.hostedemail.com [216.40.44.31]) by kanga.kvack.org (Postfix) with ESMTP id 7418E6B006E for ; Tue, 8 Jun 2021 03:29:53 -0400 (EDT) Received: from smtpin40.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 06794181AEF1D for ; Tue, 8 Jun 2021 07:29:53 +0000 (UTC) X-FDA: 78229732266.40.CDB27FA Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by imf14.hostedemail.com (Postfix) with ESMTP id 80E22C0042ED for ; Tue, 8 Jun 2021 07:29:49 +0000 (UTC) Received: by mail-pj1-f53.google.com with SMTP id 22-20020a17090a0c16b0290164a5354ad0so13525567pjs.2 for ; Tue, 08 Jun 2021 00:29:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=A1FVdBLroLku9q9ilLiRJwe+Pjc9CxTsM6tUd9JMzio=; b=WwrMIJm/AGIvcQSZdNNALddGnCqfVUn2saoi2X0NHxQqbTomV5y2hM0pPbV9k8oZ/S WZDNrZdQsOVhdwyUKlsg44nGpc1TxFyEs+67yl3Wrzflf5j+AluRQc+avWS2R6KhVmxp 8/2aY4Eg1hU9aQciO1Qrpc+kk8sAbsu8NzZXbH4YcIT2lkcPnEEo+zyahdr5Tw/xHARG +ZlJ8Ip+KXsBHzMvOzcq5Rx0XmISsJkYxORMZ12atdFpPT9OTl7YKuTljeS31k6PgiyW YwQvlMXLyZFbwG4NDbzGz54mJ+9w5gLtc58xoi2Wv9blpnNp+GzKdh79FawoM4NwJk9+ 5V5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=A1FVdBLroLku9q9ilLiRJwe+Pjc9CxTsM6tUd9JMzio=; b=gQB76VbMipDLUOss5+04V9ZPerl/Vr/Pr+icbMIjOHyTB5nSf0uEWsURPImOWpmBUq AaIPszubbflOg8q9SrtXOsOrsm2JzT8sXLms2iN+SVu1D8vN1l8cpRSpjx0UEQzP7W3g xleLX8NtHK66Q7Ak+46T69Ioz9x49VbnIKaifxvrsiKUlPCFTIgVgbd+k38Hm5+8TWoH kZ8qEtEpMhOKaHsxE8Ps0purjoY2Seh44+e9Kv/vx7eR+u6/uxE4Kw0wasqSNS5O6oxp LLSgHGo3ai9rJPENa3krHCDAJrfWxbhgJA28cCAyGC787THGdZvB9ihM8UpBFzsPej2p 7FoA== X-Gm-Message-State: AOAM531YSxYNYPfp5D6x3K1UWBGX6kvPFzMzlcgm5F8lStxjoZKV/bga s6wv9K8QdXyWIgwse1DS7defNyjEhiSKEA== X-Google-Smtp-Source: ABdhPJwiUnjNauhfySzvfF5dovb7omM5q58TCIclGTS9zR86etrocbOAuHA3NRGCMGaGfNJ9kfujGQ== X-Received: by 2002:a17:90b:1e0b:: with SMTP id pg11mr3304270pjb.173.1623137391677; Tue, 08 Jun 2021 00:29:51 -0700 (PDT) Received: from bj03382pcu.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id o10sm13807080pjr.2.2021.06.08.00.29.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Jun 2021 00:29:51 -0700 (PDT) From: Huangzhaoyang To: Andrew Morton , Minchan Kim , Zhaoyang Huang , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Nitin Gupta , Sergey Senozhatsky Subject: [PATCH] mm: zram: amend SLAB_RECLAIM_ACCOUNT on zspage_cachep Date: Tue, 8 Jun 2021 15:28:17 +0800 Message-Id: <1623137297-29685-1-git-send-email-huangzhaoyang@gmail.com> X-Mailer: git-send-email 1.7.9.5 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 80E22C0042ED Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b="WwrMIJm/"; spf=pass (imf14.hostedemail.com: domain of huangzhaoyang@gmail.com designates 209.85.216.53 as permitted sender) smtp.mailfrom=huangzhaoyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: gpcqecga8berrs1rkfrp15ymsubn9xue X-HE-Tag: 1623137389-702363 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000013, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Zhaoyang Huang 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 --- 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;