memalloc_flags_save(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 πŸ’œ


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