函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:css_create

函数原型:static struct cgroup_subsys_state *css_create(struct cgroup *cgrp, struct cgroup_subsys *ss)

返回类型:struct cgroup_subsys_state

参数:

类型参数名称
struct cgroup *cgrp
struct cgroup_subsys *ss
5091  parent等于cgroup_parent(cgrp)
5092  parent_css等于group_css - obtain a cgroup's css for the specified subsystem*@cgrp: the cgroup of interest*@ss: the subsystem of interest (%NULL returns @cgrp->self)* Return @cgrp's css (cgroup_subsys_state) associated with @ss
5096  lockdep_assert_held( & cgroup_mutex is the master lock)
5098  css等于css_alloc(parent_css)
5099  如果非csscss等于错误号
5101  如果是错误则返回:css
5104  init_and_link_css(css, ss, cgrp)
5106  err等于percpu_ref_init - initialize a percpu refcount*@ref: percpu_ref to initialize*@release: function which will be called when refcount hits 0*@flags: PERCPU_REF_INIT_* flags*@gfp: allocation mask to use* Initializes @ref
5107  如果err则转到:err_free_css
5110  err等于IDR wrappers which synchronize using cgroup_idr_lock
5111  如果err小于0则转到:err_free_css
5113  PI: Subsys-unique ID. 0 is unused and root is always 1. The* matching css can be looked up using css_from_id().等于err
5116  添加RCU链表项
5117  cgroup_idr_replace( & idr for css->id , css, PI: Subsys-unique ID. 0 is unused and root is always 1. The* matching css can be looked up using css_from_id().)
5119  err等于voke ->css_online() on a new CSS and mark it online if successful
5120  如果err则转到:err_list_del
5123  如果* 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且非warned_broken_hierarchycgroup_parent(parent)则
5125  打印警告信息("%s (%d) created nested cgroup for controller \"%s\" which has incomplete hierarchy support. Nested cgroups may change behavior in the future.\n", comm, pid, name)
5127  如果非字符串比较打印警告信息("\"memory\" requires setting use_hierarchy to 1 on the root\n")
5129  warned_broken_hierarchy = true
5132  返回:css
5134  err_list_del :
5135  删除不需要重新初始化的列表项
5136  err_free_css :
5137  删除不需要重新初始化的列表项
5138  INIT_RCU_WORK( & destroy_rwork, ss destruction is four-stage process)
5139  queue_rcu_work - queue work after a RCU grace period*@wq: workqueue to use*@rwork: work to queue* Return: %false if @rwork was already pending, %true otherwise
5140  返回:错误号
调用者
名称描述
cgroup_apply_control_enablegroup_apply_control_enable - enable or show csses according to control*@cgrp: root of the target subtree* Walk @cgrp's subtree and create new csses or make the existing ones* visible. A css is created invisible if it's being implicitly enabled