Question

What is the difference between the vma_flags VM_IO and VM_RESERVED? How should they be used?
The comments in linux kernel source code is very confusing

http://lxr.free-electrons.com/source/include/linux/mm.h?v=3.4;a=arm#L104
http://lxr.free-electrons.com/source/include/linux/mm.h?v=3.4;a=arm#L96

#define VM_IO           0x00004000      /* Memory mapped I/O or similar */
#define VM_RESERVED     0x00080000      /* Count as reserved_vm like IO */

Thanks

Was it helpful?

Solution

From: http://www.makelinux.net/ldd3/chp-15-sect-1

"VM_IO marks a VMA as being a memory-mapped I/O region. Among other things, the VM_IO flag prevents the region from being included in process core dumps.
VM_RESERVED tells the memory management system not to attempt to swap out this VMA; it should be set in most device mappings."

For better understanding of how and why these evolved and what is the linux kernel community's recommendation, read these lwn articles:

http://lwn.net/Articles/161204/
http://lwn.net/Articles/162860/


UPDATE:
The VM_RESERVED flag has been discontinued. See Linus' patch

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top