STRUCT TMIGR_CPU(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct tmigr_cpu(9) ✨

okay so bestie, buckle up πŸ’– this is a page from the Kernel API Manual β€” yes, that Kernel API Manual β€” and it's all about struct tmigr_cpu, which is the timer migration per-CPU group situation. it's giving very niche, very kernel, very "iykyk" energy 🧚 and honestly? we're obsessed.


🌸 NAME 🌸

struct tmigr_cpu β€” timer migration per CPU group. that's it, that's the whole vibe πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

here's the whole struct, laid out exactly, no cap:

struct tmigr_cpu {
    raw_spinlock_t lock;
    bool available;
    bool idle;
    bool remote;
    struct tmigr_group      *tmgroup;
    u8 groupmask;
    u64 wakeup;
    struct tmigr_event      cpuevt;
 };

πŸ‘‘ Members πŸ‘‘

okay now the member-by-member deep dive, and yes we're going through all of them, because every single field is a main character here 🫢

  • lock β€” this bad boy is the lock protecting the tmigr_cpu group information. it's a raw_spinlock_t, so like, respect it πŸ”₯
  • available β€” tells you whether the CPU is available for handling global timers. and bestie, this one does work:
    • in the deactivate path, you need it to know whether the migrator in the top level group is to be set offline, while a timer is pending. and when that happens? another available CPU needs to be notified to take over the migrator role. handoff time πŸŽ€
    • plus, the information is required in the CPU hotplug path, because the CPU is able to go idle before the timer migration hierarchy hotplug callback is reached. during this phase, the CPU has to handle the global timers on its own and must not act as a migrator. so like... it's doing its own thing, solo, no migrator hat allowed πŸ™ˆ
  • idle β€” indicates whether the CPU is idle in the timer migration hierarchy. simple, clean, iconic ✨
  • remote β€” gets set when the timers of the CPU are expired remotely. remote expiry, very 2026 of it πŸ’œ
  • tmgroup β€” pointer to the parent group. it's a struct tmigr_group *, and it points at its parent, familial vibes fr fr 🌸
  • groupmask β€” mask of tmigr_cpu in the parent group. it's a u8, tiny but mighty πŸ¦‹
  • wakeup β€” stores the first timer when the timer migration hierarchy is completely idle and remote expiry was done. it's returned to the timer code in the idle path, and it's only used in the idle path. very exclusive, very VIP, love that for it πŸ‘‘
  • cpuevt β€” the CPU event, which could be enqueued into the parent group. a struct tmigr_event, ready to make moves whenever 🌈

πŸ”₯ SEE ALSO πŸ”₯

go read these next, bestie, they're all in the kernel file ./kernel/time/timer_migration.h:

  • struct tmigr_hierarchy(9)
  • struct tmigr_event(9)
  • struct tmigr_group(9)
  • union tmigr_state(9)

πŸ’€ real talk though: this page lives in ./kernel/time, and it's dated October 2026 β€” so yeah, mark your calendar, the kernel is apparently ahead of schedule ⭐

and that's the whole page, bestie β€” go forth and migrate those timers responsibly πŸŽ€πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from