函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:swap_cgroup_swapon

函数原型:int swap_cgroup_swapon(int type, unsigned long max_pages)

返回类型:int

参数:

类型参数名称
inttype
unsigned longmax_pages
174  如果非Whether the swap controller is active 则返回:0
177  length等于DIV_ROUND_UP(max_pages, SC_PER_PAGE)
178  array_size等于length乘*的长度
180  array等于vzalloc - allocate virtually contiguous memory with zero fill*@size: allocation size* Allocate enough pages to cover @size from the page level* allocator and map them into contiguous kernel virtual space
181  如果非array则转到:nomem
184  ctrl等于swap_cgroup_ctrl[type]
185  mutex_lock( & swap_cgroup_mutex)
186  length等于length
187  map等于array
188  spin_lock_init( & lock)
189  如果allocate buffer for swap_cgroup.
191  map = NULL
192  length等于0
193  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
194  vfree - release memory allocated by vmalloc()*@addr: memory base address* Free the virtually continuous memory area starting at @addr, as* obtained from vmalloc(), vmalloc_32() or __vmalloc()
195  转到:nomem
197  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
199  返回:0
200  nomem :
201  打印信息("couldn't allocate enough memory for swap_cgroup\n")
202  打印信息("swap_cgroup can be disabled by swapaccount=0 boot option\n")
203  返回:负ENOMEM
调用者
名称描述
SYSCALL_DEFINE2