STRUCT DEVFREQ_GOVERNOR(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 struct devfreq_governor(9) 🌸

okay bestie, welcome to the Kernel API Manual page for struct devfreq_governor β€” yes it's a whole Devfreq policy governor, and yes it's lowkey iconic πŸ’…


✨ NAME ✨

struct devfreq_governor β€” Devfreq policy governor πŸŽ€


⭐ SYNOPSIS ⭐

here's the whole vibe, character for character, no cap:

struct devfreq_governor {
    struct list_head node;
    const char name[DEVFREQ_NAME_LEN];
    const u64 attrs;
    const u64 flags;
    int (*get_target_freq)(struct devfreq *this, unsigned long *freq);
    int (*event_handler)(struct devfreq *devfreq, unsigned int event,
void *data);
 };

like, look at her. she's giving struct. she's giving governor. she's giving DEVFREQ_NAME_LEN. πŸ¦‹


🫢 Members 🫢

  • node β€” the list node, bestie πŸŽ€ β€” it's the thing that holds all the registered devfreq governors together. the group chat of governors, if you will.
  • name β€” the governor's name ✨ literally just her name. her brand. her identity.
  • attrs β€” the governor's sysfs attribute flags πŸ’… the little settings that say what she's about in sysfs.
  • flags β€” the governor's feature flags ⭐ fun little feature bits, so she can flex what she can do.
  • get_target_freq β€” returns the desired operating frequency for the device πŸ”₯ okay so basically, get_target_freq will run devfreq_dev_profile.get_dev_status to get the status of the device β€” and that status is load = busy_time / total_time. math queen behavior fr fr πŸ˜­πŸ“Š
  • event_handler β€” the callback for the devfreq core framework to notify events to governors 🧚 the events include per device governor init and exit, opp changes out of devfreq, and suspend and resume of per device devfreq during device idle. she's the one who picks up the phone every time the core framework calls, periodt πŸ’–

🌈 Description 🌈

⚠️ okay important caveat bestie, do NOT skip this one: note that the callbacks are called with devfreq->lock locked by devfreq. πŸ”’ like, the lock is already held when they ring you up β€” respect the lock, don't go grabbing it again, iykyk πŸ’€

πŸ’œ SEE ALSO πŸ’œ

  • Kernel file ./include/linux/devfreq-governor.h πŸ‘‘

and that's the whole page, bestie!! πŸ“ this absolute baddie of a manpage came to you straight from ./include/linux (that's the source/version tag, look at her go), dated October 2026 β€” so go forth, register some governors, and slay πŸ’…βœ¨πŸŽ€πŸ«Ά

πŸ“¦ where this page comes from