for_each_cpu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ for_each_cpu(9) β€” Kernel API Manual πŸ¦‹

okay bestie, welcome to the for_each_cpu(9) page from the Kernel API Manual. This is your group chat for looping over cpus in a mask, and it’s iconic. No cap. πŸ’–


πŸŽ€ NAME πŸŽ€

for_each_cpu β€” bestie, it iterates over every cpu in a mask. That’s literally the name, and it ate. ✨

πŸ’… SYNOPSIS πŸ’…

the signature is giving:

for_each_cpu (cpu , mask );

πŸŒ€ ARGUMENTS πŸŒ€

  • cpu β€” the iterator, and it’s an (optionally unsigned) integer. πŸŒ€
  • mask β€” the cpumask pointer. She’s the map, periodt. πŸ—ΊοΈ

πŸ“ DESCRIPTION πŸ“

okay so after the loop is fully done and dusted, cpu is >= nr_cpu_ids. That’s the tea, fr fr. 🍡

🌈 SEE ALSO 🌈

Kernel file: ./include/linux/cpumask.h β€” the home base, bestie.


xoxo πŸ’– cute little footer sign-off: source/version ./include/linux, date October 2026, and title for_each_cpu(9). Mwah πŸŽ€

πŸ“¦ where this page comes from