memalloc_flags_save(9)
π NAME π
memalloc_flags_save β add a PF_* flag to current->flags and save the old value, bestie π
okay so welcome to the memalloc_flags_save(9) page from the Kernel API Manual β this is the little helper that handles the flag-saving moment for you β¨
β¨ SYNOPSIS β¨
unsigned memalloc_flags_save (unsigned flags );
π ARGUMENTS π
flagsβ the flags to add, periodt π«Ά
π¦ DESCRIPTION π¦
okay so this is the whole vibe: it lets you conveniently add PF_* flags, irrespective of the current value, and then the old version gets restored with memalloc_flags_restore π
like, itβs giving βsave the old state, add the new flag, no capβ β and the restore part is literally handled by memalloc_flags_restore πΈ
bestie, this is the convenient flag-adding + old-value-saving combo. the old version comes back via memalloc_flags_restore, iykyk π«
π SEE ALSO π
peep the kernel file ./include/linux/sched/mm.h and these iconic besties π
mmgrab(9)mmget(9)might_alloc(9)memalloc_noio_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)
mwah π this pageβs source is ./include/linux/sched, itβs from the Kernel API Manual, dated October 2026, and the page itself is memalloc_flags_save(9) β slay πβ¨
π¦ 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