Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:page_counter_try_charge - try to hierarchically charge pages*@counter: counter*@nr_pages: number of pages to charge*@fail: points first counter to hit its limit, if any* Returns %true on success, or %false and @fail if the counter or one

Proto:bool page_counter_try_charge(struct page_counter *counter, unsigned long nr_pages, struct page_counter **fail)

Type:bool

Parameter:

TypeParameterName
struct page_counter *counter
unsigned longnr_pages
struct page_counter **fail
105  When c cycle
121  new = atomic_long_add_return(nr_pages, & usage)
122  If new > max Then
129  failcnt++
130  fail = c
131  Go to failed
133  propagate_protected_usage(counter, new)
138  If new > legacy Then legacy = new
141  Return true
143  failed :
144  When c != fail cycle page_counter_cancel - take pages out of the local counter*@counter: counter*@nr_pages: number of pages to cancel
147  Return false
Caller
NameDescribe
try_charge
mem_cgroup_charge_skmemmem_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.
mem_cgroup_try_charge_swapmem_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.
hugetlb_cgroup_charge_cgroup