alloc_rtree_node(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ‘‘ alloc_rtree_node β€” Kernel API Manual vibes ✨

okay so bestie, you're in the Kernel API Manual and today's main character is alloc_rtree_node(9). buckle up πŸŽ€


🌸 NAME 🌸

alloc_rtree_node β€” allocate a brand new node and, like, add it to the radix tree. that's the whole job. she's employed πŸ’…


✨ SYNOPSIS ✨

struct rtree_node * alloc_rtree_node (gfp_t gfp_mask , int safe_needed ,
struct chain_allocator *ca , struct list_head *list );

literally just call her with those four things and she'll hand you back a struct rtree_node *, no cap 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • gfp_mask β€” the GFP mask for the allocation. it's giving "how hard should I try to get memory" energy.
  • safe_needed β€” get pages that haven't been used before hibernation. restore only, so don't be weird about it 😭 this one's niche.
  • ca β€” a pointer to a linked list of pages (yep, a "chain") that we allocate from. it's giving actual chain, not the cute necklace kind πŸ”—
  • list β€” the Radix Tree node to add. she gets appended, periodt.

πŸ’– DESCRIPTION πŸ’–

so what does she actually do? bestie. she's the one who allocates inner nodes and the leave nodes of the radix tree β€” both, iconic versatility πŸ‘‘

and then, because she's not just pretty, she also adds the node to the corresponding linked list that got passed in through the *list parameter. multitasking queen fr fr 🌈


πŸ”₯ SEE ALSO πŸ”₯

kernel file ./kernel/power/snapshot.c β€” that's where the whole friend group lives:

like, the entire group chat. go read them, iykyk πŸ’œ


ngl if you're poking at hibernation/snapshot code, you're in ./kernel/power territory β€” that's the address on the mailbox, bestie 🏑

so yeah, that's the whole page πŸ“ shoutout to the ./kernel/power source, dated October 2026, for being the origin of all this. mwah, love u, bye πŸ˜­πŸ’–

πŸ“¦ where this page comes from