From patchwork Thu Jul 1 01:52:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12353273 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,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_RED autolearn=unavailable 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 44377C11F66 for ; Thu, 1 Jul 2021 01:53:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EE4856105A for ; Thu, 1 Jul 2021 01:53:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE4856105A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 776588D023F; Wed, 30 Jun 2021 21:53:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 74DAB8D0236; Wed, 30 Jun 2021 21:53:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 615748D023F; Wed, 30 Jun 2021 21:53:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0130.hostedemail.com [216.40.44.130]) by kanga.kvack.org (Postfix) with ESMTP id 3EFD08D0236 for ; Wed, 30 Jun 2021 21:53:00 -0400 (EDT) Received: from smtpin32.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 1DB5B22BEA for ; Thu, 1 Jul 2021 01:53:00 +0000 (UTC) X-FDA: 78312345720.32.57DAF62 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf06.hostedemail.com (Postfix) with ESMTP id CF69B801AB00 for ; Thu, 1 Jul 2021 01:52:59 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id EC51161241; Thu, 1 Jul 2021 01:52:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1625104379; bh=3mmcgWfzdxHM+eG6w1Er59n7ndos17yQennCj2C0N1s=; h=Date:From:To:Subject:In-Reply-To:From; b=zyZStW2v4TgpiRsaqRlyCmfeuxnVtbMLGjMDMNj9w3aljI3q97jEc82/fXWb0eN9D 85MPGqp0Mh9VpOTVvGAImoZi8hPduDA/Adce95vfui7LQ9gfXkUsP4XjwzFNJPRCae iMHlMhK9siJaA4hMbG+74/HU88N+KI1qUvqg9dFo= Date: Wed, 30 Jun 2021 18:52:58 -0700 From: Andrew Morton To: akpm@linux-foundation.org, linux-mm@kvack.org, minchan@kernel.org, mm-commits@vger.kernel.org, senozhatsky@chromium.org, torvalds@linux-foundation.org, zhaoyang.huang@unisoc.com Subject: [patch 108/192] mm: zram: amend SLAB_RECLAIM_ACCOUNT on zspage_cachep Message-ID: <20210701015258.BrxjIzdE1%akpm@linux-foundation.org> In-Reply-To: <20210630184624.9ca1937310b0dd5ce66b30e7@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=zyZStW2v; spf=pass (imf06.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Stat-Signature: xztnckyqu3t7i4zdzf8netsgwh61ernb X-Rspamd-Queue-Id: CF69B801AB00 X-Rspamd-Server: rspam06 X-HE-Tag: 1625104379-953825 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Zhaoyang Huang Subject: mm: zram: amend SLAB_RECLAIM_ACCOUNT on zspage_cachep 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. Link: https://lkml.kernel.org/r/1623137297-29685-1-git-send-email-huangzhaoyang@gmail.com Signed-off-by: Zhaoyang Huang Cc: Minchan Kim Cc: Sergey Senozhatsky Signed-off-by: Andrew Morton --- mm/zsmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/zsmalloc.c~mm-zram-amend-slab_reclaim_account-on-zspage_cachep +++ a/mm/zsmalloc.c @@ -328,7 +328,7 @@ static int create_cache(struct zs_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;