| Function report | 
| Source Code: mm\swap_cgroup.c | Create Date:2022-07-28 16:15:53 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:swap_cgroup_swapon
Proto:int swap_cgroup_swapon(int type, unsigned long max_pages)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| int | type | |
| unsigned long | max_pages | 
| 174 | If Not Whether the swap controller is active Then Return 0 | 
| 177 | length = DIV_ROUND_UP(max_pages, SC_PER_PAGE) | 
| 178 | array_size = length * size of * | 
| 184 | ctrl = swap_cgroup_ctrl[type] | 
| 185 | mutex_lock( & swap_cgroup_mutex) | 
| 188 | Process spin lock initialization( & lock) | 
| 189 | If allocate buffer for swap_cgroup. Then | 
| 199 | Return 0 | 
| 200 | nomem : | 
| 201 | pr_info("couldn't allocate enough memory for swap_cgroup\n") | 
| 202 | pr_info("swap_cgroup can be disabled by swapaccount=0 boot option\n") | 
| 203 | Return -ENOMEM | 
| Name | Describe | 
|---|---|
| SYSCALL_DEFINE2 | 
| Source code conversion tool public plug-in interface | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |