O'Reilly logo

Understanding the Linux® Virtual Memory Manager by Mel Gorman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12. Shared Memory Virtual Filesystem

Sharing a region of memory backed by a file or device is simply a case of calling mmap() with the MAP_SHARED flag. However, there are two important cases where an anonymous region needs to be shared between processes. The first is when mmap()with MAP_SHARED is used without file backing. These regions will be shared between a parent and child process after a fork() is executed. The second is when a region is explicitly setting them up with shmget() and is attached to the virtual address space with shmat().

When pages within a VMA are backed by a file on disk, the interface used is straightforward. To read a page during a page fault, the required nopage() function is found in vm_area_structvm_ops. To ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required