lkml.org 
[lkml]   [2018]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] vmalloc: Add __vmalloc_node_try_addr function
On Wed, Jun 20, 2018 at 03:09:28PM -0700, Rick Edgecombe wrote:
>
> /**
> + * __vmalloc_try_addr - try to alloc at a specific address
> + * @addr: address to try
> + * @size: size to try
> + * @gfp_mask: flags for the page level allocator
> + * @prot: protection mask for the allocated pages
> + * @vm_flags: additional vm area flags (e.g. %VM_NO_GUARD)
> + * @node: node to use for allocation or NUMA_NO_NODE
> + * @caller: caller's return address
> + *
> + * Try to allocate at the specific address. If it succeeds the address is
> + * returned. If it fails NULL is returned. It may trigger TLB flushes.

* Try to allocate memory at a specific address. May trigger TLB flushes.
*
* Context: Process context.
* Return: The allocated address if it succeeds. NULL if it fails.

> @@ -1759,8 +1795,9 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align,
> return addr;
>
> fail:
> - warn_alloc(gfp_mask, NULL,
> - "vmalloc: allocation failure: %lu bytes", real_size);
> + if (!(gfp_mask & __GFP_NOWARN))
> + warn_alloc(gfp_mask, NULL,
> + "vmalloc: allocation failure: %lu bytes", real_size);
> return NULL;

Not needed:

void warn_alloc(gfp_t gfp_mask, nodemask_t *nodemask, const char *fmt, ...)
{
...
if ((gfp_mask & __GFP_NOWARN) || !__ratelimit(&nopage_rs))
return;

\
 
 \ /
  Last update: 2018-06-21 00:27    [W:2.059 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site