Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:mem_cgroup_css_alloc

Proto:static struct cgroup_subsys_state *__ref mem_cgroup_css_alloc(struct cgroup_subsys_state *parent_css)

Type:struct cgroup_subsys_state

Parameter:

TypeParameterName
struct cgroup_subsys_state *parent_css
4972  parent = mem_cgroup_from_css(parent_css)
4974  error = -ENOMEM
4976  memcg = mem_cgroup_alloc()
4977  If Not memcg Then Return ERR_PTR(error)
4980  Upper bound of normal memory consumption range = PAGE_COUNTER_MAX
4981  soft_limit = PAGE_COUNTER_MAX
4982  If parent Then
4983  swappiness = mem_cgroup_swappiness(parent)
4984  OOM-Killer disable = OOM-Killer disable
4986  If parent && * Should the accounting and control be hierarchical, per subtree? Then
4987  * Should the accounting and control be hierarchical, per subtree? = true
4988  page_counter_init( & Accounted resources , & Accounted resources )
4989  page_counter_init( & swap, & swap)
4990  page_counter_init( & Legacy consumer-oriented counters , & Legacy consumer-oriented counters )
4991  page_counter_init( & kmem, & kmem)
4992  page_counter_init( & tcpmem, & tcpmem)
4993  Else
4994  page_counter_init( & Accounted resources , NULL)
4995  page_counter_init( & swap, NULL)
4996  page_counter_init( & Legacy consumer-oriented counters , NULL)
4997  page_counter_init( & kmem, NULL)
4998  page_counter_init( & tcpmem, NULL)
5004  If parent != root_mem_cgroup Then * If %false, this subsystem is properly hierarchical - * configuration, resource accounting and restriction on a parent * cgroup cover those of its children. If %true, hierarchy support * is broken in some ways - some subsystems ignore hierarchy * complete = true
5009  If Not parent Then
5013  root_mem_cgroup = memcg
5014  Return css
5017  error = memcg_online_kmem(memcg)
5018  If error Then Go to fail
5021  If cgroup_subsys_on_dfl - fast test on whether a subsys is on default hierarchy*@ss: subsystem in question(memory_cgrp_subsys) && Not Socket memory accounting disabled? Then Advanced usage; refcount, branch is enabled when: count != 0( & memcg_sockets_enabled_key)
5024  Return css
5025  fail :
5026  mem_cgroup_id_remove(memcg)
5027  mem_cgroup_free(memcg)
5028  Return ERR_PTR( - ENOMEM)