From patchwork Mon Jul 8 06:32:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alexs@kernel.org X-Patchwork-Id: 13726187 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02724C3271E for ; Mon, 8 Jul 2024 06:27:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 940BB6B008C; Mon, 8 Jul 2024 02:27:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8F03F6B0092; Mon, 8 Jul 2024 02:27:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7DFA36B0093; Mon, 8 Jul 2024 02:27:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 61B706B008C for ; Mon, 8 Jul 2024 02:27:36 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 1CBFC410D7 for ; Mon, 8 Jul 2024 06:27:36 +0000 (UTC) X-FDA: 82315604112.19.8CF8FD3 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf08.hostedemail.com (Postfix) with ESMTP id 6FA3E160017 for ; Mon, 8 Jul 2024 06:27:33 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=sJIjQAs5; spf=pass (imf08.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1720420024; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=IuIt/9JC0JXd7kQMik3TD1BvC9cg1hQByQdovq4UkmQ=; b=s5inxrlBN5qXG0gbkU2rx7aqQBY0lE98JBRWEuaUJqlem/sg7eY9PqQp25vnGkw4pEZ4S9 1Ke401eVTjod8RMuvPcLt79XoJCEJduSstrliKfI5s8KsjvFoeoyiynsSlkP0rqOXZ1ON+ C7YChEteBr7jrutykUj9BqLT38Z1C+c= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720420024; a=rsa-sha256; cv=none; b=my1Bt+Ol+OALmVCisH/9pfnvQqLVUbatklGSnembvUtIvlVzVT+YI5k22fBPN+tru7pXu5 z5hiiaMh2nV2nzpbveezYAte29dBfxko7vdfG9nWxJkcNIYKIkBtpm/pyQUhkMsKWjDcnR z1QrvFFF455o2h93NKxeHdjUTOr1S60= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=sJIjQAs5; spf=pass (imf08.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 699C1608D5; Mon, 8 Jul 2024 06:27:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D60DDC116B1; Mon, 8 Jul 2024 06:27:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720420052; bh=q7EkaLpJ/goiOKVT9D8Ig3s/2pCWyrNA2sFi+gAcE8c=; h=From:To:Cc:Subject:Date:From; b=sJIjQAs5ZGXjbLeP++6RmvZHC0YRyCHMnt4tZx/Lf73m6icR9LOiXmmd1a0oQjGku Yuw7ZthHhCeghr1avEhndKIk1BKh38M2/GVn/LWQrlKvPcXNjoy1plYUUxcL7MPStE enWR5fw3NWaZbH+wbGROz1htD1r2m+/IJuEUhCmLE3+YaOUA1KAEJ6Sjw5jNmcZEH+ B0wjq/rJCnxq3Dp9n9NQj1ZmsSmlK20m/+T1ZXk9LyGzVdDX6H+OsvGx9R4mjwfEhe JiIAJhq3CEBmoP1CPOIaNuQnttD665cV2Ent+9OIkpduOPxd4BQaFT1DnvRVXitVVn OABcqRzNRkSHg== From: alexs@kernel.org To: Johannes Weiner , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org (open list) Cc: "Alex Shi (Tencent)" Subject: [PATCH] mm/memcg: alignment memcg_data define condition Date: Mon, 8 Jul 2024 14:32:36 +0800 Message-ID: <20240708063236.1096395-1-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 6FA3E160017 X-Stat-Signature: 94zh74tjkj38n9hygzh17cgcpi64y6f9 X-HE-Tag: 1720420053-840129 X-HE-Meta: U2FsdGVkX19KjklLvN3AROyi41BnffXNoQIzsYqmZTDmHwTKZKJnpiVlkod2w3v2Satngp9/pnnJJnQkptTqnVXC4iHbPQJP1prvskI0xGIZgGZkI2l0K5xoYA8BxIWU2oYjXRWnJXb+hLgeAJ07R8aEKVDjw25TbMG82JBUfaSqv905EOjISHmmiHX+H0eYvswbq1b5VkTM2toi5oQZgg2QiP3p6ONUCqd39Y2kUjp3W/1Jryraeezim1ginqSD0batatxTxip06ki9BhD7wBteXBxxGp4cFr85sCupqcSHK7M3oUC17OOOuqFOX1c1qmkMiyAk1uvFmaSbG+j/h8G+8qKWah/CZdEUvTCdcmvCvR+vAkfge0AOBYck+ODaiYic4Z9Znk2seJwTAn9scyneFRwUAPNTVWB40vPy+O+R4F0FKX3Oa4NWG4ho4mhxw1xubv7YOxZdWDoaV31CFicMf0dV6Uqe48FdddLmarACAIS7/9B0qM5Jo6jYGvmQti7g5VT5CCU540eazUmfcrEdzZryBU8N1fMx6AMVK1RFVjXcdaGSER5wPWK36u6A+X1DEFMyfRfoOzYPFOhaT2kR8kS0rCEFDIQTNMZHXB/MgUHWvVy3mj0LNfyeqotXrL+04lM7niXqult+pno9aknEHDbZgFTmIcKQsowfe/ftOjflfp1uCAmncKOtNCcmVh7rd1jf9uY0vNxDlR8ElmfxxQFQnAg+4Gg2MbrgglDoCPtBEmc18UY6nLGDvjp90vLpkKMhfxxS3E0pSf06jJ0nlMFssRZeECaT8eq4tUQuf/H5/3IUnveNVjlnZYkCbPFdeU1CwcIBew0HJuQcpkWCpAZ6WRKt1ywU5AnVvzm2hiDodBA0dXo6DtkiAOz740WNNzkHGK6srj9fyaQQvI1r+bE6oRyFubOmcFRyoDRLd/o3uoJi1oHEcvy8CtjvYmbGydlF4ZfTkZJfc3z gIwT+ixz /ies742Y/N8PI2F4SEGNHMaiEYK50GCQqgE1Nw4xK91VCMQwhcUiPeGV90dFRHUGcDkaClR7ogCSxCpzMpntai6bgjZzveJvV+dyOVw8BgO9q5UB38MMTEvHj3wGBB/AGndu/y8zsPmJ0vnVJ0vCm0WqtVNxkcsZgWiZj57RW6jsimzLzUyYhHQ+oq15kUFHsXpaPUEHakT/p3GLfCsF4GzTEBgBh7G6G4t4GwveQn/2t0Q4CkiQkEsh0CZY7r5ItWElO9E8ZjsGypCnu+et8OpyFSA== 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: List-Subscribe: List-Unsubscribe: From: "Alex Shi (Tencent)" commit 21c690a349ba ("mm: introduce slabobj_ext to support slab object extensions") changed the folio/page->memcg_data define condition from MEMCG to SLAB_OBJ_EXT. The code works well, since config SLAB_OBJ_EXT is fold into MEMCG in init/Kconfig. But many related functions that deal with memcg_data still defined under MEMCG instead of SLAB_OBJ_EXT, and FOLIO_MATCH with memcg_data are defined under MEMCG too. That looks weird and incorrect with memcg_data raw meaning. So let's put memcg_data under MEMCG config to alignment the definition with FOLIO_MATCH and its usage in functions. Signed-off-by: Alex Shi (Tencent) --- include/linux/mm_types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index ef09c4eef6d3..c067db6fa711 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -180,7 +180,7 @@ struct page { /* Usage count. *DO NOT USE DIRECTLY*. See page_ref.h */ atomic_t _refcount; -#ifdef CONFIG_SLAB_OBJ_EXT +#ifdef CONFIG_MEMCG unsigned long memcg_data; #endif @@ -343,7 +343,7 @@ struct folio { }; atomic_t _mapcount; atomic_t _refcount; -#ifdef CONFIG_SLAB_OBJ_EXT +#ifdef CONFIG_MEMCG unsigned long memcg_data; #endif #if defined(WANT_PAGE_VIRTUAL)