for_each_zone_zonelist(9)
π for_each_zone_zonelist β kernel API manual, but make it make sense
okay so bestie, welcome to the for_each_zone_zonelist(9) page π this is the little macro that walks you through every valid zone in a zonelist that sits at or below a zone index you pick. iconic behavior honestly.
β¨ NAME β¨
for_each_zone_zonelist β the helper macro that iterates over the valid zones in a zonelist at or below a given zone index. she's a tour guide for your zonelist, no cap πΈ
β¨ SYNOPSIS β¨
for_each_zone_zonelist (zone , z , zlist , highidx );
lowkey the whole thing is one line. the way that macro just Gets It done π
π«Ά ARGUMENTS π«Ά
zoneβ the current zone in the iterator. this is your main character, the one you're actually looking at right now β¨zβ the current pointer withinzonelist->zonesthat's being iterated. she's the one doing the pointing, respect her πzlistβ the zonelist being iterated. the whole vibe container, the guest list fr fr πhighidxβ the zone index of the highest zone to return. basically the ceiling β anything above this does NOT get an invite to the party π«
π₯ DESCRIPTION π₯
so what does she actually do? this iterator iterates through all zones at or below a given zone index. that's it, that's the whole flex. every zone that makes the cut (i.e. sits at or below that highidx you handed over) gets visited, in order, no drama, no skipped steps π
likeβ¦ not to be dramatic but it's giving "organized little loop that could" and honestly? obsessed π
π SEE ALSO π
go read these next, bestie, they're all in the same friend group:
- Kernel file
./include/linux/mmzone.hβis_highmem(9),for_each_online_pgdat(9),for_each_zone(9),next_zones_zonelist(9),first_zones_zonelist(9),for_each_zone_zonelist_nodemask(9),pfn_valid(9)
iykyk, that's the whole crew right there π
reminder queen: this is a macro, so the "arguments" are text-substituted at compile time. treat the names right and she'll treat you right π§
and that's the page! π¦ brought to you from ./include/linux, dated October 2026 β mwah, go iterate something beautiful, bestie ππ
π¦ 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