函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:mem_cgroup_protected - check if memory consumption is in the normal range*@root: the top ancestor of the sub-tree being checked*@memcg: the memory cgroup to check* WARNING: This function is not stateless! It can only be used as part

函数原型:enum mem_cgroup_protection mem_cgroup_protected(struct mem_cgroup *root, struct mem_cgroup *memcg)

返回类型:enum mem_cgroup_protection

参数:

类型参数名称
struct mem_cgroup *root
struct mem_cgroup *memcg
6250  如果mem_cgroup_disabled()则返回:MEMCG_PROT_NONE
6253  如果非rootroot等于root_mem_cgroup
6255  如果memcg恒等于root则返回:MEMCG_PROT_NONE
6258  usage等于page_counter_read( & Accounted resources )
6259  如果非usage则返回:MEMCG_PROT_NONE
6262  emin等于min
6263  elow等于low
6265  parent等于parent_mem_cgroup - find the accounting parent of a memcg*@memcg: memcg whose parent to find* Returns the parent memcg, or NULL if this is the root or the memory* controller is in legacy no-hierarchy mode.
6267  如果非parent则返回:MEMCG_PROT_NONE
6270  如果parent恒等于root则转到:exit
6273  parent_emin等于READ_ONCE( effective memory.min and memory.min usage tracking )
6274  emin等于两数取小(emin, parent_emin)
6275  如果eminparent_emin
6278  min_usage等于两数取小(usage, min)
6279  siblings_min_usage等于atomic_long_read( & children_min_usage)
6282  如果min_usagesiblings_min_usageemin等于两数取小(emin, parent_emin * min_usage / siblings_min_usage)
6287  parent_elow等于READ_ONCE( effective memory.low and memory.low usage tracking )
6288  elow等于两数取小(elow, parent_elow)
6289  如果elowparent_elow
6292  low_usage等于两数取小(usage, low)
6293  siblings_low_usage等于atomic_long_read( & children_low_usage)
6296  如果low_usagesiblings_low_usageelow等于两数取小(elow, parent_elow * low_usage / siblings_low_usage)
6301  exit :
6302  effective memory.min and memory.min usage tracking 等于emin
6303  effective memory.low and memory.low usage tracking 等于elow
6305  如果usage小于等于emin则返回:MEMCG_PROT_MIN
6307  否则如果usage小于等于elow则返回:MEMCG_PROT_LOW
6309  否则返回:MEMCG_PROT_NONE
调用者
名称描述
shrink_node_memcgs