Re: [PATCH] mm: mglru: promote mapped executable folios after first usage
From: Barry Song
Date: Wed Jul 15 2026 - 04:01:32 EST
On Wed, Jul 15, 2026 at 3:54 PM Barry Song <baohua@xxxxxxxxxx> wrote:
[...]
> > >
> > > Hi Baolin,
> > >
> > > Because ARM doesn't set the surrounding PTEs to young, while x86
> > > may behave differently and mark the surrounding PTEs as young as
> > > well. Could we also collect the data on x86?
> > >
> > > void set_pte_range(struct vm_fault *vmf, struct folio *folio,
> > > struct page *page, unsigned int nr, unsigned long addr)
> > > {
> > > ...
> > >
> > > if (prefault && arch_wants_old_prefaulted_pte())
> > > entry = pte_mkold(entry);
> > > else
> > > entry = pte_sw_mkyoung(entry);
> >
> > Sure. But I don't think it's very relevant to this point. MGLRU doesn't
> > protect normally accessed mmaped exec file folios well enough. Anyway,
> > I'll test it on x86.
>
> My point is that even mmaped executable folios that have never been
> accessed might still get promoted because they already have the accessed
> bit set. :-)
Second thought: we don't do much readahead for VM_EXEC since it is
considered random access. So maybe I am being over-cautious here.
The data will tell us :-)