[PATCH v1 7/9] mm: Introduce unmap_desc struct to reduce function arguments

Suren Baghdasaryan surenb at google.com
Thu Sep 11 10:03:50 PDT 2025


On Thu, Sep 11, 2025 at 9:56 AM Liam R. Howlett <Liam.Howlett at oracle.com> wrote:
>
> * Suren Baghdasaryan <surenb at google.com> [250911 12:51]:
> > On Thu, Sep 11, 2025 at 2:22 AM Lorenzo Stoakes
> > <lorenzo.stoakes at oracle.com> wrote:
> > >
> > > On Tue, Sep 09, 2025 at 02:44:05PM -0700, Suren Baghdasaryan wrote:
> > > > On Tue, Sep 9, 2025 at 12:11 PM Liam R. Howlett <Liam.Howlett at oracle.com> wrote:
> > > > > +struct unmap_desc {
> > > > > +       struct  ma_state *mas;        /* the maple state point to the first vma */
> > > > > +       struct vm_area_struct *first; /* The first vma */
> > > > > +       unsigned long first_pgaddr;   /* The first pagetable address to free */
> > > > > +       unsigned long last_pgaddr;    /* The last pagetable address to free */
> > > > > +       unsigned long vma_min;        /* The min vma address */
> > > > > +       unsigned long vma_max;        /* The max vma address */
> > > > > +       unsigned long tree_max;       /* Maximum for the vma tree search */
> > > > > +       unsigned long tree_reset;     /* Where to reset the vma tree walk */
> > > > > +       bool mm_wr_locked;            /* If the mmap write lock is held */
> > > > > +};
> > > > > +
> > > > > +#define UNMAP_REGION(name, _vmi, _vma, _vma_min, _vma_max, _prev, _next)      \
> > > >
> > > > Maybe DEFINE_UNMAP_REGION() similar to DEFINE_PER_CPU() or DEFINE_SPINLOCK()?
> > >
> > > Look at MMAP_STATE(), VMG_MMAP_STATE() for precedent in vma.c
> >
> > Yeah but UNMAP_REGION() sounds like an action while MMAP_STATE(),
> > VMG_MMAP_STATE() do not. Anyway, whatever works I guess.
>
> Is UNMAP_STATE() okay?

I think so.



More information about the maple-tree mailing list