Function report |
Source Code:mm\memcontrol.c |
Create Date:2022-07-28 16:10:47 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:try_charge
Proto:static int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask, unsigned int nr_pages)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct mem_cgroup * | memcg | |
gfp_t | gfp_mask | |
unsigned int | nr_pages |
2395 | bool may_swap = true |
2396 | bool drained = false |
2399 | If mem_cgroup_is_root(memcg) Then Return 0 |
2401 | retry : |
2412 | Else |
2414 | may_swap = false |
2437 | If Value for the false possibility is greater at compile time(should_force_charge()) Then Go to force |
2446 | If Value for the false possibility is greater at compile time(flags & Allocating memory ) Then Go to force |
2449 | If Value for the false possibility is greater at compile time(task_in_memcg_oom(current process)) Then Go to nomem |
2452 | If Not gfpflags_allow_blocking(gfp_mask) Then Go to nomem |
2463 | If Not drained Then |
2464 | Drains all per-CPU charge caches for given root_memcg resp. subtree* of the hierarchy under it. |
2465 | drained = true |
2466 | Go to retry |
2469 | If gfp_mask & __GFP_NORETRY Then Go to nomem |
2486 | If mem_cgroup_wait_acct_move(mem_over_limit) Then Go to retry |
2489 | If nr_retries-- Then Go to retry |
2492 | If gfp_mask & __GFP_RETRY_MAYFAIL Then Go to nomem |
2495 | If gfp_mask & __GFP_NOFAIL Then Go to force |
2498 | If fatal_signal_pending(current process) Then Go to force |
2509 | Case oom_status == OOM_SUCCESS |
2511 | Go to retry |
2512 | Case oom_status == OOM_FAILED |
2513 | Go to force |
2514 | Default |
2515 | Go to nomem |
2517 | nomem : |
2518 | If Not (gfp_mask & __GFP_NOFAIL) Then Return -ENOMEM |
2520 | force : |
2531 | Return 0 |
2533 | done_restock : |
2535 | If batch > nr_pages Then Cache charges(val) to local per_cpu area.* This will be consumed by consume_stock() function, later. |
2547 | Do |
2548 | If page_counter_read( & Accounted resources ) > Upper bound of normal memory consumption range Then |
2560 | Return 0 |
Name | Describe |
---|---|
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. |
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 |