函数逻辑报告 |
Source Code:mm\util.c |
Create Date:2022-07-27 15:46:12 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称:Check that a process has enough memory to allocate a new virtual* mapping. 0 means there is enough memory for the allocation to* succeed and -ENOMEM implies there is not.* We currently support three overcommit policies, which are set via the* vm
函数原型:int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin)
返回类型:int
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| struct mm_struct * | mm | |
| long | pages | |
| int | cap_sys_admin |
| 801 | VM_WARN_ONCE(percpu_counter_read( & Make sure vm_committed_as in one cacheline and not cacheline shared with* other variables. It can be updated by several CPUs frequently.) < - (s64)vm_committed_as_batch * num_online_cpus(), "memory commitment underflow") |
| 805 | vm_acct_memory(pages) |
| 810 | 如果sysctl_overcommit_memory恒等于OVERCOMMIT_ALWAYS则返回:0 |
| 813 | 如果sysctl_overcommit_memory恒等于OVERCOMMIT_GUESS则 |
| 814 | 如果pages大于totalram_pages()加total_swap_pages则转到:error |
| 816 | 返回:0 |
| 823 | 如果非cap_sys_admin则allowed减等于sysctl_admin_reserve_kbytes右移PAGE_SHIFT determines the page size 减10位 |
| 829 | 如果mm则 |
| 835 | 如果percpu_counter is intended to track positive numbers. In the UP case the* number should never be negative.小于allowed则返回:0 |
| 837 | error : |
| 838 | vm_unacct_memory(pages) |
| 840 | 返回:负ENOMEM |
| 名称 | 描述 |
|---|---|
| security_vm_enough_memory_mm |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |