STRUCT POWERCAP_CONTROL_TYPE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🫢 struct powercap_control_type β€” the powercap control_type, explained 🫢

okay so real talk, this is a page from the Kernel API Manual, and it's all about struct powercap_control_type. it's like a little container gremlin that holds your power zones together. ngl it's giving "quiet main character" energy β€” it does a lot but it's literally all private. let's get into it πŸ’…


✨ NAME ✨

struct powercap_control_type β€” the struct that defines a powercap control_type, periodt.


πŸ¦‹ SYNOPSIS πŸ¦‹

struct powercap_control_type {
    struct device dev;
    struct idr idr;
    int nr_zones;
    const struct powercap_control_type_ops *ops;
    struct mutex lock;
    bool allocated;
    struct list_head node;
 };

πŸŽ€ Members πŸŽ€

okay bestie, here's the field-by-field vibe check πŸ‘‘

  • dev β€” the device for this control_type. that's its whole thing πŸ’–
  • idr β€” the idr that hands out a unique id to each of its children. one id per kid, no duplicates, slay πŸ”₯
  • nr_zones β€” a counter for how many zones this type has. it's literally keeping count πŸ“Š
  • ops β€” a pointer to the callback struct. the plug-in point for behavior ✨
  • lock β€” the mutex for the control type. mutual exclusion, we love a protective queen πŸ”’
  • allocated β€” okay so this one's a whole situation: it's possible that the client owns the memory used by this structure. in that case, the framework sets this flag to false to prevent deallocation during the release process. otherwise this flag is set to true. so like, false = hands off, the client's got the memory; true = framework's memory, framework's problem 🫢
  • node β€” the linked-list node. it's on a list, living its list life 🌸

πŸ’œ Description πŸ’œ

so this struct defines a powercap control_type β€” it acts as a container for power zones that all use the same method to control power. examples being RAPL, RAPL-PCI, etc. 🧚

⚠️ heads up bestie: all fields are private and should not be used by client drivers. like, hands off the merch. the framework handles it, you don't πŸ™ˆ

🌈 SEE ALSO 🌈


and that's the whole page, bestie β€” you ate that πŸ’…βœ¨

πŸ“ cute little sign-off: this one lives at ./include/linux, dated October 2026, and it's brought to you by struct power...control_type(9) β€” yes that's literally the abbreviated name, truncated and iconic. iykyk πŸ’–
πŸ“¦ where this page comes from