Virtual Memory
Linux process virtual memory layout
Expand of user stack
vmalloc
vm_struct
- From vm_start to vm_end
- User space page table saved in here
- Each process is not identical
- vmalloc is often slower than kmalloc, because it may have to remap the buffer space into a virtually contiguous range
- Most of the time we use kmalloc
slab/slub alloc
kmalloc()
- The requirements is similar with user space heap
- Kernel alloc small size memory.
- Difference with kernel stack
- task_struct storage here?
- Heavy use cache.
- kmalloc is limited in the size of buffer it can provide: 128 KBytes(4MB in 2.6.33)
- physically contiguous
- Can specific the zone to alloc memory. (Normal, High, DMA)
buddy alloc
- Physical page management.