STRUCT KMOD_TEST_DEVICE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct kmod_test_device(9) β€” a Kernel API Manual moment

okay bestie, so this is a page from the Kernel API Manual, and it's all about struct kmod_test_device β€” literally the test device that helps you test kmod. that's the whole vibe. it's a struct, it's got members, and every single one of them is here. no cap. 🧚


✨ NAME ✨

struct kmod_test_device β€” the test device that exists to help test kmod. iconic behavior, honestly. πŸŽ€


🌸 SYNOPSIS 🌸

struct kmod_test_device {
    int dev_idx;
    struct test_config config;
    struct miscdevice misc_dev;
    struct device *dev;
    struct mutex config_mutex;
    struct mutex trigger_mutex;
    struct mutex thread_mutex;
    unsigned int done;
    bool test_is_oom;
    struct completion kthreads_done;
    struct list_head list;
    struct kmod_test_device_info *info;
 };

like, that's the whole thing. every field accounted for, periodt. πŸ’–


πŸ¦‹ Members πŸ¦‹

okay so let's go member by member because every single one of these matters and we are NOT skipping any πŸ’…

  • dev_idx β€” the unique ID for the test device. it's how you tell your test devices apart, iykyk.
  • config β€” the configuration for the test. obviously. 😌
  • misc_dev β€” plot twist: we use a misc device under the hood. main character energy from a side character.
  • dev β€” pointer to misc_dev's own struct device. it's giving "my own device's device."
  • config_mutex β€” protects configuration of test. do not touch the config without it, fr fr.
  • trigger_mutex β€” because the test trigger can only be fired once at a time. one trigger. no queue-jumping. πŸ”₯
  • thread_mutex β€” protects the done count, and the info per each thread. she's a busy little lock.
  • done β€” number of threads which have completed or failed. both count! slay. ✨
  • test_is_oom β€” when we run out of memory, use this to halt moving forward. like, the moment memory runs out, this is the flag that says "nope, stopping here." πŸ’€
  • kthreads_done β€” completion used to signal when all work is done. the group-chat "we're all done here" notification 🫢
  • list β€” needed to be part of the reg_test_devs. gotta be on the list to be on the list.
  • info β€” array of info for each thread. one entry per thread, no favorites. 🌈

πŸ‘‘ SEE ALSO πŸ‘‘

  • Kernel file ./lib/test_kmod.c
  • enum kmod_test_case(9)
  • struct kmod_test_device_info(9)

go read those next, bestie. it's giving a whole lore arc. πŸ“š


side note bestie: this struct is straight from the docs under ./lib, so that's where the source lives. no guessing, no extra tips β€” just the facts as printed.

okay and finally, the cute sign-off πŸ’œ: this page lives in ./lib and it's dated October 2026, and the whole header situation is struct kmod_test_device(9) from the Kernel API Manual. mwah. πŸ’‹πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from