星期三, 11月 24, 2010

Linux Memory Allocate Strategy

The difference between kmalloc() and vmalloc():

kmalloc() -> physically contiguous
vmalloc() -> virtually contiguous (not physically contiguous)

kmalloc() flags:

GFP_ATOMIC -> non-sleep (interrupt)
GFP_KERNEL -> able to sleep (process context)

If you want to allocate high memory:

alloc_pages() and kmap()

沒有留言: