函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

函数原型:struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *root, struct mem_cgroup *prev, struct mem_cgroup_reclaim_cookie *reclaim)

返回类型:struct mem_cgroup

参数:

类型参数名称
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  如果mem_cgroup_disabled()则返回:NULL
1018  如果非rootroot等于root_mem_cgroup
1021  如果prev且非reclaimpos等于prev
1024  如果非* Should the accounting and control be hierarchical, per subtree?root不等于root_mem_cgroup
1025  如果prev则转到:out
1027  返回: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  如果reclaim
1035  mz等于mem_cgroup_nodeinfo(root, 全局结点ID)
1036  iter等于iter
1038  如果prevgeneration不等于 scan generation, increased every round-trip 则转到:out_unlock
1041  当1循环
1042  pos等于READ_ONCE(position)
1053  cmpxchg( & position, pos, NULL)
1057  如果poscss等于css
1060  循环
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  如果非css
1069  如果非prev则继续下一循环
1071  退出
1079  memcg等于mem_cgroup_from_css(css)
1081  如果css恒等于css退出
1084  如果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退出
1087  memcg = NULL
1090  如果reclaim
1096  cmpxchg( & position, pos, memcg)
1098  如果pos设置一个css引用
1101  如果非memcg scan generation, increased every round-trip 自加
1103  否则如果非prevgeneration等于 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  如果prevprev不等于root设置一个css引用
1113  返回:memcg
调用者
名称描述
drop_slab_node
shrink_node_memcgs
age_active_anon
mem_cgroup_soft_reclaim