largest_zero_folio(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… largest_zero_folio(9) πŸ’…

ok so bestie, welcome to the Kernel API Manual β€” no cap, this one's a lil niche but she's iconic πŸŽ€


✨ NAME ✨

largest_zero_folio β€” literally just get the biggest zero-size folio available, that's the whole gig πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

struct folio *largest_zero_folio (void );

🌸 ARGUMENTS 🌸

  • void β€” no arguments, not a single one, she takes zero input and we respect that 🫢

🌈 DESCRIPTION 🌈

okay so here's the vibe: you reach for this function when mm_get_huge_zero_folio is not an option for you β€” specifically when there's no appropriate mm lifetime to tie the huge zero folio back to the caller. like, there's just nowhere to hang it, yk? so this function is the one you call instead. main character energy tbh πŸ‘‘

and a lil PSA: deduce the size of the folio with folio_size instead of assuming the folio size. do not assume. we don't assume here, we check. periodt πŸ’…


⭐ RETURN ⭐

she gives you back:

  • a pointer to a PMD sized zero folio if CONFIG_PERSISTENT_HUGE_ZERO_FOLIO is enabled, or
  • a single page sized zero folio

either way you get a zero folio, the size is just a lil surprise depending on config πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘

go read those next bestie, iykyk πŸ“šβœ¨


🧚 just a reminder: largest_zero_folio is not a swap-in for mm_get_huge_zero_folio in every situation β€” it's the move when there's no appropriate mm lifetime to tie the huge zero folio from the caller. don't be out here using it wrong, fr fr πŸ’€

k that's the whole page!! shoutout to the kernel source dir ./include/linux, dated October 2026 β€” she's fresh, she's documented, and she ate πŸ“πŸ’œ bye bestie!! 🌟

πŸ“¦ where this page comes from