Re: [PATCH] fs: use kmalloc() to allocate fdmem if possible
From: Jiri Slaby
Date: Mon May 03 2010 - 05:19:13 EST
On 05/03/2010 11:13 AM, Eric Dumazet wrote:
> /*
> * Warning: if size is not a power of two, kmalloc() might
> * waste memory because of its requirements.
> */
> void *kvmalloc(size_t size)
> {
> void *ptr = kmalloc(size, GFP_KERNEL | __GFP_NOWARN);
This is kind of waste of high-order pages, isn't it? Wouldn't it be
better to have a watermark where we skip kmalloc completely?
>
> if (ptr)
> return ptr;
> return vmalloc(size);
> }
--
js
suse labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/