memblock_mark_kho_scratch(9)
π memblock_mark_kho_scratch β a kernel API manual, but make it cute
okay so bestie, welcome to the memblock_mark_kho_scratch(9) page π this is a kernel API manual and it's lowkey iconic, so let's get into it β¨
β¨ NAME β¨
memblock_mark_kho_scratch β mark a memory region as MEMBLOCK_KHO_SCRATCH π
like, that's the whole vibe. you're tagging a region. slay.
π¦ SYNOPSIS π¦
int memblock_mark_kho_scratch (phys_addr_t base , phys_addr_t size );
there she is. two args, one int coming back at you. no cap. π«
πΈ ARGUMENTS πΈ
baseβ the base phys addr of the region. yes bestie, the physical address, not the vibe address π«Άsizeβ the size of the region. how big it is. the whole point π
π DESCRIPTION π
okay so here's the actual tea β: only memory regions that are marked with MEMBLOCK_KHO_SCRATCH will be considered for allocations during early boot with kexec handover. that's it. that's the rule. if you didn't mark it, it's not getting considered β no cap, fr fr π
so like, this function is the one doing the marking. it's giving gatekeeper energy and honestly? it ate π
β RETURN β
0on success π-errnoon failure π
that's the whole return contract, bestie. zero means we slayed, negative errno means we did not. periodt.
π SEE ALSO π
buckle up, this is a long list and we're getting through all of it π§ββοΈ starting with the home base:
- the kernel file
./mm/memblock.cπ plus the generalmemblock overview(9) __memblock_find_range_bottom_up(9)__memblock_find_range_top_down(9)memblock_find_in_range_node(9)memblock_find_in_range(9)memblock_discard(9)memblock_double_array(9)memblock_merge_regions(9)memblock_insert_region(9)memblock_add_range(9)memblock_add_node(9)memblock_add(9)memblock_validate_numa_coverage(9)memblock_isolate_range(9)memblock_free(9)memblock_phys_free(9)memblock_setclr_flag(9)memblock_mark_hotplug(9)memblock_clear_hotplug(9)memblock_mark_mirror(9)memblock_mark_nomap(9)memblock_clear_nomap(9)memblock_reserved_mark_noinit(9)memblock_reserved_mark_kern(9)memblock_clear_kho_scratch(9)β yes, the opposite twin, she's here too π__next_mem_range(9)__next_mem_range_rev(9)memblock_set_node(9)memblock_alloc_range_nid(9)memblock_phys_alloc_range(9)memblock_phys_alloc_try_nid(9)memblock_alloc_internal(9)memblock_alloc_exact_nid_raw(9)memblock_alloc_try_nid_raw(9)memblock_alloc_hugetlb(9)memblock_alloc_try_nid(9)__memblock_alloc_or_panic(9)β the name alone is sending me πmemblock_estimated_nr_free_pages(9)memblock_is_region_memory(9)memblock_is_region_reserved(9)memblock_free_all(9)reserve_mem_find_by_name(9)reserve_mem_release_by_name(9)
iykyk, that's the whole memblock friend group and they're all linked π«Ά
π real talk though: this page lives in ./mm and the whole set here is kernel-internal territory β go read the neighbour pages before you go poking at regions, okay bestie? π
and that's the page!! π sign-off time: this one comes to you from the source tree at ./mm, dated October 2026 β take care of her, she's iconic ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms