The kernel page cache
As we learned from Appendix A, File I/O Essentials, when a process (or thread) performs file I/O by, say, using the fread(3) or fwrite(3) library layer APIs, they ultimately are issued to the underlying OS via the read(2) and write(2) system calls. These system calls get the kernel to perform the I/O; though it seems intuitive, the reality is that the read-and-write system calls are not synchronous; that is, they may return before the actual I/O has completed. (Obviously, this will be the case for writes to a file; synchronous reads have to return the data read to the user space memory buffer; until then, the read blocks. However, using Asynchronous I/O (AIO), even reads can be made asynchronous.)
The fact is, within ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access