memalloc_nofs_save(9)
π memalloc_nofs_save β the Kernel API Manual glow-up
okay so bestie, let me put you on to memalloc_nofs_save β it lives in the Kernel API Manual and it's literally the "hey, we're entering the no-FS zone" button β¨
πΈ NAME πΈ
memalloc_nofs_save β marks implicit GFP_NOFS allocation scope. that's it, that's the whole vibe π
β¨ SYNOPSIS β¨
unsigned int memalloc_nofs_save (void );
like, she takes nothing and she gives you back an unsigned int. main character energy fr fr π
π¦ ARGUMENTS π¦
voidβ no arguments. zero. nada. she doesn't want your parameters, she's booked and busy π
π DESCRIPTION π
okay so here's the tea π β this function marks the beginning of the GFP_NOFS allocation scope.
while you're inside that scope, all further allocations will implicitly drop the __GFP_FS flag, which means they're safe for the FS critical section from the allocation recursion point of view. no cap, that's the whole point π₯
and when you're done? use memalloc_nofs_restore to end the scope, passing it the flags that this function returned to you. don't lose those flags, bestie, they're your ticket back out π
π CONTEXT π
this function is safe to be used from any context. any. literally any. she's flexible like that π§
β RETURN β
the saved flags, which you then pass to memalloc_nofs_restore. keep them safe, hand them back, everyone's happy π«Ά
π SEE ALSO π
kernel file ./include/linux/sched/mm.h
the whole friend group, in order, no gatekeeping:
mmgrab(9)mmget(9)might_alloc(9)memalloc_flags_save(9)memalloc_noio_save(9)memalloc_noio_restore(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)
and that's the page, bestie π this lil drop came from ./include/linux/sched, dated October 2026 β so when you cite it in your group chat, you know exactly which era it's from. slay, go save your flags π
π¦ 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