Re: what is the difference between kmalloc and vmalloc?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi...

On Mon, Nov 26, 2012 at 1:51 PM, Vijay Chauhan <kernel.vijay@xxxxxxxxx> 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

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux