Thread (5 messages) 5 messages, 4 authors, 2012-11-26

what is the difference between kmalloc and vmalloc?

From: Mulyadi Santosa <hidden>
Date: 2012-11-26 08:25:34

Hi...

On Mon, Nov 26, 2012 at 1:51 PM, Vijay Chauhan [off-list ref] wrote:
Is it necessary that vmalloc always allocate virtually contiguous
memory and not physically contiguous?
to the best I know, yes vmalloc allocate virtually contigous.

However, since they manage the pages by fiddling with the page tables,
there is a chance that some of them are physically contigous IMHO
Except large size memory allocation why one needs to use vmalloc? Can
we say that use kmalloc and  if it fails retry with kmalloc?
nice question: AFAIK vmalloc() is made to tackle large size memory
allocation, or in other word to side step memory fragmentation issue.

IIRC too, that by using vmalloc, the vmalloc-ed area are guarded by
guard pages on both start and end address. So it's like stack overflow
guard pages. But don't count me on this info. Check it by yourself.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help