linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: alexs@kernel.org
To: Johannes Weiner <hannes@cmpxchg.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org (open list)
Cc: "Alex Shi (Tencent)" <alexs@kernel.org>
Subject: [PATCH] mm/memcg: alignment memcg_data define condition
Date: Mon,  8 Jul 2024 14:32:36 +0800	[thread overview]
Message-ID: <20240708063236.1096395-1-alexs@kernel.org> (raw)

From: "Alex Shi (Tencent)" <alexs@kernel.org>

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) <alexs@kernel.org>
---
 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)
-- 
2.43.0



             reply	other threads:[~2024-07-08  6:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-08  6:32 alexs [this message]
2024-07-09  1:11 ` Suren Baghdasaryan

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=20240708063236.1096395-1-alexs@kernel.org \
    --to=alexs@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox