Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:mem_cgroup_iter - iterate over memory cgroup hierarchy*@root: hierarchy root*@prev: previously returned memcg, NULL on first invocation*@reclaim: cookie for shared reclaim walks, NULL for full walks* Returns references to children of the hierarchy below

Proto:struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *root, struct mem_cgroup *prev, struct mem_cgroup_reclaim_cookie *reclaim)

Type:struct mem_cgroup

Parameter:

TypeParameterName
struct mem_cgroup *root
struct mem_cgroup *prev
struct mem_cgroup_reclaim_cookie *reclaim
1010  iter = iter
1011  struct cgroup_subsys_state * css = NULL
1012  struct mem_cgroup * memcg = NULL
1013  struct mem_cgroup * pos = NULL
1015  If mem_cgroup_disabled() Then Return NULL
1018  If Not root Then root = root_mem_cgroup
1021  If prev && Not reclaim Then pos = prev
1024  If Not * Should the accounting and control be hierarchical, per subtree? && root != root_mem_cgroup Then
1025  If prev Then Go to out
1027  Return root
1030  _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
1032  If reclaim Then
1035  mz = mem_cgroup_nodeinfo(root, node_id)
1036  iter = iter
1038  If prev && generation != scan generation, increased every round-trip Then Go to out_unlock
1041  When 1 cycle
1042  pos = READ_ONCE(position)
1053  cmpxchg( & position, pos, NULL)
1057  If pos Then css = css
1060  cycle
1061  css = ss_next_descendant_pre - find the next descendant for pre-order walk*@pos: the current position (%NULL to initiate traversal)*@root: css whose descendants to walk* To be used by css_for_each_descendant_pre(). Find the next descendant
1062  If Not css Then
1069  If Not prev Then Continue
1071  Break
1079  memcg = mem_cgroup_from_css(css)
1081  If css == css Then Break
1084  If 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 Break
1087  memcg = NULL
1090  If reclaim Then
1096  cmpxchg( & position, pos, memcg)
1098  If pos Then ss_put - put a css reference*@css: target css* Put a reference obtained via css_get() and css_tryget_online().
1101  If Not memcg Then scan generation, increased every round-trip ++
1103  Else if Not prev Then generation = scan generation, increased every round-trip
1107  out_unlock :
1108  _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()
1109  out :
1110  If prev && prev != root Then ss_put - put a css reference*@css: target css* Put a reference obtained via css_get() and css_tryget_online().
1113  Return memcg
Caller
NameDescribe
drop_slab_node
shrink_node_memcgs
age_active_anon
mem_cgroup_soft_reclaim