Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:hugetlb_cgroup_charge_cgroup

Proto:int hugetlb_cgroup_charge_cgroup(int idx, unsigned long nr_pages, struct hugetlb_cgroup **ptr)

Type:int

Parameter:

TypeParameterName
intidx
unsigned longnr_pages
struct hugetlb_cgroup **ptr
184  ret = 0
186  struct hugetlb_cgroup * h_cg = NULL
188  If hugetlb_cgroup_disabled() Then Go to done
194  If huge_page_order( & hstates[idx]) < Minimum page order trackable by hugetlb cgroup.* At least 3 pages are necessary for all the tracking information. Then Go to done
196  again :
197  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
198  h_cg = hugetlb_cgroup_from_task(current process)
199  If Not ss_tryget - try to obtain a reference on the specified css*@css: target css* Obtain a reference on @css unless it already has reached zero and is* being released. This function doesn't care whether @css is on or* offline Then
200  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
201  Go to again
203  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
205  If Not 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 Then ret = -ENOMEM
207  ss_put - put a css reference*@css: target css* Put a reference obtained via css_get() and css_tryget_online().
208  done :
209  ptr = h_cg
210  Return ret
Caller
NameDescribe
alloc_huge_page