traversing vma on nommu

Hajime Tazaki thehajime at gmail.com
Fri Nov 8 14:25:55 PST 2024


On Sat, 09 Nov 2024 01:52:50 +0900,
Liam R. Howlett wrote:
> 
> First, don't be sorry.  This is very helpful and you are doing
> everything correct.  I appreciate the help and the politeness of
> debugging an issue that is probably very frustrating for you.

thanks for the words.

> > after another random attempt trying to avoid the issue, the patch
> > below also fixed it.  sequential nulls are also gone.
> > 
> > diff --git a/mm/nommu.c b/mm/nommu.c
> > index 385b0c15add8..0c708f85408d 100644
> > --- a/mm/nommu.c
> > +++ b/mm/nommu.c
> > @@ -573,7 +573,7 @@ static int delete_vma_from_mm(struct vm_area_struct *vma)
> >         VMA_ITERATOR(vmi, vma->vm_mm, vma->vm_start);
> >  
> >         vma_iter_config(&vmi, vma->vm_start, vma->vm_end);
> > -       if (vma_iter_prealloc(&vmi, vma)) {
> > +       if (vma_iter_prealloc(&vmi, NULL)) {
> 
> Yes, this is the correct fix and this is a bug.  It should be backported
> with the correct tags (Cc: Stable, Fixes), send it to Andrew Morton and
> cc me and the mm list.
> 
> The preallocation calculation is dependent on the argument passed and we
> are passing the wrong argument.
> 
> Reviewed-by: Liam R. Howlett <Liam.Howlett at Oracle.com>

thanks for the review.  will prepare a patch and send it soon.

> >                 pr_warn("Allocation of vma tree for process %d failed\n",
> >                        current->pid);
> >                 return -ENOMEM;
> > 
> > if this is a right fix, the following commit introduced this issue
> > while restructuring the interface.
> > 
> > commit b5df09226450165c434084d346fcb6d4858b0d52
> > Author: Liam R. Howlett <Liam.Howlett at oracle.com>
> > Date:   Mon Jul 24 14:31:52 2023 -0400
> > 
> >     mm: set up vma iterator for vma_iter_prealloc() calls
> > 
> 
> That sounds about right for the Fixes tag.

okay.

> Please Cc me on your UM Linux patches for nommu as it may make my
> testing life easier as well, if it's not too much trouble.

no problem at all, I will !

-- Hajime



More information about the maple-tree mailing list