linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: David Hildenbrand <david@redhat.com>
Cc: Lance Yang <lance.yang@linux.dev>,
	mingzhe.yang@ly.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, Lance Yang <ioworker0@gmail.com>
Subject: Re: [RESEND PATCH v2 1/1] mm/rmap: add CONFIG_MM_ID guard for folio_test_large_maybe_mapped_shared()
Date: Tue, 22 Apr 2025 16:20:23 -0700	[thread overview]
Message-ID: <20250422162023.55c4899cfa3486b409289efa@linux-foundation.org> (raw)
In-Reply-To: <fa4c886f-81d5-4679-bba3-4357f1d9c6ff@redhat.com>

On Tue, 22 Apr 2025 09:00:54 +0200 David Hildenbrand <david@redhat.com> wrote:

> > --- a/include/linux/page-flags.h
> > +++ b/include/linux/page-flags.h
> > @@ -1230,10 +1230,15 @@ static inline int folio_has_private(const struct folio *folio)
> >   	return !!(folio->flags & PAGE_FLAGS_PRIVATE);
> >   }
> > 
> > +#ifdef CONFIG_MM_ID
> >   static inline bool folio_test_large_maybe_mapped_shared(const struct folio *folio)
> >   {
> >   	return test_bit(FOLIO_MM_IDS_SHARED_BITNUM, &folio->_mm_ids);
> >   }
> > +#else
> > +bool folio_test_large_maybe_mapped_shared(const struct folio *folio);
> > +#endif
> 
> Fine with me. At this point, I do prefer inlining the function, though.

The above has the advantage that if the compiler unintendedly emits a
call to folio_test_large_maybe_mapped_shared(), the link will fail.

I do think a little comment which explains this trick is needed.


      reply	other threads:[~2025-04-22 23:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-18 15:22 Lance Yang
2025-04-20 23:29 ` Andrew Morton
2025-04-21  5:13   ` Lance Yang
2025-04-21  5:16     ` Lance Yang
2025-04-21  7:17       ` David Hildenbrand
2025-04-21  7:50         ` Lance Yang
2025-04-21 19:22     ` Andrew Morton
2025-04-22  4:35       ` Lance Yang
2025-04-22  7:00         ` David Hildenbrand
2025-04-22 23:20           ` Andrew Morton [this message]

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=20250422162023.55c4899cfa3486b409289efa@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=ioworker0@gmail.com \
    --cc=lance.yang@linux.dev \
    --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