Re: [PATCH mm-new v3 1/1] mm/khugepaged: abort collapse scan on non-swap entries

From: Lorenzo Stoakes

Date: Tue Oct 14 2025 - 10:43:57 EST


On Tue, Oct 14, 2025 at 10:37:28PM +0800, Lance Yang wrote:
>
>
> On 2025/10/14 22:32, David Hildenbrand wrote:
> >
> > > static inline int pte_protnone(pte_t pte)
> > > {
> > >     return (pte_flags(pte) & (_PAGE_PROTNONE | _PAGE_PRESENT))
> > >         == _PAGE_PROTNONE;
> > > }
> > >
> > > static inline int pte_present(pte_t a)
> > > {
> > >     return pte_flags(a) & (_PAGE_PRESENT | _PAGE_PROTNONE);
> > > }
> > > ```
> > >
> > > On x86, pte_present() returns true for a protnone pte. And I'd assume
> > > other archs behave similarly ...
> >
> > Applies to all architecture. prot-none entries must be present,
> > otherwise we'd have a lot of other issues :)
>
> Thanks for confirming, David! That's good to know ;p
>
> So @Lorenzo, looks like we're good here on the protnone front. Does
> that clear up your concern?
>

No absolutely not, I go into detail as to why in my reply. I don't want
that upstreamed.