函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:mem_cgroup_alloc

函数原型:static struct mem_cgroup *mem_cgroup_alloc(void)

返回类型:struct mem_cgroup

参数:

4909  int __maybe_unused i
4911  size等于sizeof(structmem_cgroup)
4912  size加等于nr_node_ids乘*的长度
4914  memcg等于分配内存并置零
4915  如果非memcg则返回:NULL
4918  id等于dr_alloc() - Allocate an ID.*@idr: IDR handle.*@ptr: Pointer to be associated with the new ID.*@start: The minimum ID (inclusive).*@end: The maximum ID (exclusive).*@gfp: Memory allocation flags.
4921  如果id小于0则转到:fail
4924  Legacy local VM stats and events 等于alloc_percpu(structmemcg_vmstats_percpu)
4925  如果非 Legacy local VM stats and events 则转到:fail
4928  Subtree VM stats and events (batched updates) 等于alloc_percpu(structmemcg_vmstats_percpu)
4929  如果非 Subtree VM stats and events (batched updates) 则转到:fail
4932  for_each_node(node)
4933  如果alloc_mem_cgroup_per_node_info(memcg, node)则转到:fail
4936  如果memcg_wb_domain_init(memcg, GFP_KERNEL)则转到:fail
4939  INIT_WORK( & Range enforcement for interrupt charges , high_work_func)
4940  初始化链表头
4941  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & protect arrays of thresholds )
4942  spin_lock_init( & taken only while moving_account > 0 )
4943  vmpressure_init( & vmpressure notifications )
4944  初始化链表头
4945  spin_lock_init( & event_list_lock)
4946  socket_pressure等于jiffies
4957  spin_lock_init( & split_queue_lock)
4958  初始化链表头
4959  split_queue_len等于0
4961  dr_replace() - replace pointer for given ID
4962  返回:memcg
4963  fail :
4964  mem_cgroup_id_remove(memcg)
4965  __mem_cgroup_free(memcg)
4966  返回:NULL
调用者
名称描述
mem_cgroup_css_alloc