MODULE DEBUGGING STATISTICS OVERVIEW(9)
πΈ NAME πΈ
module debugging statistics overview
okay so bestie, this is the module debug...ics overview(9) page from the Kernel API Manual. it's giving kernel module stats realness, and we're gonna get into it π
β¨ DESCRIPTION β¨
Enabling CONFIG_MODULE_STATS unlocks module debugging statistics. These are genuinely useful for monitoring and root-causing memory pressure issues with module loading, and they help us improve production workloads. no cap.
The current module debugging statistics supported help keep track of module loading failures, so we can make improvements either for kernel module auto-loading usage (request_module) or interactions with userspace. Statistics are provided to track all possible failures in the finit_module path and memory wasted in this process space. Each of the failure counters is associated with a type of module loading failure that's known to incur a certain amount of memory allocation loss. In the worst case, loading a module will fail after a 3 step memory allocation process:
- a) memory allocated with
kernel_read_file_from_fd - b) module decompression processes the file read from
kernel_read_file_from_fd, andvmapis used to map the decompressed module to a new local buffer which represents a copy of the decompressed module passed from userspace. The buffer fromkernel_read_file_from_fdis freed right away. - c)
layout_and_allocateallocates space for the final resting place where we would keep the module if it were to be processed successfully.
If a failure occurs after these three different allocations, only one counter will be incremented with the summation of the allocated bytes freed incurred during this failure. Likewise, if module loading failed only after step b), a separate counter is used and incremented for the bytes freed and not used during both of those allocations. periodt.
Virtual memory space can be limited β for example, on x86 virtual memory size defaults to 128 MiB. We should strive to limit and avoid wasting virtual memory allocations when possible. These module debugging statistics help to evaluate how much memory is being wasted on bootup due to module loading failures. lowkey important π«Ά.
All counters are designed to be incremental. Atomic counters are used so to remain simple and avoid delays and deadlocks. iconic.
π SEE ALSO π
- Kernel file
./kernel/module/stats.cdup_failed_modules- tracks duplicate failed modules(9), module statistics debugfs counters(9)
byeee bestie π β source/version: ./kernel/module, date: October 2026, and this was the module debug...ics overview(9) page. catch u later β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms