[PATCH v1 7/9] mm: Introduce unmap_desc struct to reduce function arguments
Lorenzo Stoakes
lorenzo.stoakes at oracle.com
Thu Sep 11 02:22:36 PDT 2025
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
More information about the maple-tree
mailing list