函数逻辑报告 |
Source Code:mm\memcontrol.c |
Create Date:2022-07-27 17:45:14 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:try_charge
函数原型:static int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask, unsigned int nr_pages)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct mem_cgroup * | memcg | |
gfp_t | gfp_mask | |
unsigned int | nr_pages |
2390 | batch等于两数取大(size of first charge trial. "32" comes from vmscan.c's magic value.* TODO: maybe necessary to use big numbers in big irons., nr_pages) |
2395 | bool may_swap = true |
2396 | bool drained = false |
2399 | 如果mem_cgroup_is_root(memcg)则返回:0 |
2401 | retry : |
2412 | 否则 |
2414 | may_swap = false |
2437 | 如果此条件成立可能性小(为编译器优化)(should_force_charge())则转到:force |
2446 | 如果此条件成立可能性小(为编译器优化)(flags & Allocating memory )则转到:force |
2449 | 如果此条件成立可能性小(为编译器优化)(task_in_memcg_oom(当前进程))则转到:nomem |
2452 | 如果非gfpflags_allow_blocking(gfp_mask)则转到:nomem |
2460 | 如果mem_cgroup_margin - calculate chargeable space of a memory cgroup*@memcg: the memory cgroup* Returns the maximum amount of memory @mem can be charged with, in* pages.大于等于nr_pages则转到:retry |
2463 | 如果非drained则 |
2464 | Drains all per-CPU charge caches for given root_memcg resp. subtree* of the hierarchy under it. |
2465 | drained = true |
2466 | 转到:retry |
2469 | 如果gfp_mask按位与__GFP_NORETRY则转到:nomem |
2486 | 如果mem_cgroup_wait_acct_move(mem_over_limit)则转到:retry |
2489 | 如果nr_retries自减则转到:retry |
2492 | 如果gfp_mask按位与__GFP_RETRY_MAYFAIL则转到:nomem |
2495 | 如果gfp_mask按位与__GFP_NOFAIL则转到:force |
2498 | 如果fatal_signal_pending(当前进程)则转到:force |
2509 | 当:oom_status恒等于OOM_SUCCESS |
2511 | 转到:retry |
2512 | 当:oom_status恒等于OOM_FAILED |
2513 | 转到:force |
2514 | 默认 |
2515 | 转到:nomem |
2517 | nomem : |
2518 | 如果非gfp_mask按位与__GFP_NOFAIL的值则返回:负ENOMEM |
2520 | force : |
2529 | 获取指定CSS参考 |
2531 | 返回:0 |
2533 | done_restock : |
2534 | 获取指定CSS参考 |
2535 | 如果batch大于nr_pages则Cache charges(val) to local per_cpu area.* This will be consumed by consume_stock() function, later. |
2547 | 循环 |
2560 | 返回:0 |
名称 | 描述 |
---|---|
mem_cgroup_do_precharge | Handlers for move charge at task migration. |
mem_cgroup_try_charge | mem_cgroup_try_charge - try charging a page*@page: page to charge*@mm: mm context of the victim*@gfp_mask: reclaim mode*@memcgp: charged memcg return*@compound: charge the page as compound or small page* Try to charge @page to the memcg that @mm belongs |
mem_cgroup_charge_skmem | mem_cgroup_charge_skmem - charge socket memory*@memcg: memcg to charge*@nr_pages: number of pages to charge* Charges @nr_pages to @memcg. Returns %true if the charge fit within*@memcg's configured limit, %false if the charge had to be forced. |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |