Re: [PATCH RFC v2 06/19] Add a vmalloc_node_user function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/3/24 17:59, Kent Overstreet wrote:
> On Fri, May 31, 2024 at 06:56:01AM -0700, Christoph Hellwig wrote:
>>>  void *vmalloc_user(unsigned long size)
>>>  {
>>> -	return __vmalloc_node_range(size, SHMLBA,  VMALLOC_START, VMALLOC_END,
>>> -				    GFP_KERNEL | __GFP_ZERO, PAGE_KERNEL,
>>> -				    VM_USERMAP, NUMA_NO_NODE,
>>> -				    __builtin_return_address(0));
>>> +	return _vmalloc_node_user(size, NUMA_NO_NODE);
>>
>> But I suspect simply adding a gfp_t argument to vmalloc_node might be
>> a much easier to use interface here, even if it would need a sanity
>> check to only allow for actually useful to vmalloc flags.
> 
> vmalloc doesn't properly support gfp flags due to page table allocation

Thanks Kent, I had actually totally misunderstood what Christoph meant. 


I might miss something, but vmalloc_node looks quite different to
vmalloc_user / vmalloc_node_user


 void *vmalloc_user(unsigned long size)
 {
       return __vmalloc_node_range(size, SHMLBA,  VMALLOC_START, VMALLOC_END,
                                   GFP_KERNEL | __GFP_ZERO, PAGE_KERNEL,
                                   VM_USERMAP, NUMA_NO_NODE,
                                   __builtin_return_address(0));
 }



vs


void *__vmalloc_node(unsigned long size, unsigned long align,
                            gfp_t gfp_mask, int node, const void *caller)
{
        return __vmalloc_node_range(size, align, VMALLOC_START, VMALLOC_END,
                                gfp_mask, PAGE_KERNEL, 0, node, caller);
}


void *vmalloc_node(unsigned long size, int node)
{
        return __vmalloc_node(size, 1, GFP_KERNEL, node,
                        __builtin_return_address(0));
}




If we wanted to avoid another export, shouldn't we better rename
vmalloc_user to vmalloc_node_user, add the node argument and change
all callers?

Anyway, I will send the current patch separately to linux-mm and will ask
if it can get merged before the fuse patches.


Thanks,
Bernd





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux