__memblock_...ge_bottom_up(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __memblock_find_range_bottom_up β€” NAME

okay so bestie, welcome to the Kernel API Manual ✨ β€” this is the page for __memblock_find_range_bottom_up, and yes the header truncates it like that, we don't talk about it πŸ™ˆ. Short version: it's the find free area utility in bottom-up πŸŽ€ β€” it goes hunting for a chunk of free memory, searching from the bottom of the range upward.


πŸ¦‹ SYNOPSIS

phys_addr_t __init_memblock __memblock_find_range_bottom_up (phys_addr_t
start , phys_addr_t end , phys_addr_t size , phys_addr_t align , int nid
, enum memblock_flags flags );

that's the whole signature, no cap πŸ’…


🌸 ARGUMENTS

  • start β€” where the candidate range begins. the starting line, the bottom of the search zone 🫢
  • end β€” where the candidate range ends. plot twist: this one can also be MEMBLOCK_ALLOC_ANYWHERE or MEMBLOCK_ALLOC_ACCESSIBLE, so it's not always a plain endpoint πŸ‘€
  • size β€” how big the free area you're looking for needs to be πŸ“
  • align β€” the alignment that free area has to have. picky queen behaviour and honestly? iconic ✨
  • nid β€” the nid of the free area you want, and if you pass NUMA_NO_NODE it'll take any node. flexible fr fr πŸ’œ
  • flags β€” pick from blocks based on memory attributes. it's giving "choose wisely" πŸ”₯

🧚 DESCRIPTION

this is the utility that memblock_find_in_range_node calls in, and what it does is find free area bottom-up ⭐ β€” literally searching upward for a free chunk. lowkey the whole job. main character energy for a helper function, honestly πŸ‘‘


🌈 RETURN

  • Found address on success πŸŽ‰
  • 0 on failure 😭

that's it. no in-between, no "maybe". zero means nope πŸ’€


πŸ‘‘ SEE ALSO

bestie there are SO many siblings, buckle in πŸŽ€ the kernel file ./mm/memblock.c and the memblock overview(9) are the family home, and then:

go read them, they're all part of the same memblock cinematic universe 🫢 iykyk

and that's the page!! mwah πŸ’– this lil guy lives over in ./mm and the version we're looking at is dated October 2026 β€” so yeah, from the future, slay ⭐ periodt πŸŽ€

πŸ“¦ where this page comes from