DUP_FAILED_MODULES - TRACKS DUPLICATE FAILED MODULES(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME

dup_failed_modules β€” tracks duplicate failed modules, bestie. It's a Kernel API Manual page, section (9), so buckle up πŸŽ€


✨ DESCRIPTION ✨

Okay so picture this: a linked list of modules that failed to load, and the reason they failed is lowkey iconic β€” there was already an existing module with the same name that was either still being processed or already loaded. Like, the audacity πŸ’€

Now here's the tea: the finit_module system call incurs heavy virtual memory allocations. And in the worst case, a finit_module system call can end up allocating virtual memory 3 times:

  1. kernel_read_file_from_fd call uses vmalloc
  2. optional module decompression uses vmap
  3. layout_and allocate can use vzalloc or an arch specific variation of vmalloc to deal with ELF sections requiring special permissions

In practice on a typical boot today, most finit_module calls fail due to the module with the same name already being loaded or about to be processed. And all that virtual memory allocated to these failed modules? Just freed with no functional use. Poof. Gone. Wasted. 😭 No cap.

To help with this, dup_failed_modules allows us to track modules which failed to load due to the fact that a module was already loaded or being processed. And here's the thing β€” there are only two points at which we can fail such calls. We list them below along with the number of virtual memory allocation calls:

  • a) FAIL_DUP_MOD_BECOMING β€” at the end of early_mod_check before layout_and_allocate.
    • with module decompression: 2 virtual memory allocation calls
    • without module decompression: 1 virtual memory allocation calls
  • b) FAIL_DUP_MOD_LOAD β€” after layout_and_allocate on add_unformed_module.
    • with module decompression 3 virtual memory allocation calls
    • without module decompression 2 virtual memory allocation calls

We should strive to get this list to be as small as possible, fr fr. If this list is not empty it is a reflection of possible work or optimizations possible either in-kernel or in userspace. Basically a to-do list the kernel is serving us and honestly? Obsessed with the honesty πŸ”₯


🌈 SEE ALSO

  • Kernel file ./kernel/module/stats.c module debugging statistics overview(9), module statistics debugfs counters(9)

🫢 And that's the whole vibe. This little masterpiece lives in ./kernel/module and it's stamped October 2026 β€” save the date, bestie πŸ’–βœ¨

πŸ“¦ where this page comes from