stop_core_cpuslocked(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… stop_core_cpuslocked β€” kernel API manual, bestie edition πŸŽ€

okay so real talk, this is a page straight out of the Kernel API Manual, and honestly? it's a baddie. it does one thing and it does it slayfully. let's get into it ✨


✨ NAME ✨

stop_core_cpuslocked β€” stop all threads on just one core πŸ›‘

like not the whole system, not every CPU, just one core. main character energy but make it hyper-localized πŸ’…


🌸 SYNOPSIS 🌸

int stop_core_cpuslocked (unsigned int cpu , cpu_stop_fn_t fn , void *data );

yeah that's the whole signature, she's compact and she knows it 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • cpu β€” any cpu in the targeted core. literally any one of them, she'll figure out which core you mean, iykyk πŸ’–
  • fn β€” the function to run on each CPU in the core containing cpu. this is the whole errand, the thing you actually came here to do ✨
  • data β€” the data ptr to pass to fn. the little care package you hand over 🎁

πŸ”₯ DESCRIPTION πŸ”₯

Same as above, but instead of every CPU, only the logical CPUs of the single core containing cpu are affected. 🌈

(and yes, "same as above" β€” she's referencing her sister function, keep scrolling to SEE ALSO, it's giving sequel energy πŸ‘‘)


πŸ’€ CONTEXT πŸ’€

Must be called from within a cpus_read_lock protected region.

⚠️ bestie do NOT skip this. if you're not inside a cpus_read_lock protected region you are lowkey asking for chaos. it's not a vibe check you can fail, it's a rule πŸ™ˆ

⭐ RETURN ⭐

  • 0 β€” returned if all invocations of fn return zero. everyone came back clean, we love a unanimous slay πŸŽ‰
  • otherwise β€” the value returned by an arbitrarily chosen member of the set of calls to fn that returned non-zero. so like, one of the failures gets to speak for the group. arbitrary. chaotic. iconic. which one? don't ask, it's not telling 😭

🧚 SEE ALSO 🧚

go read those next, they're the prequels and the lore runs deep πŸ“


okay that's the whole page, you're so welcome πŸ’œ remember: one core only, lock held, fn returns zero everywhere or you get somebody's random non-zero back.

from ./include/linux β€” October 2026 β€” with love, the Kernel API Manual crew 🌸🫢✨

πŸ“¦ where this page comes from