Understanding the Linux Kernel 读书笔记 -Timing Measurements

We can distinguish two main kinds of timing measurement that must be performed by the Linux kernel:

  • Keeping the current time and date so they can be returned to user programs through the time(), ftime(), and gettimeofday() APIs and used by the kernel itself as timestamps for files and network packets
  • Maintaining timers—mechanisms that are able to notify the kernel or a user program that a certain interval of time has elapsed

Understanding the Linux Kernel 读书笔记 -Kernel Synchronization

You could think of the kernel as a server that answers requests; these requests can come either from a process running on a CPU or an external device issuing an interrupt request. We make this analogy to underscore that parts of the kernel are not run serially, but in an interleaved way. Thus, they can give rise to race conditions, which must be controlled through proper synchronization techniques.

深入理解 Linux 的 RCU 机制

1 Introduction

Read-copy update (RCU) is a synchronization mechanism. RCU achieves scalability improvements by allowing reads to occur concurrently with updates. In contrast with conventional locking primitives that ensure mutual exclusion among concurrent threads regardless of whether they be readers or updaters, or with reader-writer locks that allow concurrent reads but not in the presence of updates, RCU supports concurrency between a single updater and multiple readers.

Fix-Mapped Linear Addresses






  • 内核页表:即书上说的主内核页表,在内核中其实就是一段内存,存放在主内核页全局目录init_mm.pgd(swapper_pg_dir)中,硬件并不直接使用。

  • 进程页表:每个进程自己的页表,放在进程自身的页目录task_struct.pgd中。

Understanding the Linux Kernel 读书笔记 -Process

Processes, Lightweight Processes, and Threads

A process is an instance of a program in execution. You might think of it as the collection of data structures that fully describes how far the execution of the program has progressed. The purpose of a process is to act as an entity to which system resources (CPU time, memory, etc.) are allocated.



1.1 段选择符和段寄存器