STRUCT KSET(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct kset(9) β€” the Kernel API Manual, but make it make sense

okay so bestie, this is struct kset(9) β€” the manual page for ksets, straight out of the Kernel API Manual. grab a snack, we're learning kernel object groups πŸ“


✨ NAME ✨

struct kset β€” literally a set of kobjects of a specific type, all belonging to a specific subsystem. that's the whole vibe. a friend group, but for kernel objects 🫢


🌸 SYNOPSIS 🌸

struct kset {
    struct list_head list;
    spinlock_t list_lock;
    struct kobject kobj;
    const struct kset_uevent_ops *uevent_ops;
 };

no cap, that's the whole struct. now let's meet the members πŸ’–


πŸŽ€ Members πŸŽ€

  • list β€” the list of all kobjects for this kset. it's giving roster, it's giving guest list, it's giving everyone's here πŸ“‹
  • list_lock β€” a lock for iterating over the kobjects. protect your iteration, bestie, do not skip this πŸ’€
  • kobj β€” the embedded kobject for this kset. and yes, it's recursion, isn't it fun… πŸ™ˆ (the manual said it, not me)
  • uevent_ops β€” the set of uevent operations for this kset. these get called whenever a kobject has something happen to it, so that the kset can add new environment variables, or filter out the uevents if so desired. main character energy honestly, it gets a say in everything πŸ‘‘

🌈 Description 🌈

so a kset defines a group of kobjects. they can be individually different "types", but overall these kobjects all want to be grouped together and operated on in the same manner. like, different majors, same dorm, ykwim? 🏠

ksets are used to define the attribute callbacks and other common events that happen to a kobject. that's their whole job and they ate, no notes ✨


πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./include/linux/kobject.h β€” go read it, iykyk πŸ‘€

fr fr: every field above is load-bearing. don't go removing list_lock because it "looked optional." that's not a vibe check you wanna fail πŸ’…

and that's the page, bestie πŸ¦‹ this one's from ./include/linux, dated October 2026 β€” mwah, iconic, periodt 🌟

πŸ“¦ where this page comes from