Re: [PATCH v2] mm/vmalloc: Extend find_vmap_lowest_match_check with extra arguments

From: Uladzislau Rezki
Date: Tue Sep 06 2022 - 14:27:36 EST


>
>
> > On Sep 5, 2022, at 11:05 PM, Song Liu <song@xxxxxxxxxx> wrote:
> >
> > find_vmap_lowest_match() is now able to handle different roots. With
> > DEBUG_AUGMENT_LOWEST_MATCH_CHECK enabled as:
> >
> > diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> > index e68c0081e861..7552f1f8350e 100644
> > --- a/mm/vmalloc.c
> > +++ b/mm/vmalloc.c
> > @@ -713,7 +713,7 @@ EXPORT_SYMBOL(vmalloc_to_pfn);
> > /*** Global kva allocator ***/
> >
> > -#define DEBUG_AUGMENT_LOWEST_MATCH_CHECK 0
> > +#define DEBUG_AUGMENT_LOWEST_MATCH_CHECK 1
> >
> > compilation failed as:
> >
> > mm/vmalloc.c: In function 'find_vmap_lowest_match_check':
> > mm/vmalloc.c:1328:32: warning: passing argument 1 of 'find_vmap_lowest_match' makes pointer from integer without a cast [-Wint-conversion]
> > 1328 | va_1 = find_vmap_lowest_match(size, align, vstart, false);
> > | ^~~~
> > | |
> > | long unsigned int
> > mm/vmalloc.c:1236:40: note: expected 'struct rb_root *' but argument is of type 'long unsigned int'
> > 1236 | find_vmap_lowest_match(struct rb_root *root, unsigned long size,
> > | ~~~~~~~~~~~~~~~~^~~~
> > mm/vmalloc.c:1328:9: error: too few arguments to function 'find_vmap_lowest_match'
> > 1328 | va_1 = find_vmap_lowest_match(size, align, vstart, false);
> > | ^~~~~~~~~~~~~~~~~~~~~~
> > mm/vmalloc.c:1236:1: note: declared here
> > 1236 | find_vmap_lowest_match(struct rb_root *root, unsigned long size,
> > | ^~~~~~~~~~~~~~~~~~~~~~
> >
> > Extend find_vmap_lowest_match_check() and find_vmap_lowest_linear_match()
> > with extra arguments to fix this.
> >
> > Fixes: f9863be49312 ("mm/vmalloc: extend __alloc_vmap_area() with extra arguments")
> > Cc: Uladzislau Rezki (Sony) <urezki@xxxxxxxxx>
> > Cc: Baoquan He <bhe@xxxxxxxxxx>
> > Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> > Signed-off-by: Song Liu <song@xxxxxxxxxx>
>
> Forgot to add the following from v1:
>
> Reviewed-by: Baoquan He <bhe@xxxxxxxxxx>
> Reviewed-by: Uladzislau Rezki (Sony) <urezki@xxxxxxxxx>
>

Works great to me. Appreciate it!

--
Uladzislau Rezki