stop_machine_cpuslocked(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… stop_machine_cpuslocked(9) πŸ’…

okay so this is straight out of the Kernel API Manual, and bestie, it's a good one β€” it's giving "stop the world" but make it kernel ✨


🌸 NAME 🌸

stop_machine_cpuslocked β€” freeze the machine on all CPUs and run this function 🧊πŸ”₯

like, all of them. every CPU. nobody moves until the function does its thing. main character function energy fr fr.


πŸŽ€ SYNOPSIS πŸŽ€

int stop_machine_cpuslocked (cpu_stop_fn_t fn , void *data , const
       struct cpumask *cpus );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • fn β€” the function to run πŸ’« like, this is the whole point, the star of the show
  • data β€” the data ptr to pass to fn 🎁 (a little gift for your function, we love that)
  • cpus β€” the cpus to run fn on (NULL = one unspecified online CPU) πŸ‘€ note that NULL is a real option here, and it means one unspecified online CPU, not all of them, not zero β€” one, and unspecified

🧚 DESCRIPTION 🧚

Same as above. No cap, that's the whole thing β€” the manpage literally says "Same as above" 😭 iykyk.

Also: avoids nested calls to cpus_read_lock. That's the lock part of the name, and it's the whole reason this variant exists β€” nested cpus_read_lock calls? not today, bestie πŸ™…β€β™€οΈ


πŸ’œ CONTEXT πŸ’œ

Must be called from within a cpus_read_lock protected region. πŸ”’

not optional, not a suggestion, not a vibe β€” it's a must. call it outside that region and you're not slaying, you're just wrong πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘


that's the whole thing, bestie β€” you ate that 🫢 source is ./include/linux, version date October 2026, and the page signs off as stop_machine_cpuslocked(9). periodt. 🌈⭐

πŸ“¦ where this page comes from