count_active_contexts(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

okay so this page is count_active_contexts(9) from the Kernel API Manual, and it does exactly what the name says, no cap: count nr of active tasks. πŸ’…


✨ SYNOPSIS ✨

unsigned long count_active_contexts (void );

πŸŽ€ ARGUMENTS πŸŽ€

  • void β€” no arguments. literally none. zero. empty set. she takes nothing. 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

Return the number of tasks currently running or waiting to run. that's the whole vibe check: if a task is on the CPU or queued up ready to go, it counts. πŸ‘‘

Note that we don't take runq_lock / list_mutex here. Reading a single 32bit value is atomic on powerpc, and we don't care about memory ordering issues here. so yeah, no locking moment, and that's intentional. πŸ”₯


🌈 SEE ALSO 🌈


signing off from ./arch/powerpc/platforms/cell/..., October 2026, count_active_contexts(9) β€” bestie, go count some contexts responsibly πŸ’–βœ¨

πŸ“¦ where this page comes from