difference between VM_IO and VM_RESERVED
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
#define VM_IO 0x00004000 /* Memory mapped I/O or similar */ #define VM_RESERVED 0x00080000 /* Count as reserved_vm like IO */
"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:
UPDATE: The VM_RESERVED flag has been discontinued. See Linus' patch