lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250422162023.55c4899cfa3486b409289efa@linux-foundation.org>
Date: Tue, 22 Apr 2025 16:20:23 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: David Hildenbrand <david@...hat.com>
Cc: Lance Yang <lance.yang@...ux.dev>, mingzhe.yang@...com,
 linux-mm@...ck.org, linux-kernel@...r.kernel.org, Lance Yang
 <ioworker0@...il.com>
Subject: Re: [RESEND PATCH v2 1/1] mm/rmap: add CONFIG_MM_ID guard for
 folio_test_large_maybe_mapped_shared()

On Tue, 22 Apr 2025 09:00:54 +0200 David Hildenbrand <david@...hat.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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ