IO
Specific to the Linux kernel v2.6
Memory Mapped IO
Memory mapping associates a range from an address space with some portion of a
regular file or with a block device. Accessing the memory-mapped file can
then be done as if its contents were stored in memory. One advantage of this
technique is that files can be treated as if they were random access (as
opposed to having to keep track of the current location and using
fseek() etc.
Shared Memory Mapping
- A page can be mapped to multiple processes
- Changes (writes) by one are visible to the others
Private Memory Mapping
- Read-only to a process
- A write operation to a page will cause that page to no longer
be mapped to the file (i.e. the disk isn't updated with the change)
- Updates to the file performed by anyone else are visible
References:
Understanding the Linux Kernel (3rd Edition) by Bovet and Cesati, and published by O'Reilly.