[ SRE_ARENA ]
Roadmap
System Design
SREdle
⚡ 1420 ELO
OP
☰
←
BACK TO ROADMAP
LINUX KERNEL & SYSCALLS
The Kernel is the Bouncer. You are the Guest.
Visualization: 1. User Space vs. Kernel Space
User App
Python / Node
libc wrapper
Standard C Lib
Syscall Interface
Ring 0 Switch
VFS
Virtual File Sys
Net Stack
TCP/IP Drivers
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.
1. User Space vs. Kernel Space
2. Context Switching (The Cost of Multitasking)
3. Hardware Interrupts & SoftIRQs (The NIC Flow)
4. strace — The Syscall X-Ray Vision
5. File Descriptors (Everything is a File)
6. cgroups (Control Groups)
7. namespaces
DOWNLOADING CONCEPT: 1. USER SPACE VS. KERNEL SPACE...
↳
Modern CPUs have protection rings.
↳
Ring 3
(User Space) is heavily restricted.
↳
This is where your applications run.
↳
Ring 0
(Kernel Space) has absolute, unrestricted access to the CPU, RAM, and hardware.
↳
Your Python app cannot physically talk to a hard drive or a network card.
↳
If it wants to read a file, it must politely ask the Kernel to do the work on its behalf.
↳
The bridge between the restricted User Space and the omnipotent Kernel Space is the
System Call (Syscall)
.
↳
This barrier protects the system.
↳
If your app crashes in User Space, the app dies.
↳
If the Kernel crashes in Kernel Space, the entire server Kernel Panics and dies.
▲ LIVE INCIDENT
App is unresponsive. CPU is at 0%.
sre@arena:~/advanced-kernel
sre@arena
:
~
$
strace -c -p 1234
▶ EXECUTE COMMAND