函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__mem_cgroup_usage_unregister_event

函数原型:static void __mem_cgroup_usage_unregister_event(struct mem_cgroup *memcg, struct eventfd_ctx *eventfd, enum res_type type)

返回类型:void

参数:

类型参数名称
struct mem_cgroup *memcg
struct eventfd_ctx *eventfd
enum res_typetype
4032  mutex_lock( & protect arrays of thresholds )
4034  如果type恒等于_MEM
4035  thresholds等于 thresholds for memory usage. RCU-protected
4036  usage等于mem_cgroup_usage(memcg, false)
4037  否则如果type恒等于_MEMSWAP
4038  thresholds等于 thresholds for mem+swap usage. RCU-protected
4039  usage等于mem_cgroup_usage(memcg, true)
4040  否则BUG()
4043  如果非 Primary thresholds array 则转到:unlock
4047  __mem_cgroup_threshold(memcg, type == _MEMSWAP)
4050  size等于0
4051 i小于Size of entries[] 循环
4052  如果eventfd不等于eventfdsize自加
4056  new等于* Spare threshold array. * This is needed to make mem_cgroup_unregister_event() "never fail". * It must be able to store at least primary->size - 1 entries.
4059  如果非size
4060  释放内存
4061  new = NULL
4062  转到:swap_buffers
4065  Size of entries[] 等于size
4068  An array index points to threshold just below or equal to usage. 等于负1
4069 i小于Size of entries[] 循环
4070  如果eventfd恒等于eventfd则继续下一循环
4073  Array of thresholds [j]等于Array of thresholds [i]
4074  如果threshold小于等于usage
4082  j自加
4085  swap_buffers :
4087  * Spare threshold array. * This is needed to make mem_cgroup_unregister_event() "never fail". * It must be able to store at least primary->size - 1 entries.等于 Primary thresholds array
4089  cu_assign_pointer() - assign to RCU-protected pointer*@p: pointer to assign to*@v: value to assign (publish)* Assigns the specified value to the specified RCU-protected* pointer, ensuring that any concurrent RCU readers will see* any prior initialization( Primary thresholds array , new)
4092  Wait for a grace period to elapse. But it is illegal to invoke* synchronize_rcu() from within an RCU read-side critical section.* Therefore, any legal call to synchronize_rcu() is a quiescent
4095  如果非new
4096  释放内存
4097  * Spare threshold array. * This is needed to make mem_cgroup_unregister_event() "never fail". * It must be able to store at least primary->size - 1 entries. = NULL
4099  unlock :
4100  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
调用者
名称描述
mem_cgroup_usage_unregister_event
memsw_cgroup_usage_unregister_event