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

From: Changli Gao
Date: Mon May 03 2010 - 03:52:57 EST


On Mon, May 3, 2010 at 3:42 PM, Avi Kivity <avi@xxxxxxxxxx> wrote:
> On 05/03/2010 10:05 AM, Changli Gao wrote:
>>
>> On Mon, May 3, 2010 at 2:06 PM, Avi Kivity<avi@xxxxxxxxxx> Âwrote:
>>
>>>
>>> My point is, vmalloc() and vfree should do this, not their callers:
>>>
>>> vmalloc(size):
>>> Â Âif (size<= PAGE_SIZE)
>>> Â Â Â Âreturn kmalloc(size, GFP_KERNEL);
>>> Â Â...
>>>
>>> vfree(p):
>>> Â Âif (!is_vmalloc_addr(p) {
>>> Â Â Â Âkfree(p);
>>> Â Â Â Âreturn;
>>> Â Â}
>>> Â Â...
>>>
>>
>> I think we should not change vmalloc/vfree, and you can invent new
>> memory APIs, such as malloc()/free().
>>
>
> Why?
>

Because vmalloc is used to allocate virtually contiguous memory. v in
vmalloc means virtually.


--
Regardsï
Changli Gao(xiaosuo@xxxxxxxxx)
--
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/