函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\memcontrol.c Create Date:2022-07-27 17:48:44
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:mem_cgroup_commit_charge - commit a page charge*@page: page to charge*@memcg: memcg to charge the page to*@lrucare: page might be on LRU already*@compound: charge the page as compound or small page* Finalize a charge transaction started by

函数原型:void mem_cgroup_commit_charge(struct page *page, struct mem_cgroup *memcg, bool lrucare, bool compound)

返回类型:void

参数:

类型参数名称
struct page *page
struct mem_cgroup *memcg
boollrucare
boolcompound
6410  nr_pages等于如果compoundhpage_nr_pages(page)否则1
6412  VM_BUG_ON_PAGE(! See page-flags.h for PAGE_MAPPING_FLAGS , page)
6413  VM_BUG_ON_PAGE(PageLRU(page) && !lrucare, page)
6415  如果mem_cgroup_disabled()则返回
6422  如果非memcg则返回
6425  commit_charge(page, memcg, lrucare)
6427  禁止中断()
6428  mem_cgroup_charge_statistics(memcg, page, compound, nr_pages)
6429  Check events in order.
6430  开中断()
6432  如果Whether legacy memory+swap accounting is active PageSwapCache(page)则
6433  swp_entry_t entry = {val = page_private(page)}
6439  mem_cgroup_uncharge_swap - uncharge swap space*@entry: swap entry to uncharge*@nr_pages: the amount of swap space to uncharge
调用者
名称描述
wp_page_copyHandle the case of a page which we actually need to copy to a new page.* Called with mmap_sem locked and the old page referenced, but* without the ptl held.* High level logic flow:* - Allocate a page, copy the content of the old page to the new one.
do_swap_pageWe enter with non-exclusive mmap_sem (to exclude vma changes,* but allow concurrent faults), and pte mapped but not yet locked.* We return with pte unmapped and unlocked.* We return with the mmap_sem locked or unlocked in the same cases
do_anonymous_pageWe enter with non-exclusive mmap_sem (to exclude vma changes,* but allow concurrent faults), and pte mapped but not yet locked.* We return with mmap_sem still held, but pte unmapped and unlocked.
alloc_set_ptealloc_set_pte - setup new PTE entry for given page and add reverse page* mapping
unuse_pteNo need to decide whether this PTE shares the swap entry with others,* just let do_wp_page work it out if a write is requested later - to* force COW, vm_page_prot omits write permission from any private vma.
__do_huge_pmd_anonymous_page
do_huge_pmd_wp_page_fallback
do_huge_pmd_wp_page
collapse_huge_page
mcopy_atomic_pte
__replace_page__replace_page - replace page in vma by new page
__add_to_page_cache_locked