<p>Page faults occurs when the process tries to access a memory that isn’t backed by a physical page kernel raises a fault which loads a page. It happens on first access, stack expansion, COW, swap and much more. However it comes with a cost. </p><p><br /></p><p>In this episode of the backend engineering show I dissect the need and the cost page faults in the kernel. </p><p><br /></p><ul><li>0:00 Intro </li><li>4:00 Virtual memory</li><ul><li>Abstraction of physical memory</li><li>Memory sharing</li><li>Allow more processes to run , unused go to disk</li><li>Numa, kernel can place memory near the cpu</li></ul><li>12:00 VMA areas</li><ul><li>Text/code </li><li>Data </li><li>BSS</li><li>Heap</li><li>Stack</li></ul><li>19:50 Kernel mode</li><li>25:30 What is a Page fault?</li><li>30:30 First access page fault</li><li>33:00 Stack Expansion page fault</li><li>34:30 CoW page fault</li><li>38:00 Swap page fault</li><li>39:39 File backed page fault</li><li>40:29 Permission page fault </li><li><strong>45:30 Summary</strong></li></ul><p><br /></p><p><br /></p>