Linux vm.overcommit_memory and overcommit_ratio

What these two sysctls actually do vm.overcommit_memory and vm.overcommit_ratio are the two knobs the Linux kernel exposes for virtual memory commitment accounting — the accounting layer that decides whether your process can be granted a virtual address range that may not have actual pages to back it. The commit accounting sits on top of the... » read more

Linux multi-generational LRU: state of mglru in 2026

What mglru actually replaces The multi-generational LRU (mglru, also lru_gen in the kernel source) is the replacement page-reclaim algorithm merged in Linux 6.1 (commit c174c2cd0441, end of 2022, Yu Zhao’s 12-patch series). It sits next to the classic active/inactive LRU — both compile paths exist in mm/vmscan.c and you choose at boot with CONFIG_LRU_GEN_ENABLED. The... » read more

Linux memory cgroup v2: how the kernel enforces the budget

What the memory controller actually does The cgroup v2 memory controller enforces a per-cgroup memory budget that the page allocator checks at every allocation. When a cgroup exceeds its allowance, the kernel starts reclaiming its pages, slowing down its tasks under memory pressure, and — if the cgroup is at its hard limit and cannot... » read more

Linux PSI memory pressure: what it really measures

What PSI actually measures Pressure Stall Information (PSI) was merged in Linux 4.20 (commit e970d0aa0bb98a9d4b9a2e3887da44b79f7b46c8 upstream — Johannes Weiner’s psi-tracking series). It is not a load average, it is not a throughput number, and it is emphatically not a “how busy is the CPU” metric. PSI answers one question and one question only: For how... » read more

Writing an OS Kernel from Scratch – Part 23: Framebuffer — Run Your OS on a Graphical Interface!

dean
Writing an OS Kernel from Scratch – Part 23: Framebuffer — Run Your OS on a Graphical Interface! “VGA text mode can only display characters; a real graphical interface requires pixel-level control. Today, we implement the Framebuffer driver, enabling your OS to draw points, lines, rectangles, and even display images!” In previous posts, our output... » read more

Writing an OS Kernel from Scratch – Part 2: Hello World Analysis

dean
Writing an OS Kernel from Scratch – Part 2: Hello World Analysis “You think ‘Hello World’ is just printing a line? In an OS kernel, it hides the secrets of boot flow, memory layout, and hardware protocols.” In the previous post, we successfully had our kernel output “Hello from the kernel!” on QEMU. Looks simple,... » read more

Writing an OS Kernel from Scratch – Part 21: Implementing a Terminal — Make Your Shell Truly Interactive!

dean
Writing an OS Kernel from Scratch – Part 21: Implementing a Terminal — Make Your Shell Truly Interactive! “Your shell can run commands, but how does the user edit commands, handle backspace, or respond to Ctrl+C? Today, we implement a full terminal (Terminal) supporting line editing, signals, and job control!” In the previous post, we... » read more

Writing an OS Kernel from Scratch 201: Storage System – VFS: Designing a Unified File Abstraction Layer

dean
Writing an OS Kernel from Scratch 201: Storage System – VFS: Designing a Unified File Abstraction Layer “In a custom OS, how do you make open/read/write work with both ext2 and procfs? This article designs a VFS abstraction layer from scratch, building four core objects, implementing path resolution and caching, providing a unified interface for... » read more

Writing an OS Kernel from Scratch – Part 28: Window Manager — Controlling Windows via Keyboard

dean
Writing an OS Kernel from Scratch – Part 28: Window Manager — Controlling Windows via Keyboard “No mouse? No problem! Real geeks control everything with the keyboard. Today, we implement a Window Manager (WM), moving and resizing windows via keyboard shortcuts!” In previous posts, we built a userspace Display Server, Launcher, and multiple applications, but... » read more

Writing an OS Kernel from Scratch – Part 18: Multi-core Support — Make Your OS Truly Parallel!

dean
Writing an OS Kernel from Scratch – Part 18: Multi-core Support — Make Your OS Truly Parallel! “Single-core scheduling is just pseudo-concurrency; the real performance leap is multi-core! Today, we wake up all CPU cores and implement SMP (Symmetric Multi-Processing) support!” In the previous post, we implemented a preemptive scheduler, but all tasks still switched... » read more

Writing an OS Kernel from Scratch – Part 3: Multiboot Protocol Explained — The “Universal Language” Between Kernel and Bootloader

dean
Writing an OS Kernel from Scratch – Part 3: Multiboot Protocol Explained — The “Universal Language” Between Kernel and Bootloader Your kernel is written, but how does GRUB “recognize” it? The secret lies in a protocol called Multiboot. In the first two posts, we successfully ran our kernel on QEMU and understood the linker script... » read more

Writing an OS Kernel from Scratch – Part 27: Application Launcher — Building Your Desktop Environment Prototype

dean
Writing an OS Kernel from Scratch – Part 27: Application Launcher — Building Your Desktop Environment Prototype “A graphical interface can’t just have windows — it needs an entry point! Today, we implement an Application Launcher, managing applications via .desktop files and launching them with a click!” In the previous post, we successfully moved the... » read more

Writing an OS Kernel from Scratch – Part 25: Unix Domain Sockets — The Foundation of IPC

dean
Writing an OS Kernel from Scratch – Part 25: Unix Domain Sockets — The Foundation of Inter-Process Communication (IPC) “The Display Server and Client need efficient communication, but pipes are unidirectional and unstructured. Today, we implement Unix Domain Sockets (AF_UNIX), making IPC as natural as file operations!” In the previous post, we built the Display... » read more