函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\util.c Create Date:2022-07-27 15:45:49
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__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

函数原型:int __account_locked_vm(struct mm_struct *mm, unsigned long pages, bool inc, struct task_struct *task, bool bypass_rlim)

返回类型:int

参数:

类型参数名称
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  如果inc
444  如果非bypass_rlim
446  如果locked_vmpages大于limitret等于负ENOMEM
449  如果非ret Pages that have PG_mlocked set 等于locked_vmpages
451  否则
452  WARN_ON_ONCE(pages > locked_vm)
453  Pages that have PG_mlocked set 等于locked_vmpages
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  返回:ret
调用者
名称描述
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