Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\util.c Create Date:2022-07-28 14:21:49
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__account_locked_vm - account locked pages to an mm's locked_vm*@mm: mm to account 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

Proto:int __account_locked_vm(struct mm_struct *mm, unsigned long pages, bool inc, struct task_struct *task, bool bypass_rlim)

Type:int

Parameter:

TypeParameterName
struct mm_struct *mm
unsigned longpages
boolinc
struct task_struct *task
boolbypass_rlim
438  ret = 0
440  lockdep_assert_held_write( & mmap_sem)
442  locked_vm = Pages that have PG_mlocked set
443  If inc Then
444  If Not bypass_rlim Then
446  If locked_vm + pages > limit Then ret = -ENOMEM
449  If Not ret Then Pages that have PG_mlocked set = locked_vm + pages
451  Else
452  WARN_ON_ONCE(pages > locked_vm)
453  Pages that have PG_mlocked set = locked_vm - pages
456  pr_debug("%s: [%d] caller %ps %c%lu %lu/%lu%s\n", __func__, pid, (void * )_RET_IP_, (inc) ? '+' : '-', pages << PAGE_SHIFT determines the page size , locked_vm << PAGE_SHIFT determines the page size , task_rlimit(task, RLIMIT_MEMLOCK), ret ? " - exceeded" : "")
461  Return ret
Caller
NameDescribe
account_locked_vmaccount_locked_vm - account locked pages to an mm's locked_vm*@mm: mm to account against, may be NULL*@pages: number of pages to account*@inc: %true if @pages should be considered positive, %false if not* Assumes a non-NULL @mm is valid (i