Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:mem_cgroup_alloc

Proto:static struct mem_cgroup *mem_cgroup_alloc(void)

Type:struct mem_cgroup

Parameter:Nothing

4909  int __maybe_unused i
4911  size = sizeof(structmem_cgroup)
4912  size += nr_node_ids * size of *
4914  memcg = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
4915  If Not memcg Then Return 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  If id < 0 Then Go to fail
4924  Legacy local VM stats and events = alloc_percpu(structmemcg_vmstats_percpu)
4925  If Not Legacy local VM stats and events Then Go to fail
4928  Subtree VM stats and events (batched updates) = alloc_percpu(structmemcg_vmstats_percpu)
4929  If Not Subtree VM stats and events (batched updates) Then Go to fail
4932  for_each_node(node)
4933  If alloc_mem_cgroup_per_node_info(memcg, node) Then Go to fail
4936  If memcg_wb_domain_init(memcg, GFP_KERNEL) Then Go to fail
4939  INIT_WORK( & Range enforcement for interrupt charges , high_work_func)
4940  Initialization list head
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  Process spin lock initialization( & taken only while moving_account > 0 )
4943  vmpressure_init( & vmpressure notifications )
4944  Initialization list head
4945  Process spin lock initialization( & event_list_lock)
4946  socket_pressure = jiffies
4957  Process spin lock initialization( & split_queue_lock)
4958  Initialization list head
4959  split_queue_len = 0
4961  dr_replace() - replace pointer for given ID
4962  Return memcg
4963  fail :
4964  mem_cgroup_id_remove(memcg)
4965  __mem_cgroup_free(memcg)
4966  Return NULL
Caller
NameDescribe
mem_cgroup_css_alloc