Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\memcontrol.c Create Date:2022-07-28 16:14:10
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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

Proto:int mem_cgroup_try_charge(struct page *page, struct mm_struct *mm, gfp_t gfp_mask, struct mem_cgroup **memcgp, bool compound)

Type:int

Parameter:

TypeParameterName
struct page *page
struct mm_struct *mm
gfp_tgfp_mask
struct mem_cgroup **memcgp
boolcompound
6335  struct mem_cgroup * memcg = NULL
6336  nr_pages = If compound Then hpage_nr_pages(page) Else 1
6337  ret = 0
6339  If mem_cgroup_disabled() Then Go to out
6342  If PageSwapCache(page) Then
6350  VM_BUG_ON_PAGE(!PageLocked(page), page)
6351  If mem_cgroup Then Go to out
6355  swp_entry_t ent = {val = page_private(page), }
6366  If Not memcg Then memcg = 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  ss_put - put a css reference*@css: target css* Put a reference obtained via css_get() and css_tryget_online().
6372  out :
6373  memcgp = memcg
6374  Return ret
Caller
NameDescribe
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