__account_locked_vm(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 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 β€” true if pages should be considered positive, false if not ⭐
  • task β€” task used to check RLIMIT_MEMLOCK πŸ‘‘
  • bypass_rlim β€” true if checking RLIMIT_MEMLOCK should 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 β€” if RLIMIT_MEMLOCK would 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