mas_nomem_nofail(9)
π mas_nomem_nofail(9) β the Kernel API Manual moment π
okay so bestie, welcome to the mas_nomem_nofail(9) page β yes that's the whole title, and yes we're gonna get through it together π«Ά this is a kernel API manual entry and it's lowkey iconic, so grab a lil snack and let's go β¨
πΈ NAME πΈ
mas_nomem_nofail β retries allocations with __GFP_NOFAIL, but ONLY if the maple state has stored the -ENOMEM error. that's the whole vibe: no stored -ENOMEM, no retry. periodt π
π¦ SYNOPSIS π¦
bool mas_nomem_nofail (struct ma_state *mas , unsigned long index ,
unsigned long last );
look at her. three args, returns a bool, main character energy fr fr π
π ARGUMENTS π
masβ the maple state, obviously. she's the star of the show πindexβ the start of the range for the mas reset πlastβ the end of the range for the mas reset β
β¨ RETURN β¨
so here's the tea β:
- returns
falseifmasisn't in an-ENOMEMstate π - returns
trueif the allocation actually happens β and when it does, the state is reset π
β οΈ important bestie, don't skip this: the internal lock will be dropped, and external locks must allow blocking. like, literally must. no cap. if your locks can't block, this is not the function for you π
π SEE ALSO π
kernel file ./lib/maple_tree.c β and the whole friend group π:
mas_prealloc_calc(9)mas_wr_preallocate(9)mas_insert(9)mas_alloc_cyclic(9)mas_walk(9)mte_dead_walk(9)mt_free_walk(9)mas_store(9)mas_store_gfp(9)mas_store_prealloc(9)mas_preallocate(9)mas_next(9)mas_next_range(9)mt_next(9)mas_prev(9)mas_prev_range(9)mt_prev(9)mas_pause(9)mas_find_setup(9)mas_find(9)mas_find_range(9)mas_find_rev_setup(9)mas_find_rev(9)mas_find_range_rev(9)mas_erase(9)mas_nomem(9)mtree_load(9)mtree_store_range(9)mtree_store(9)mtree_insert_range(9)mtree_insert(9)mtree_alloc_cyclic(9)mtree_erase(9)__mt_dup(9)mtree_dup(9)__mt_destroy(9)mtree_destroy(9)mt_find(9)mt_find_after(9)
and that's the page!! π§ this lil gem lives in ./lib and the manual dates it to October 2026, and obviously it's filed under mas_nomem_nofail(9) β slay, bye bestie, go retry those allocations 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