函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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

函数原型:int mem_cgroup_try_charge(struct page *page, struct mm_struct *mm, gfp_t gfp_mask, struct mem_cgroup **memcgp, bool compound)

返回类型:int

参数:

类型参数名称
struct page *page
struct mm_struct *mm
gfp_tgfp_mask
struct mem_cgroup **memcgp
boolcompound
6335  struct mem_cgroup * memcg = NULL
6336  nr_pages等于如果compoundhpage_nr_pages(page)否则1
6337  ret等于0
6339  如果mem_cgroup_disabled()则转到:out
6342  如果PageSwapCache(page)则
6350  VM_BUG_ON_PAGE(!PageLocked(page), page)
6351  如果mem_cgroup则转到:out
6355  swp_entry_t ent = {val = page_private(page), }
6366  如果非memcgmemcg等于get_mem_cgroup_from_mm: Obtain a reference on given mm_struct's memcg.*@mm: mm from which memcg should be extracted. It can be NULL.* Obtain a reference on mm->memcg and returns it if successful. Otherwise* root_mem_cgroup is returned
6369  ret等于try_charge(memcg, gfp_mask, nr_pages)
6371  设置一个css引用
6372  out :
6373  memcgp等于memcg
6374  返回:ret
调用者
名称描述
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.
collapse_huge_page
mem_cgroup_try_charge_delay
mcopy_atomic_pte
__replace_page__replace_page - replace page in vma by new page
__add_to_page_cache_locked