Skip to content
This repository has been archived by the owner on Dec 3, 2022. It is now read-only.

lorenzo-stoakes/linux-vm-notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 

Repository files navigation

Linux VM Notes

IMPORTANT

These notes are superceded by my new linux mm book project where I will be trying to write a book on the subject based on a recent kernel. All future efforts in this area will be made there. See linuxmemory.org for updates on this.

Contents

  1. Fundamentals - Overview of virtual memory concepts without referencing any actual code or making assumptions about prior knowledge.

  2. Page Tables - Discussion about what page tables are, how they are used in linux, how they are manually traversed, the TLB and finally how page tables are allocated and freed.

  3. Process Address Space - Discussion about virtual memory address space for processes - managing VMAs, process data structure construction/destruction, file/device-backed memory regions, page faulting, demand allocation, COW pages, copying to/from userland.

  4. Transparent Huge Pages - Discussion about the kernel's transparent huge pages functionality.

  5. Out of Memory Killer - Discussion about overcommit and how the OOM killer selects and kills victims.

  6. Process Autopsy - Examining the memory allocation performed by the kernel for a simple userland application.

Introduction

NOTE: I target linux 4.6 and an x86-64 non-NUMA system.

This repo contains my notes on the linux 4.6 VM subsystem. I don't make any claim to their quality or usefulness. They are an ongoing project and as such are a constant work in progress.

This work first originated from the notes I took from the excellent Understanding the Linux Virtual Memory Manager by Mel Gorman which, while great, targets the 2.4.22 kernel (released in 2003.) The obvious next stage of study was to take notes for a recent kernel, which is what these notes are!

I am specifically targeting the 4.6 kernel since it was the mainline version at the time of writing and should remain a sane and stable basis for notes and hacks for the foreseeable future. I may update to newer kernel versions over time depending on whether it makes sense to do so (and if I succeed at this project of course!)

Hacks

Speaking of hacks linux-vm-notes's sister repo, linux-vm-hacks, is where I'm putting exploratory code and patches relating to my exploration of the VM subsystem.

License

These notes are licensed under Creative Commons BY-NC-SA.

About

Notes on the linux kernel VM subsystem.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published