__account_locked_vm(9)
πΈ NAME πΈ
okay so this is __account_locked_vm(9) from the Kernel API Manual β the whole vibe is: account locked pages to an mm's locked_vm π
β¨
β¨ SYNOPSIS β¨
int __account_locked_vm (struct mm_struct *mm , unsigned long pages ,
bool inc , const struct task_struct *task , bool bypass_rlim );
That's the signature, bestie β copy it exactly, no freestyle edits π«Ά
π ARGUMENTS π
mmβ the mm you're accounting against πpagesβ number of pages to account πincβtrueifpagesshould be considered positive,falseif not βtaskβ task used to checkRLIMIT_MEMLOCKπbypass_rlimβtrueif checkingRLIMIT_MEMLOCKshould be skipped π
π¦ DESCRIPTION π¦
Lowkey important vibe check: this function assumes task and mm are valid (i.e. at least one reference on each), and that mmap_lock is held as writer. That's not optional energy β it's the assumption, fr fr π
π₯ RETURN π₯
0β on success π-ENOMEMβ ifRLIMIT_MEMLOCKwould be exceeded π΅βπ«
π SEE ALSO π
Kernel file ./mm/util.c β plus the whole friend group: kfree_const(9), __kmemdup_nul(9), kstrdup(9), kstrdup_const(9), kstrndup(9), kmemdup(9), kmemdup_array(9), kvmemdup(9), kmemdup_nul(9), memdup_user(9), vmemdup_user(9), strndup_user(9), memdup_user_nul(9), randomize_page(9), account_locked_vm(9), __vmalloc_array(9), vmalloc_array(9), __vcalloc(9), vcalloc(9), folio_mapping(9), folio_copy(9), get_cmdline(9), mem_dump_obj(9), compat_set_desc_from_vma(9), __compat_vma_mmap(9), compat_vma_mmap(9), snapshot_page(9), mmap_action_prepare(9), mmap_action_complete(9), folio_pte_batch(9), page_range_contiguous(9) πβ¨
source/version is ./mm, and the date on this one is October 2026 β mwah, that's the whole page, periodt ππ
π¦ 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