2026-04-01 | linux · containers | #namespace #clone #container #pid #uts #mount #ipc #linux-kernel #isolation
容器不是魔法。它就是几个系统调用。本文用 C 从 clone() 开始,逐个开启 PID/UTS/Mount/IPC namespace,看隔离到底是怎么回事。50 行代码,你就拥有了一个'容器'的雏形。
2026-04-01 | linux · containers | #namespace #network #veth #bridge #iptables #nat #netns #docker0 #clone #container #linux-kernel
上一篇我们用 clone() 隔离了 PID、主机名和挂载点,但那个'容器'连 lo 都 ping 不通。本文从 CLONE_NEWNET 出发,用 veth pair + bridge + iptables MASQUERADE,一步步给容器接上网。
2026-04-02 | linux · containers | #pivot_root #chroot #mount-namespace #rootfs #alpine #mount-propagation #container #linux-kernel #filesystem #security
chroot 不是安全边界——10 行 C 就能逃出去。本文用 pivot_root 构建真正隔离的容器根文件系统:从 Alpine minirootfs 到设备节点,从 mount propagation 到只读根,一步步把容器的'地基'打牢。
2026-04-03 | linux · containers | #cgroups #cgroupv2 #cpu #memory #oom #io #container #resource-limits #linux-kernel #cfs
你给容器设了 512MB 内存限制,结果宿主机上的数据库被 OOM-kill 了。Cgroups 不是'加个限制'那么简单 — v1 的设计是个历史错误,v2 才是正确答案。本文用 C 代码从 mkdir 开始,手动创建 cgroup,设 CPU/内存/IO 限制,压测,看它怎么把进程关进笼子。
2026-04-05 | linux · containers | #overlayfs #copy-on-write #filesystem #container-image #docker #storage-driver #union-mount
Docker 镜像为什么能分层?pull 一个 100MB 的镜像为什么只下载 3MB?答案是 OverlayFS 的 copy-on-write。本文手工构建分层镜像,实测 COW 的性能代价。
2026-04-06 | linux · containers · go | #container-runtime #go #namespace #cgroup #overlayfs #clone #pivot-root #reexec
五篇文章攒了一堆内核积木:namespace、netns、rootfs、cgroup、overlayfs。现在是时候用 Go 把它们拼成一个能跑的容器运行时了。不到 500 行代码,create/start/exec/kill/delete,五个命令走完容器的一生。
2026-04-07 | linux · containers · go | #oci #runtime-spec #containerd #ctr #container-runtime #config-json #hooks
我们的迷你容器运行时能跑了,但没人能用它——因为 containerd、Kubernetes 不认识它。OCI Runtime Spec 就是容器世界的通用语言。本文拆解规范的每个关键字段,把迷你运行时改造成 containerd 能调用的标准运行时。
2026-04-08 | linux · containers · security | #seccomp #bpf #capabilities #security #container #syscall #linux-kernel #cap_sys_admin #docker #defense-in-depth
你的容器能调用 reboot()。是的,现在就能。除非有人拦住它。Capabilities 拆分 root 权限,Seccomp-BPF 过滤系统调用——两道防线,缺一不可。本文用 C 代码拆解这两套机制,看看 Docker 到底替你挡住了什么。
2026-04-09 | linux · containers · security | #user-namespace #rootless #podman #uid-mapping #newuidmap #slirp4netns #container-security
容器运行时需要 root 权限?不一定。User namespace 让普通用户也能创建容器——容器内是 root,容器外是你自己。Podman 就是这么干的。但 rootless 不是免费午餐,限制比你想象的多。
2026-04-10 | linux · containers · virtualization | #firecracker #kvm #microvm #virtio #container-vs-vm #isolation #security-boundary #aws-lambda
容器用 namespace 隔离,microVM 用硬件虚拟化。AWS Lambda 背后的 Firecracker 去掉了 BIOS、ACPI、PCI,只用 virtio-mmio,125ms 启动一个 VM。两种隔离模型到底差在哪?安全性差多少?开销差多少?
2026-04-11 | linux · containers · networking | #veth #macvlan #ipvlan #ebpf #cilium #iptables #container-networking #cni #benchmark #xdp
容器网络为什么比裸机慢?veth + bridge 每个包经过两次 netfilter,macvlan 跳过了 bridge,Cilium 用 eBPF 替掉了 iptables。到底慢多少?我们用 iperf3、wrk 和自定义 echo server 实测。
2026-04-12 | linux · containers · go | #runc #libcontainer #oci #container-runtime #nsenter #source-code #go-fork #exec-fifo
我们的迷你运行时有 500 行,runc 有 15000 行。多出来的代码在干什么?本文拆解 runc 的核心流程:从 runc create 到容器 init 进程,libcontainer 的设计,nsenter 里那段神秘的 C 代码,以及 Go runtime fork 的天坑。
2025-11-30 | linux · io_uring · high-performance | #linux #io_uring #async-io #kernel
深入解析 Linux io_uring 的核心机制:提交队列 (SQ)、完成队列 (CQ) 与零拷贝技术,理解它如何重塑高性能网络编程。
2025-11-30 | linux · io_uring · performance | #linux #io_uring #epoll #benchmark
全方位对比 io_uring 与 epoll:从系统调用开销、内存管理到编程模型,分析 io_uring 在高性能 I/O 场景中的优势与局限。
2025-11-30 | linux · io_uring · tutorial | #linux #io_uring #liburing #c
手把手教你使用 liburing 编写第一个 io_uring 程序。详解 io_uring_queue_init, io_uring_submit 等核心 API 的使用流程。
2025-11-30 | linux · io_uring · network · tutorial | #linux #io_uring #tcp #c
深入网络编程,实现一个异步 TCP 服务器。学习如何使用 user_data 管理连接上下文,处理 Accept, Read, Write 链式调用。
2025-11-30 | linux · io_uring · performance · advanced | #linux #io_uring #sqpoll #zero-copy
深入探讨 io_uring 的进阶功能:SQPOLL (零系统调用)、Fixed Files (减少引用计数开销) 和 Provided Buffers (自动缓冲区管理)。
2025-11-30 | libevent · io_uring · linux | #libevent #io_uring #backend
探索 Libevent 2.2+ 版本中新增的 io_uring backend。如何开启、性能表现以及当前的局限性。
2025-11-30 | linux · io_uring · epoll · performance | #linux #io_uring #epoll #benchmark #tradeoff
并非所有场景都适合 io_uring。深入分析快路径延迟、内存隐性成本、生态复杂度等因素,帮助你做出理性的技术选型。
2025-11-30 | linux · io_uring · golang | #linux #io_uring #golang #cgo #liburing #high-performance
系统梳理 Go 集成 io_uring 的关键问题:何时值得做、CGO 与纯 Go 如何取舍、runtime.Pinner、固定缓冲区与 SQPOLL 的工程实践。
2026-03-14 | linux · io_uring · epoll · debugging | #linux #io_uring #epoll #debugging #bpftrace #perf #gdb #rr #sanitizer #observability #opentelemetry #profiling
一份面向线上事故的事件驱动代码排障手册:从症状收敛、strace/eBPF/perf 逐层下钻,到 OpenTelemetry 集成与 Sanitizer 离线复盘。
2026-03-14 | linux · io_uring · high-performance | #linux #io_uring #multithreading #pthread #SO_REUSEPORT #NUMA #thread-safety #lock-free
系统梳理 io_uring 的线程安全模型与四种主流多线程架构模式(Thread-per-Ring、Shared Ring、Submit/Reap 分离、SQPOLL),包含完整的多线程 Echo Server 实战、NUMA 优化、性能对比与生产避坑指南。
2026-04-03 | linux · networking | #linux-kernel #network-stack #sk_buff #NAPI #netfilter #bpftrace #softirq #RPS #XPS #irqbalance #perf
从 NIC 驱动到用户态 read(),一个网络包在 Linux 内核中到底经历了什么?本文拆解 sk_buff、NAPI、softirq、netfilter 的完整收包路径,并用 bpftrace 实测追踪每一跳的延迟。
2026-04-03 | linux · networking | #veth #bridge #tun #tap #macvlan #ipvlan #network-namespace #virtual-network
五种 Linux 虚拟网络设备的内核实现原理、数据流路径、性能代价与适用场景,附手工实验验证。
2026-04-03 | linux · networking | #netfilter #iptables #nftables #conntrack #SNAT #DNAT #firewall #linux-kernel
Netfilter 五个 hook 点、四表五链的真实遍历顺序、conntrack 状态机与性能开销、SNAT/DNAT/MASQUERADE 辨析,再到 nftables 替代方案和 eBPF 数据面——从内核视角拆解 Linux 防火墙。
2026-04-03 | linux · networking | #routing #vxlan #geneve #tunnel #FIB #ECMP #wireguard #overlay-network
Linux 路由表、FIB 查找、策略路由,以及 VXLAN/Geneve/WireGuard 隧道技术深度拆解
2026-04-03 | linux · networking | #BGP #routing #Calico #BIRD #route-reflector #EVPN #FRRouting #containerlab
从 AS 和路径属性到 Route Reflector,理解 Calico 底层依赖的 BGP 协议
2026-04-03 | linux · networking | #eBPF #XDP #TC #bpf_redirect #kube-proxy #programmable-dataplane #BPF-map
eBPF 在网络栈中的五大挂载点,bpf_redirect 三兄弟,以及动手写一个 TC BPF 包过滤器
2026-04-03 | linux · networking | #eBPF #XDP #struct_ops #AF_XDP #SmartNIC #P4 #TCP-CC #BPF-arena
从 2014 年 socket filter 到可编程拥塞控制和 SmartNIC offload,eBPF 网络能力的完整演化史
2025-01-22 | linux | #ebpf #xdp #kprobe #tracepoint #linux-kernel #networking #observability
eBPF 让你在内核里插代码而不用写内核模块。听起来很美,但验证器的限制、Map 的性能陷阱、BTF 的兼容性噩梦,这些他们不会在教程里告诉你。
2026-04-10 | linux | #ebpf #bpftrace #kprobe #uprobe #tracepoint #off-cpu #latency #observability #performance
你的 P99 延迟突然飙到 500ms,但平均值只有 3ms。日志里什么都没有,Prometheus 图表一片祥和。bpftrace 一行命令,30 秒定位问题。这篇文章告诉你怎么做到的。
2026-06-25 | linux | #cilium #ebpf #kubernetes #iptables #kube-proxy #service-mesh #networking #xdp #container
5000 个 Service、十万条 iptables 规则、一次更新锁五秒——这就是 kube-proxy 的现实。Cilium 用 eBPF Map 的 O(1) 查找干掉了整条 KUBE-SERVICES 链,顺便把 sidecar 也一起埋了。
2025-02-07 | linux | #ebpf #io_uring #xdp #af_xdp #networking #high-performance #kernel-bypass
eBPF 在内核里做决策,io_uring 在内核里做 I/O。当这两个东西连起来,你的数据包从网卡到应用可以完全不经过传统协议栈。
2027-02-10 | linux · ebpf · profiling | #ebpf #profiling #perf #bpftrace #bcc #parca #flame-graph #off-cpu
你有火焰图,但它只能告诉你 CPU 在忙什么——CPU 不忙的时候呢?从 perf 到 Parca,Linux 性能分析工具链走过了 15 年,是时候搞清楚每个工具的真正定位了。
2026-05-10 | linux · security · ebpf | #ebpf #lsm #seccomp #falco #tetragon #syscall #security #container-security #runtime-security #linux-kernel
Seccomp 只能说 yes or no,但攻击者早就学会了在 yes 里面做文章。是时候让 eBPF 接管安全审计了。
2026-04-25 | linux · networking · ebpf | #xdp #ebpf #dpdk #ddos #firewall #smartnic #network-performance #linux-kernel
当 DDoS 洪水来袭,iptables 在协议栈里挣扎,而 XDP 在网卡驱动层就把垃圾包丢了。不进协议栈、不分配 skb、不走 netfilter——这才是丢包该有的样子。
2026-04-01 | containers · linux · kernel | #containers #index #series
用 C 和 Go 从零实现一个 OCI 兼容的迷你容器运行时,逐篇拆解 Linux 内核的隔离机制。不是讲 Docker 怎么用,而是理解容器到底是什么。
2025-11-30 | io_uring · linux · kernel | #io_uring #index #series
探索 Linux 下一代高性能异步 I/O 接口 io_uring,从核心原理到性能对比,再到与现有网络库的集成。
2026-04-03 | linux | #linux #kernel #concurrency #memory-ordering #C-macros
Linux 内核 ACCESS_ONCE/READ_ONCE/WRITE_ONCE 宏详解:并发编程与内存访问
2027-03-25 | linux | #ebpf #index #series
从 eBPF 基础到 XDP 防火墙、安全监控、容器网络、性能分析——eBPF 在现代 Linux 的完整应用图谱。
2026-04-03 | linux | #linux #file-io #system-calls #kernel #file-system
Linux 文件 I/O 深度解析:内核文件表、系统调用与文件描述符管理
2027-02-25 | linux · io_uring · high-performance | #io_uring #linux-kernel #sqpoll #production #debugging #kernel-bug #memory-leak
SQPOLL 烧 CPU、fixed buffer 内存泄漏、CQE overflow 丢事件、内核版本兼容性噩梦——io_uring 在生产中踩过的坑,逐个拆解。
2025-01-26 | linux | #lockfree #hashmap #cas #memory-ordering #hazard-pointer #aba-problem #concurrency
正确的无锁数据结构可以写出来。但代价比你想象的大。CAS 循环、ABA 问题、内存回收、x86 和 ARM 的行为差异——这篇从一行 compare_exchange 开始,到一个完整的无锁哈希表结束。
2026-03-31 | linux | #lock-free #concurrency #memory-ordering #cas #atomic #benchmark #cpp #rust
拆解 GitHub 高星'无锁'库的真实面目:隐藏的 mutex、被滥用的 memory_order_relaxed、以及 CAS 重试循环的阻塞本质。附 x86 vs ARM 上的行为差异实测。
2026-03-31 | linux | #memory-barrier #smp_wmb #arm #x86 #tso #kernel #concurrency #debugging
一个在 x86 上跑了两年的内核模块,迁移到 ARM 后开始随机丢数据。三天的调试过程教会了我 smp_wmb() 的真正含义。附 Linux 内核屏障 API 完整分类与 x86/ARM 编译产物对比。
2026-04-03 | linux | #linux #sysadmin #performance-tuning #tcp
Linux 高并发服务器内核参数调优:文件描述符、TCP 网络栈与 core dump 配置
2026-04-03 | linux | #linux #scheduler #process-scheduling #kernel #performance
Linux 进程调度详解:调度类、优先级与实时任务调度机制
2026-04-03 | linux | #linux #process #task-state #kernel #system-programming
Linux 进程状态详解:运行、睡眠、僵尸等 7 种进程状态分析
2026-03-22 | linux · performance · high-performance · network-programming | #zero-copy #sendfile #splice #io_uring #cache #benchmark #linux
sendfile/splice/io_uring 的 zero-copy 路径深度解析与实测。揭示小数据包场景下传统 copy 因 cache locality 反而更快的反直觉真相。
2025-02-01 | linux | #memory-allocator #jemalloc #tcmalloc #mimalloc #glibc #malloc #fragmentation #benchmark
分配器的 micro-benchmark 全是骗人的。真正的差距在碎片率和尾延迟。我们把四个分配器塞进一个真实的 HTTP 服务器,跑 24 小时,看谁先崩。
2025-10-30 | linux | #linux #daemon #process #background-service #system-programming
Linux Daemon 进程创建指南:后台服务开发规范与最佳实践
2025-10-30 | linux | #linux #memory-management #virtual-memory #process #memory-layout
程序内存布局详解:虚拟内存、栈、堆、代码段、数据段的组织结构