Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__mem_cgroup_usage_unregister_event

Proto:static void __mem_cgroup_usage_unregister_event(struct mem_cgroup *memcg, struct eventfd_ctx *eventfd, enum res_type type)

Type:void

Parameter:

TypeParameterName
struct mem_cgroup *memcg
struct eventfd_ctx *eventfd
enum res_typetype
4032  mutex_lock( & protect arrays of thresholds )
4034  If type == _MEM Then
4035  thresholds = thresholds for memory usage. RCU-protected
4036  usage = mem_cgroup_usage(memcg, false)
4037  Else if type == _MEMSWAP Then
4038  thresholds = thresholds for mem+swap usage. RCU-protected
4039  usage = mem_cgroup_usage(memcg, true)
4040  Else BUG()
4043  If Not Primary thresholds array Then Go to unlock
4047  __mem_cgroup_threshold(memcg, type == _MEMSWAP)
4050  size = 0
4051  When i < Size of entries[] cycle
4052  If eventfd != eventfd Then size++
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  If Not size Then
4060  kfree(new)
4061  new = NULL
4062  Go to swap_buffers
4065  Size of entries[] = size
4068  An array index points to threshold just below or equal to usage. = -1
4069  When i < Size of entries[] cycle
4070  If eventfd == eventfd Then Continue
4073  Array of thresholds [j] = Array of thresholds [i]
4074  If threshold <= usage Then
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  If Not new Then
4096  kfree(* 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.)
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.
Caller
NameDescribe
mem_cgroup_usage_unregister_event
memsw_cgroup_usage_unregister_event