What is Page cache ?
When a user process reads or writes a file, it is actually modifying a copy of that file in main memory. The kernel creates that copy from the disk and writes back changes to it when necessary. The memory taken up by these copies is called cached memory, in other words we call it as page cache.
Cached memory will be consumed whenever a user process initiates a read or write. The kernel will look for a copy of the part of the file the user is acting on, and, if no such copy exists, it will allocate one new page of cache memory and fill it with the appropriate contents read out from the disk. If the user only reads the file, this page will be marked as a “clean” cache page. However, as soon as the user writes the file, the page will be marked “dirty.” A kernel thread which appears in ps called “pdflush ( upto kernel version 2.6.31) / flush ( for kernel version 2.6.32 or later)” will wake up periodically and copy all of the pages marked dirty back to the disk, then mark them as clean again.
Log in to answer.
Copyright © dBuggr.com - All Rights Reserved.