Re: [PATCH] fs: use kmalloc() to allocate fdmem if possible

Jiri Slaby
2010-05-03T09:19:09Z

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