Re: [PATCH v3 bpf RESEND 1/4] vmalloc: replace VM_NO_HUGE_VMAP with VM_ALLOW_HUGE_VMAP
From: Christoph Hellwig
Date: Fri Apr 15 2022 - 02:31:47 EST
On Thu, Apr 14, 2022 at 12:59:11PM -0700, Song Liu wrote:
> +void *vmalloc_huge(unsigned long size)
> +{
> + return __vmalloc_node_range(size, 1, VMALLOC_START, VMALLOC_END,
> + GFP_KERNEL, PAGE_KERNEL, VM_ALLOW_HUGE_VMAP,
> + NUMA_NO_NODE, __builtin_return_address(0));
> +}
> +EXPORT_SYMBOL_GPL(vmalloc_huge);
It seems like this one isn't actually used in this series, so I'd
suggest to drop it.
> +
> +/**
> + * __vmalloc_huge - allocate virtually contiguous memory, allow huge pages
> + * @size: allocation size
> + * @gfp_mask: flags for the page level allocator
> + *
> + * Allocate enough pages to cover @size from the page level
> * allocator and map them into contiguous kernel virtual space.
> + * If @size is greater than or equal to PMD_SIZE, allow using
> + * huge pages for the memory
> *
> * Return: pointer to the allocated memory or %NULL on error
> */
> -void *vmalloc_no_huge(unsigned long size)
> +void *__vmalloc_huge(unsigned long size, gfp_t gfp_mask)
And I'd just rename this vmalloc_huge.
Otherwise looks good:
Reviewed-by: Christoph Hellwig <hch@xxxxxx>