Linux · Kernel · Systems
From the metal up.
These are my notes written down as I work through them, for my own learning and as a hobby
- ModelsAttention, the KV cache, why decode is memory-bound→
- CUDAThreads, warps, PTX, SASS→
- GPU siliconSMs, register files, HBM, bank conflicts→
- eBPFWhere Linux finally sees into the GPU→
- Kernel pathsconnect(), page faults, the scheduler, the verifier→
- Userland and initA libc, one binary, a small PID 1→
- The kernel buildConfigured up from allnoconfig→
- Toolchain and bootA cross-compiler, then firmware to first prompt→
Build
Linux, Observed
Build a Linux system from source, then watch every piece run.
All 13 chapters →- Why build what you could downloadSet up your build host, write your manifest, and take the first trace: what your distro's
lsactually does. - PID 1Write an init in C, boot it, make a zombie on purpose, and find out exactly what the kernel will and won't let happen to process 1.
- The kernel, from allnoconfigConfigure a kernel upward from nothing, check that every option survived, boot it, and read its initcall timeline.
- Namespaces and cgroupsBuild a container from kernel objects with unshare, pivot_root and cgroup2, then hit its limits on purpose.
Read
Kernel, Traced
Twelve paths through the source. Read them, trace them, change them.
All 14 chapters →- A page faultFrom the CPU's #PF exception to a mapped page: the fault handler, the VMA lookup, the three kinds of fault, and a patch that makes copy-on-write visible.
- connect(): where the SYN is bornFrom the connect() system call to the first segment on the wire: every function on the path, the places policy can speak, and a BPF program that moves the destination before the route exists.
- The scheduler picks the next taskschedule(), the runqueue, EEVDF as completed in 6.12, the context switch, sched_ext, and a prediction you can check.
- bpf(): the verifierHow a BPF program goes from bytes to running kernel code: the load, the verifier's symbolic execution, the helper checks, the JIT, and a program you fix one line at a time.
Scale
System Design
From one web request to consensus, overload and full designs.
All 19 chapters →- What happens in a single requestBefore scaling anything: the path of one web request through DNS, TCP, TLS, HTTP, an application and a database.
- CachingWhy caches work, write patterns, eviction, invalidation, stampedes, leases and the failure modes that come with a cache.
- Clocks, consensus and distributed locksWhy time can't be trusted, Lamport and vector clocks, failure detection, Raft, leases, and why distributed locks need fencing tokens.
- Resilience: timeouts, retries, circuit breakers and overloadHow systems fail in chains, and the defences: timeouts, retries with jitter, circuit breakers, bulkheads, load shedding, adaptive throttling and metastable failures.
Understand
Inside the GPU
CUDA from the silicon up, and why LLMs are shaped by it.
All 7 chapters →- Inside the siliconRead a real GPU's inventory, follow its memory hierarchy, and provoke a bank conflict you can measure.
- The CUDA execution modelThreads, blocks and grids, what a warp really does at an if statement, and a lab that measures the cost of divergence.
- Where eBPF meets CUDALinux can barely see a GPU. Attach eBPF to the CUDA runtime and driver, decode a kernel launch, and read what the research tools do.
- Why LLMs need all of thisWork out the ratio behind LLM inference by hand, see why batching changes everything, and test it on a real model.
Guide
Linux From the Metal Up
Boot, memory, scheduling, filesystems and building your own OS.
Guide
Big-O complexity
What O(n) means, with measured timings, and how to approach it in real code.
Guide
Threads, concurrency and parallelism
From processes to memory ordering, false sharing and async.
Guide
Semaphore vs mutex vs lock
Ownership, signalling, how they are built, and how to choose.
Guide
How Kafka works
From a simple log to replication, transactions and KRaft.
Guide
Redis internals
The protocol, the event loop, and why one thread is fast.
Guide
RDMA, RoCE and NVIDIA networking
Verbs, lossless Ethernet, DCQCN, GPUDirect and Spectrum-X.
Guide
The Kubernetes control plane
The API server, etcd, controllers, Cilium, Flannel and OPA Gatekeeper.
Guide
JWTs, tokens, OAuth and Zero Trust
How tokens are built and broken, every OAuth flow, sessions, and Zero Trust.
Guide
PostgreSQL indexes
Every index type, when to use which, and their limits.
Guide
How TLS works
The handshake, key schedule and when traffic can be decrypted.
Essay
Rust vs Go vs C++
Which language fits which kind of systems work.