memalloc_noio_save(9)
π memalloc_noio_save β the Kernel API Manual era π
okay so bestie, we're in the Kernel API Manual today and this one is called memalloc_noio_save. it's short, it's iconic, and it does exactly one thing but it does it flawlessly. no cap.
β¨ NAME β¨
memalloc_noio_save β marks implicit GFP_NOIO allocation scope. literally that's the whole gig, and she ate. π
πΈ SYNOPSIS πΈ
unsigned int memalloc_noio_save (void );
look at her. not a single argument. main character energy fr fr. π¦
π ARGUMENTS π
voidβ no arguments. none. zero. the void is the vibe. no arguments, bestie, she needs nothing from you. π
π DESCRIPTION π
so here's the tea. this function marks the beginning of the GFP_NOIO allocation scope. think of it like putting up a little velvet rope at the entrance of the function, and everything after that rope is gonna behave differently.
once you're inside, all further allocations will implicitly drop the __GFP_IO flag β like, automatically, you don't gotta do a thing β and so they are safe for the IO critical section, from the allocation recursion point of view. π«Ά
and when you're done? you do not just wander off. use memalloc_noio_restore to end the scope, and you pass it the flags that this function returned to you. yes, the returned value matters. keep it. treasure it. pass it back. π
π§ CONTEXT π§
this function is safe to be used from any context. literally any. no gatekeeping, no "sorry you're in the wrong context" energy. she's flexible like that. π
β RETURN β
returns the saved flags β and those are the exact flags you gotta pass to memalloc_noio_restore later. don't lose them, bestie, i'm begging π
π₯ SEE ALSO π₯
kernel file ./include/linux/sched/mm.h π and then the whole friend group:
mmgrab(9)mmget(9)might_alloc(9)memalloc_flags_save(9)memalloc_noio_restore(9)memalloc_nofs_save(9)memalloc_nofs_restore(9)memalloc_noreclaim_save(9)memalloc_noreclaim_restore(9)memalloc_pin_save(9)memalloc_pin_restore(9)set_active_memcg(9)
squad goals honestly. the save/restore duos are all matching outfits and i respect it. πβ¨
tiny reminder from your girl: every_savein this list has a_restoreand if you forget the restore you're gonna have a bad time. not a threat, just facts. π
okay that's the page!! sourced from ./include/linux/sched, dated October 2026, version vibes immaculate. mwah, go forth and scope 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