first_zones_zonelist(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ first_zones_zonelist(9) ✨

okay bestie, welcome to the Kernel API Manual entry for first_zones_zonelist β€” and yes it's a (9) page, we're in the big leagues now πŸ’…


🌸 NAME 🌸

first_zones_zonelist β€” literally returns the first zone at or below highest_zoneidx within the allowed nodemask in a zonelist πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

struct zoneref * first_zones_zonelist (struct zonelist *zonelist , enum
zone_type highest_zoneidx , const nodemask_t *nodes );

that's the whole vibe, no cap ✨


πŸ’– ARGUMENTS πŸ’–

  • zonelist β€” the zonelist you're searching through to find a suitable zone πŸ”
  • highest_zoneidx β€” the zone index of the highest zone to return, like the ceiling of your search πŸ‘‘
  • nodes β€” an optional nodemask to filter the zonelist with (optional!! so you can pass nothing and it's still chill) 🌈

🧚 DESCRIPTION 🧚

okay so here's the tea πŸ“ β€” this function returns the first zone at or below a given zone index that's also within the allowed nodemask.

the zoneref you get back is a cursor, iykyk πŸ‘€ β€” you can use it to iterate the zonelist with next_zones_zonelist by advancing it by one before calling. so it's not just a one-and-done answer, it's your starting point for the whole journey 🫢

and now the serious part, bestie, don't skip this πŸ’€ β€” when no eligible zone is found, zoneref->zone is NULL (but zoneref itself is never NULL, she's always there, just maybe empty inside 😭). this can happen either genuinely, or due to a concurrent nodemask update due to cpuset modification. yes, race conditions are real, stay safe out there πŸ™ˆ

⭐ RETURN ⭐

a zoneref pointer for the first suitable zone found πŸ”₯


πŸ¦‹ SEE ALSO πŸ¦‹

kernel file ./include/linux/mmzone.h is doing a whole lot, and while you're in there check out these iconic siblings:

periodt πŸ’œ


and that's the whole page, bestie, you ate that πŸ“šβœ¨ this one came from ./include/linux, dated October 2026, and it's first_zones_zonelist(9) β€” go forth and find your first suitable zone, ily πŸ’–πŸŽ€πŸ§š

πŸ“¦ where this page comes from