Possible Duplicate:
What is the difference between vmalloc and kmalloc?
Please tell in detail explanation
kmalloc allocates physically contiguous memory, memory which pages are laid consecutively in physical RAM. vmalloc allocates memory which is contiguous in kernel virtual memory space (that means pages allocated that way are not contiguous in RAM, but the kernel sees them as one block).
kmalloc is the preffered way, as long as you don't need very big areas. The trouble is, if you want to do DMA from/to some hardware device, you'll need to use kmalloc, and you'll probably need bigger chunk. The solution is to allocate memory as soon as possible, before memory gets fragmented.
If you only allocate small chunks (page or few pages), just use kmalloc and don't worry about details. :)
Above answer has been copied from source - http://kerneltrap.org/node/4020
kmalloc returns physically contiguous memory, kmalloc memory is reserved and locked, it cannot be swapped, Memory is subject to fragmentation, If you don't need contiguous mapping in kernel space, you can use vmalloc to avoid the fragmentation problem.
精彩评论