Page cache.
also: buffer cache · OS page cacheThe kernel's RAM cache of file pages: reads that hit it take microseconds instead of a trip to disk.
the two-minute refresher
- read() is served from RAM on a hit (about 1 µs) and from disk on a miss (about 10 ms on an HDD).
- Writes are write-back by default: they land in the cache and are flushed later, so a crash can lose them.
- fsync() forces the flush; databases call it to make commits durable.
- Databases that run their own cache use O_DIRECT to avoid caching the same data twice.