UVM_KM_SUBALLOC(9)

πŸ“¦ in nixpkgs unstable

πŸ’… UVM_KM_SUBALLOC(9) πŸ’…

okay so bestie, welcome to uvm_km_suballoc β€” that's section 9 of the Kernel Developer's Manual, the part where we talk about raw kernel memory or address space allocator energy. yes, raw. yes, kernel. no cap, this one's a lil niche but she's iconic if you know what she's doing 🧚✨


✨ SYNOPSIS ✨

like, first you gotta pull in the headers or she won't even look at you:

#include <sys/param.h>
#include <uvm/uvm.h>

and then the main character herself:

uvm_km_suballoc(vm_map_t map, vaddr_t *min, vaddr_t *max, vsize_t size,
    int flags, boolean_t fixed, vm_map_t submap);

literally copy that exactly, don't be creative with it πŸ’€


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea πŸ“ β€” uvm_km_suballoc() allocates submap (with the specified flags, as described above β€” yes bestie, "as described above", the page said it, I'm just passing the message along 🫢) from map, and it'll create a brand new map for you if submap is NULL. so generous of her honestly πŸ‘‘

you can also pin down the addresses of the submap exactly β€” just set the fixed argument to non-zero, and that makes the min argument specify the beginning of the address in the submap. precise. intentional. main character energy πŸ’…

but if fixed is zero? then it's a whole different vibe β€” any address of size size will be allocated from map, and the start and end addresses come back to you in min and max. she picks, you receive. slay 🌈

ngl, the fixed flag is the whole personality switch here β€” non-zero means you choose the starting address via min, zero means the allocator gets to choose and hands you min + max back. don't mix that up, bestie 😭

πŸ‘€ SEE ALSO πŸ‘€


and that's the whole page, bestie β€” no filler, no skips, every detail intact πŸ’– this lil moment was brought to you by Debian, dated November 13, 2025 πŸŽ€ and the page header? that's UVM_KM_SUBALLOC(9), section 9 of the Kernel Developer's Manual, in case you forgot already πŸ™ˆ mwah, go allocate something responsibly ⭐πŸ”₯

πŸ“¦ where this page comes from