try_to_compact_pages(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– try_to_compact_pages(9) πŸ’–

okay so bestie, welcome to the try_to_compact_pages page from the Kernel API Manual β€” yes it's a section 9 manpage, yes we're doing this, and yes you're gonna get it. 🫢


✨ NAME ✨

try_to_compact_pages β€” Direct compact to satisfy a high-order allocation

like, it goes in and compacts memory directly, no cap, so your high-order allocation can actually happen. πŸ”₯


🌸 SYNOPSIS 🌸

enum compact_result try_to_compact_pages (gfp_t gfp_mask , unsigned int
order , unsigned int alloc_flags , const struct alloc_context *ac , enum
compact_priority prio , struct capture_control *capc );

that's the whole signature, copy it exactly, i don't make the rules (i do, but still). πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • gfp_mask β€” the GFP mask of the current allocation. the vibe-check flags, basically. ✨
  • order β€” the order to try to make available. this is the size of the thing you're tryna fit, and it will be judged. πŸ‘‘
  • alloc_flags β€” the allocation flags of the current allocation. more flags, more context, we love a fully-specified caller. 🌸
  • ac β€” the context of current allocation. it's a const struct alloc_context *, so hands off, no touching. πŸ™ˆ
  • prio β€” determines how hard direct compaction should try to succeed. an enum compact_priority, so like… how desperate are we. 😭
  • capc β€” free page capture bypassing the freelist, a struct capture_control *. it's giving sneaky but make it efficient. πŸ’€

πŸ¦‹ DESCRIPTION πŸ¦‹

This is the main entry point for direct page compaction. periodt. that's the whole description and honestly? iconic. it does exactly what it says on the tin β€” you call it, it compacts, directly. 🧚


🌈 SEE ALSO 🌈

all of these are your little compaction besties, go say hi. πŸ’œ


ngl if you're here you're probably debugging an allocation failure at like 2am. drink water, bestie. πŸ“

that's the whole page!! source is ./mm and it's dated October 2026 β€” so like, future girlie energy. stay compacted, mwah πŸ’…πŸ’–πŸŽ€

πŸ“¦ where this page comes from