lsds: A One-Stop Shop for Linux Block Device Settings

2025-05-09

Managing disks and I/O on Linux often involves running multiple commands like lsblk, lsscsi, and nvme list, then manually correlating their output. To streamline this, a Python program called `lsds` was created. It directly reads information from the `/sys/class/blocks/...` directories, consolidating key disk details into a single, easy-to-read output. This includes device name, size, type, scheduler, rotational flag, model, queue depth, number of requests, and write cache settings. `lsds` is highly customizable, allowing users to specify which columns to display and providing a verbose mode for tracing information sources. This tool significantly simplifies the complexity of managing Linux disks.

Read more

11M IOPS & 66 GiB/s IO on a Single ThreadRipper Workstation: A Deep Dive

2025-05-06

This article details the configuration of an AMD ThreadRipper Pro workstation with 10 PCIe 4.0 SSDs to achieve 11M IOPS for 4kB random reads and 66 GiB/s throughput for larger IOs. The author tackles bottlenecks like RAM access and CPU limitations, delving into Linux block I/O internals and their interaction with modern hardware. The process includes hardware selection, I/O configuration (direct I/O and I/O schedulers), multi-disk testing, and BIOS settings, ultimately achieving remarkable performance.

Read more
Hardware

eBPF Pitfall: The FRED in Linux Kernel 6.9+

2025-03-01

The Linux kernel 6.9+ introduces CONFIG_X86_FRED on x86_64, adding 16 bytes of padding to the bottom of a task's kernel stack. This breaks eBPF programs directly accessing the kernel stack and pt_regs, returning garbage. The author encountered this issue with their xcapture-next eBPF tool after upgrading to kernel 6.11. Analysis revealed FRED's stack offset as the culprit. A dynamic FRED detection mechanism is presented to adjust stack address calculations, resolving the problem. This article is crucial for eBPF developers, especially those working with raw kernel stack manipulation.

Read more
Development

TracepointArgs: Unlocking Linux Kernel Tracepoints

2025-02-04

Tired of hunting through Linux kernel source code for tracepoint metadata and struct layouts? Meet tracepointargs, a new command-line tool that lists all available Linux kernel tracepoints, their arguments, datatypes, and related structs. It even parses kernel struct layouts, allowing you to understand tracepoint details without digging through source files. Combined with bpftool to generate a vmlinux.h file, you can easily inspect the internals of structures, even recursively expanding nested ones. A must-have for eBPF developers and kernel explorers!

Read more
Development