Function report |
Source Code:mm\memcontrol.c |
Create Date:2022-07-28 16:14:46 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:mem_cgroup_try_charge_swap - try charging swap space for a page*@page: page being added to swap*@entry: swap entry to charge* Try to charge @page's memcg for the swap space at @entry.* Returns 0 on success, -ENOMEM on failure.
Proto:int mem_cgroup_try_charge_swap(struct page *page, swp_entry_t entry)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct page * | page | |
| swp_entry_t | entry |
| 6930 | nr_pages = hpage_nr_pages(page) |
| 6935 | If Not cgroup_subsys_on_dfl - fast test on whether a subsys is on default hierarchy*@ss: subsystem in question(memory_cgrp_subsys) || Not Whether the swap controller is active Then Return 0 |
| 6938 | memcg = mem_cgroup |
| 6941 | If Not memcg Then Return 0 |
| 6944 | If Not val Then |
| 6946 | Return 0 |
| 6949 | memcg = mem_cgroup_id_get_online(memcg) |
| 6955 | mem_cgroup_id_put(memcg) |
| 6956 | Return -ENOMEM |
| 6960 | If nr_pages > 1 Then mem_cgroup_id_get_many(memcg, nr_pages - 1) |
| 6962 | oldid = swap_cgroup_record(entry, mem_cgroup_id(memcg), nr_pages) |
| 6963 | VM_BUG_ON_PAGE(oldid, page) |
| 6966 | Return 0 |
| 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 |