linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Lance Yang <ioworker0@gmail.com>, akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Mingzhe Yang <mingzhe.yang@ly.com>
Subject: Re: [PATCH 1/1] mm/rmap: add CONFIG_MM_ID guard for folio_test_large_maybe_mapped_shared()
Date: Thu, 17 Apr 2025 14:56:15 +0200	[thread overview]
Message-ID: <a825b3c3-55f7-4d90-a318-e20acf55e0cd@redhat.com> (raw)
In-Reply-To: <20250417124908.58543-1-ioworker0@gmail.com>

On 17.04.25 14:49, Lance Yang wrote:
> 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@redhat.com>
> Signed-off-by: Mingzhe Yang <mingzhe.yang@ly.com>

^ should that be here?

> Signed-off-by: Lance Yang <ioworker0@gmail.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

That should work. I can throw this into a cross-compile setup later if I 
get to it.

Acked-by: David Hildenbrand <david@redhat.com>

-- 
Cheers,

David / dhildenb



  reply	other threads:[~2025-04-17 12:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-17 12:49 Lance Yang
2025-04-17 12:56 ` David Hildenbrand [this message]
2025-04-17 13:24   ` Lance Yang
2025-04-17 13:26     ` David Hildenbrand
2025-04-17 14:29       ` Lance Yang
2025-04-17 22:02 ` Andrew Morton
2025-04-18  7:26   ` Lance Yang
2025-04-18 10:38     ` David Hildenbrand
2025-04-18 11:40       ` Lance Yang

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=a825b3c3-55f7-4d90-a318-e20acf55e0cd@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=ioworker0@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingzhe.yang@ly.com \
    /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