Bin's Tech Cabin
Author

Bin's Tech Cabin

Original articles dissecting source code and sharing personal tech insights. A modest space for serious discussion, free from noise and bureaucracy.

38
Articles
0
Likes
13
Views
0
Comments
Recent Articles

Latest from Bin's Tech Cabin

38 recent articles
Bin's Tech Cabin
Bin's Tech Cabin
Sep 18, 2023 · Fundamentals

Unveiling Linux mmap: From Virtual Memory to Page Tables and Huge Pages

This article provides an in‑depth exploration of the Linux mmap system call, covering its role in virtual memory management, page table structures, various mapping types (anonymous, file‑backed, shared, private), flag options, and advanced concepts such as huge pages and transparent huge pages, with kernel‑level diagrams and code examples.

KernelLinuxhugepages
0 likes · 62 min read
Unveiling Linux mmap: From Virtual Memory to Page Tables and Huge Pages
Bin's Tech Cabin
Bin's Tech Cabin
Jul 20, 2023 · Fundamentals

How Linux Maps Virtual Memory to Physical Memory: Inside Page Tables

This article walks through the Linux kernel's memory‑management subsystem, explaining how virtual memory is linked to physical memory via page tables, covering single‑level, two‑level and multi‑level paging, the structure of page‑table entries, the role of the MMU and TLB, and the complete CPU address‑translation process.

LinuxOperating System FundamentalsPage Tables
0 likes · 67 min read
How Linux Maps Virtual Memory to Physical Memory: Inside Page Tables
Bin's Tech Cabin
Bin's Tech Cabin
Jun 20, 2023 · Fundamentals

How Linux’s kmalloc Memory Pool Works: From Slab Design to Allocation

This article explains the architecture and implementation of the Linux kernel kmalloc memory pool, detailing slab cache creation, size selection rules, cache initialization, allocation and free paths, and how different memory zones are handled, with code examples and diagrams.

KernelLinuxSlab Allocator
0 likes · 31 min read
How Linux’s kmalloc Memory Pool Works: From Slab Design to Allocation
Bin's Tech Cabin
Bin's Tech Cabin
Jun 17, 2023 · Fundamentals

Why Linux Relies on Slab Allocators: Inside the Kernel’s Small Object Pool

This article explains how the Linux kernel supplements its buddy system with the slab allocator to efficiently manage tiny memory blocks, covering slab’s design, memory layout, red‑zone protection, poisoning, per‑CPU caches, NUMA node warehouses, allocation fast‑paths, slow‑paths, and release strategies.

KernelLinuxSLUB
0 likes · 58 min read
Why Linux Relies on Slab Allocators: Inside the Kernel’s Small Object Pool
Bin's Tech Cabin
Bin's Tech Cabin
May 4, 2023 · Fundamentals

How Linux’s Slab Allocator Manages Memory: Deep Dive into Fast and Slow Paths

This article dissects the Linux kernel’s slab allocator, explaining its complete architecture, the fast‑path allocation from per‑CPU caches, the slow‑path mechanisms involving partial lists, NUMA node caches, and fallback to the buddy system, while detailing object initialization and freelist construction.

LinuxNUMAmemory management
0 likes · 41 min read
How Linux’s Slab Allocator Manages Memory: Deep Dive into Fast and Slow Paths
Bin's Tech Cabin
Bin's Tech Cabin
Apr 11, 2023 · Fundamentals

How Linux Kernel Builds Slab Caches: A Deep Dive into kmem_cache Creation

This article walks through the Linux kernel's slab allocator, explaining how kmem_cache and kmem_cache_node structures are created, how slab objects are laid out in memory, how the required number of pages is calculated, and how the allocator is bootstrapped to avoid circular dependencies.

Kernel DevelopmentLinux kernelkmem_cache
0 likes · 64 min read
How Linux Kernel Builds Slab Caches: A Deep Dive into kmem_cache Creation
Bin's Tech Cabin
Bin's Tech Cabin
Apr 4, 2023 · Fundamentals

Why Does Linux Need a Slab Allocator? Unveiling the Secrets of Kernel Memory Pools

This article revisits Linux memory allocation, then dives deep into the slab allocator—explaining its relationship with the buddy system, its internal layout, the differences between slab, slub and slob, and how the kernel uses slab caches, per‑CPU caches, and NUMA nodes to efficiently allocate and free small memory objects.

KernelLinuxSLUB
0 likes · 66 min read
Why Does Linux Need a Slab Allocator? Unveiling the Secrets of Kernel Memory Pools
Bin's Tech Cabin
Bin's Tech Cabin
Dec 28, 2022 · Fundamentals

How Linux Allocates Physical Memory: Inside the Kernel’s Buddy Allocator

This article walks through Linux kernel physical memory allocation, explaining the hierarchy of allocation interfaces, the role of gfp_mask and ALLOC flags, the fast and slow allocation paths, memory watermarks, NUMA zone handling, and the complex fallback mechanisms including compaction, direct reclaim, and OOM, all illustrated with code snippets and diagrams.

Buddy AllocatorLinuxNUMA
0 likes · 68 min read
How Linux Allocates Physical Memory: Inside the Kernel’s Buddy Allocator