clear_tasks_mm_cpumask(9)
π clear_tasks_mm_cpumask π
okay so bestie, welcome to the clear_tasks_mm_cpumask(9) page from the Kernel API Manual β pull up a chair, we're getting into it π«Ά
β¨ NAME β¨
clear_tasks_mm_cpumask β safely clear tasks' mm_cpumask for a CPU</p> π
β¨ SYNOPSIS β¨
void clear_tasks_mm_cpumask (int cpu );
β¨ ARGUMENTS β¨
cpuβ a CPU id. that's it. that's the whole argument. iconic minimalism πΈ
β¨ DESCRIPTION β¨
okay so here's the vibe: this function walks all processes, finds a valid mm struct for each one, and then clears a corresponding bit in mm's cpumask. like, every task, one by one, mm found, bit cleared. slay π
and the way that this all sounds trivial?? it's not. there are various non-obvious corner cases hiding in there, and this function is literally doing its best to solve them all in a safe manner. it ate, honestly π₯
β οΈ also note, bestie: the function uses a somewhat relaxed locking scheme, so it may be called only for an already offlined CPU. not a live one. offlined. dead. done. do not come for this function with a CPU that's still out here living its life, fr fr π
β¨ SEE ALSO β¨
bestie these are the lore-adjacent ones, go read them if you want the whole cinematic universe π
- Kernel file
./kernel/cpu.c struct cpuhp_cpu_state(9)struct cpuhp_step(9)cpuhp_invoke_callback(9)cpuhp_ap_update_sync_state(9)cpuhp_ap_report_dead(9)cpuhp_ap_sync_alive(9)cpu_device_down(9)notify_cpu_starting(9)cpu_device_up(9)bringup_hibernate_cpu(9)__cpuhp_setup_state_cpuslocked(9)__cpuhp_remove_state_cpuslocked(9)
and that's the page!! mwah π this one came from ./kernel, dated October 2026, and it's filed under clear_tasks_mm_cpumask(9) β go forth and offline your CPUs responsibly, queen πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms