STRUCT WAKEUP_SOURCE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct wakeup_source β€” Kernel API Manual, section 9 ✨

okay so bestie, welcome to the glow-up era of struct wakeup_source(9). this is the little struct that tells the kernel "hey, something is keeping me awake, pls don't sleep yet" and honestly? it's giving main character energy. let's get into it πŸ’…


πŸŽ€ NAME πŸŽ€

struct wakeup_source β€” the literal representation of wakeup sources, no cap ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

struct wakeup_source {
    const char              *name;
    int id;
    struct list_head        entry;
    spinlock_t lock;
    struct wake_irq         *wakeirq;
    struct timer_list       timer;
    unsigned long           timer_expires;
    ktime_t total_time;
    ktime_t max_time;
    ktime_t last_time;
    ktime_t start_prevent_time;
    ktime_t prevent_sleep_time;
    unsigned long           event_count;
    unsigned long           active_count;
    unsigned long           relax_count;
    unsigned long           expire_count;
    unsigned long           wakeup_count;
    struct device           *dev;
    bool active:1;
    bool autosleep_enabled:1;
 };

like, look at her. every field is exactly where it should be, not one character moved. iconic. πŸ‘‘


🌸 Members 🌸

time for the member-by-member vibe check, bestie. every single one, fr fr:

  • name β€” the name of the wakeup source 🏷️
  • id β€” the wakeup source id
  • entry β€” the wakeup source's list entry (she's linked in, she's on a list, she's social 🌈)
  • lock β€” the wakeup source lock πŸ”’
  • wakeirq β€” an optional, device-specific wakeirq
  • timer β€” the wakeup timer list ⏰
  • timer_expires β€” when the wakeup timer expires
  • total_time β€” the total amount of time this wakeup source has been active
  • max_time β€” the maximum amount of time this wakeup source has been continuously active (the longest unbroken stretch, bestie 😭)
  • last_time β€” the monotonic clock reading from the last time the wakeup source's was touched
  • prevent_sleep_time β€” the total amount of time this source has been preventing autosleep πŸ›‘
  • event_count β€” how many wakeup events have been signaled
  • active_count β€” how many times the wakeup source was activated
  • relax_count β€” how many times the wakeup source was deactivated (she's chilling, she's resting, she's relaxing πŸ’†)
  • expire_count β€” how many times the wakeup source's timeout has expired
  • wakeup_count β€” how many times the wakeup source might abort suspend 😳
  • dev β€” the struct device used for sysfs statistics about the wakeup source
  • active β€” the status of the wakeup source
  • autosleep_enabled β€” autosleep is active, so update prevent_sleep_time πŸŒ™

πŸ”₯ SEE ALSO πŸ”₯

the kernel file ./include/linux/pm_wakeup.h plus these two besties:


and that's the whole page, bestie, you ate that 🫢

ngl if you skipped the member list, go back up, there were nineteen of them and every single one matters πŸ’€

kiss kiss, this came from ./include/linux, dated October 2026, and it's filed under struct wakeup_source(9) β€” slay πŸ’–βœ¨

πŸ“¦ where this page comes from