[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250417124908.58543-1-ioworker0@gmail.com>
Date: Thu, 17 Apr 2025 20:49:08 +0800
From: Lance Yang <ioworker0@...il.com>
To: akpm@...ux-foundation.org
Cc: david@...hat.com,
linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Lance Yang <ioworker0@...il.com>,
Mingzhe Yang <mingzhe.yang@...com>
Subject: [PATCH 1/1] mm/rmap: add CONFIG_MM_ID guard for folio_test_large_maybe_mapped_shared()
Add a compile-time check to make sure folio_test_large_maybe_mapped_shared()
is only used with CONFIG_MM_ID enabled, as it directly accesses the _mm_ids
field that only works under CONFIG_MM_ID.
Suggested-by: David Hildenbrand <david@...hat.com>
Signed-off-by: Mingzhe Yang <mingzhe.yang@...com>
Signed-off-by: Lance Yang <ioworker0@...il.com>
---
include/linux/page-flags.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index d3909cb1e576..6bd9b9043976 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -1232,6 +1232,8 @@ static inline int folio_has_private(const struct folio *folio)
static inline bool folio_test_large_maybe_mapped_shared(const struct folio *folio)
{
+ /* This function should never be called without CONFIG_MM_ID enabled. */
+ BUILD_BUG_ON(!IS_ENABLED(CONFIG_MM_ID));
return test_bit(FOLIO_MM_IDS_SHARED_BITNUM, &folio->_mm_ids);
}
#undef PF_ANY
--
2.49.0
Powered by blists - more mailing lists