memblock_setclr_flag(9)
π NAME π
memblock_setclr_flag β the one where you set or clear a flag for a memory region, bestie β¨
So this is a page from the Kernel API Manual (section 9, kernel dev docs, iykyk) and it's literally just about flipping one little flag on one little slice of memory. Small function, big main character energy π
π SYNOPSIS π
int __init_memblock memblock_setclr_flag (struct memblock_type *type ,
phys_addr_t base , phys_addr_t size , int set , int flag );
That's the whole vibe. Five args, one int back. Slay.
πΈ ARGUMENTS πΈ
typeβ the memblock type you're setting/clearing the flag for π«Άbaseβ base address of the region, like where the slice startssizeβ size of the region, aka how far it goessetβ set or clear the flag (yes it's literally the switch, no cap)flagβ the actual flag to update π₯
π¦ DESCRIPTION π¦
okay so here's the tea: this function isolates the region [base, base + size), and then it sets/clears flag on it. That's it. That's the whole function. It's giving precision. It's giving laser focus. π
fr fr the brackets matter β [base, base + size) is the exact region, don't @ me.
β¨ RETURN β¨
0on success β we love a clean win π-errnoon failure β π but at least it tells you why
π SEE ALSO π
The whole memblock cinematic universe, bestie β go read these too, they're iconic:
- Kernel file
./mm/memblock.cmemblock 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_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_mark_kho_scratch(9)memblock_clear_kho_scratch(9)__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)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)
and that's the page, bestie π this lil gem lives in the ./mm corner of the tree, shipped under the Kernel API Manual, dated October 2026 β go forth and flag responsibly π§ββοΈβ
π¦ 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