Linux Buddy Allocator Architecture and Page State Analysis
Binary Decomposition PrincipleAny positive integer can be decomposed into a sum of distinct powers of two (2n, where n ≥ 0). This mathematical property, which forms the foundation of binary representation, is the core mechanism leveraged by the Buddy allocation system.Kernel Buddy System Data Structure HierarchyThe architecture of the Buddy sys ...
Posted on Mon, 03 Aug 2026 16:25:41 +0000 by wobbit
Analyzing eventfd System Call Implementation with select
eventfd(2) Combined with seelect(2) Source Code Analysis
The code examples are from Linux kernel 4.17
eventfd(2) - Creates a file descriptor for event notification.
Usage
Source Code Analysis
References
#include <sys/eventfd.h>
int eventfd(unsigned int initval, int flags);
int eventfd2(unsigned int initval, int flags);
Parameters
- \ ...
Posted on Sat, 01 Aug 2026 16:33:13 +0000 by Fredric
Platform Bus Driver Implementation in Linux
Understanding the Platform Bus
The platform bus is a virtual bus within the Linux kernel architecture, designed to unify the device and driver model. Unlike physical buses such as PCI or USB, the platform bus does not correspond to any physical hardware. It exists to manage devices that do not naturally fit into other bus models, ensuring a con ...
Posted on Sun, 26 Jul 2026 16:17:08 +0000 by dasding
Linux RCU Implementation Deep Dive
This analysis is based on Linux kernel 4.19.195.
Software Implementation Principles
The RCU implementation in software revolves around idnetifying the beginning of a Grace Period (GP), detecting Quiescent States (QS), determining when a grace period ends, handling post-grace-period cleanup, and initiating the next grace period—a large state mac ...
Posted on Sat, 25 Jul 2026 16:55:07 +0000 by jiayanhuang
Linux LED Driver Framework with Hardware Abstraction
Character Device Driver Foundations
Developing a Linux character device driver generally follows a standard sequence of operations:
Acquire a major device number, either statically assigned or dynamically allocated by the kernel.
Declare a file_operations structure to define the driver's supported interactions.
Implement the requisite handlers ...
Posted on Mon, 06 Jul 2026 17:19:02 +0000 by Stressed
Reference for ARM System Call Tables and mmap Implementation in Linux 4.19
Using Linux kernel version 4.19.291 as the reference base.
ARM Architecture System Call Table
The system call definitions for ARM are located in the source file:
linux-4.19.291/arch/arm/tools/syscall.tbl
File Format Structure
Each line in the table represents a specific system call entry with the following syntax:
<id> <abi_type> ...
Posted on Thu, 02 Jul 2026 17:24:51 +0000 by IcedEarth
Exposing USB Devices Across Networks Using the Linux usbip Stack
The Core of USB Redirection
USB redirection makes a physical device attached to one host accessible to another host over a network, as if it were locally connected. The goal is not to share files or relay a high-level protocol, but to forward USB bus-level requests and responses between two machines. On Linux, usbip is the reference implementat ...
Posted on Sun, 21 Jun 2026 16:36:32 +0000 by scifo
Keepalived High Availability Configuration and Testing
Virtual IP Configuration
virtual_ipaddress {
10.0.0.3/24 dev eth0 label eth0:1
}
track_script {
health_check
}
Failover Testing
[root@lb01 ~]# systemctl is-active nginx
active
[root@lb01 ~]# ip a | grep 0.3
inet 10.0.0.3/24 scope global secondary eth0:1
[root@lb01 ~]# systemctl stop nginx
[root@lb01 ~]# ip a | grep 0.3
# VIP migrated after ...
Posted on Sat, 16 May 2026 22:21:57 +0000 by BrianG
Implementing Mutex Synchronization in Linux Kernel Device Drivers
Overview
Mutexes (mutual exclusion locks) are synchronization primitives provided by the Linux kernel to hendle concurrent accesss to shared resources. Unlike semaphores which allow multiple concurrent access, a mutex ensures that only one thread can hold the lock at any given time.
This article demonstrates how to integrate mutex synchronizati ...
Posted on Sun, 10 May 2026 10:15:08 +0000 by uluru75