[Devel] [PATCH rh7] fs/fuse/dev: improve ->splice() with fragmented memory

Andrey Ryabinin aryabinin at virtuozzo.com
Wed Nov 29 17:43:02 MSK 2017



On 11/29/2017 05:37 PM, Vasily Averin wrote:
> got it,
> kvmalloc does not use kmalloc for size <= (16*PAGE_SIZE)
> 

No, it does use kmalloc() first:

void *kvmalloc_node(size_t size, gfp_t flags, int node)
{
	gfp_t kmalloc_flags = flags;

....
	/*
	 * Make sure that larger requests are not too disruptive - no OOM
	 * killer and no allocation failure warnings as we have a fallback
	 */
	if (size > PAGE_SIZE)
		kmalloc_flags |= __GFP_NORETRY | __GFP_NOWARN;

	ret = kmalloc_node(size, kmalloc_flags, node);

	/*
	 * It doesn't really make sense to fallback to vmalloc for sub page
	 * requests
	 */
	if (ret || size <= PAGE_SIZE)
		return ret;

	return __vmalloc_node_flags(size, node, flags | __GFP_HIGHMEM);



More information about the Devel mailing list