for_each_zone(9)
π for_each_zone π
Welcome to the for_each_zone(9) page from the Kernel API Manual, bestie. This one is a tiny little helper macro, and it's honestly giving βsmall but iconic.β π«Ά
β¨ NAME β¨
for_each_zone β helper macro to iterate over all memory zones. Periodt. π
π SYNOPSIS π
for_each_zone (zone );
πΈ ARGUMENTS πΈ
zoneβ pointer to astruct zonevariable. That's the variable you're handing over, and yes, it is literally a pointer tostruct zone. π¦
π§ DESCRIPTION π§
Okay so here's the whole vibe: the user only needs to declare the zone variable, and for_each_zone fills it in. That's it. That's the tea. No extra steps, no dramatic monologue. β¨
Bestie, just declare zone and let the macro do its little fill-in moment. π
π₯ SEE ALSO π₯
Kernel file: ./include/linux/mmzone.h
is_highmem(9)for_each_online_pgdat(9)next_zones_zonelist(9)first_zones_zonelist(9)for_each_zone_zonelist_nodemask(9)for_each_zone_zonelist(9)pfn_valid(9)
Go read those too, iykyk. ππ
Mwah π this little kernel love letter comes from the source/version ./include/linux, dated October 2026, and it's your one and only for_each_zone(9) page. Slay. ππ
π¦ 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