Re: [PATCH v3 11/11] mm: Use unmap_desc struct for freeing page tables.

From: Liam R. Howlett

Date: Tue Feb 10 2026 - 15:42:53 EST


* Liam R. Howlett <Liam.Howlett@xxxxxxxxxx> [260207 12:37]:
> * Chris Mason <clm@xxxxxxxx> [260124 18:51]:
> > On Wed, 21 Jan 2026 11:49:46 -0500 "Liam R. Howlett" <Liam.Howlett@xxxxxxxxxx> wrote:
> >
> > > Pass through the unmap_desc to free_pgtables() because it almost has
> > > everything necessary and is already on the stack.
> > >
> > > Updates testing code as necessary.
> > >
> > > No functional changes intended.
> > >
> >
> > Hi everyone,
> >
> > I'm running some more aggressive prompts through linux-next and this one was
> > flagged. Apologies in advance if it's way off:
> >
> > > diff --git a/mm/memory.c b/mm/memory.c
> > > --- a/mm/memory.c
> > > +++ b/mm/memory.c

...

> > > + WARN_ON_ONCE(unmap->vma_end - 1 > unmap->pg_end - 1);
...

> #ifdef CONFIG_ARM_LPAE
> #define USER_PGTABLES_CEILING TASK_SIZE
> #endif
>

This does trigger on arm32 with ARM_LPAE set.

Dropping the warning is the easiest fix, but not the right fix. The
code will execute fine, as the upper entries are not in the vma tree but
exist in the page tables.

I think the right thing to do is to reset the unmap desc vma limits to
only include the user pagetable range. This would result in the same
numbers being used during exit_mmap() and during the unmap of the vma;
that path would still use 0 - ULONG_MAX.

Thanks,
Liam