4 ms·
The kernel page cache already exists, and is used on read() too. The distinction is that instead of read() copying from the kernel page cache, mmap will map tha
by Jasper_ 4y ago
The kernel page cache already exists, and is used on read() too. The distinction is that instead of read() copying from the kernel page cache, mmap will map that page cache page directly into the user's memory address space.
It saves a copy on read, in exchange for a bit more overhead configuring the processes address space up front.