Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:css_create

Proto:static struct cgroup_subsys_state *css_create(struct cgroup *cgrp, struct cgroup_subsys *ss)

Type:struct cgroup_subsys_state

Parameter:

TypeParameterName
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  If Not css Then css = ERR_PTR( - ENOMEM)
5101  If IS_ERR(css) Then Return 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  If err Then Go to err_free_css
5110  err = IDR wrappers which synchronize using cgroup_idr_lock
5111  If err < 0 Then Go to 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  list_add_tail_rcu - add a new entry to rcu-protected list*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head
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  If err Then Go to err_list_del
5123  If * 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 && Not warned_broken_hierarchy && cgroup_parent(parent) Then
5125  pr_warn("%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  If Not strcmp(name, "memory") Then pr_warn("\"memory\" requires setting use_hierarchy to 1 on the root\n")
5129  warned_broken_hierarchy = true
5132  Return css
5134  err_list_del :
5135  list_del_rcu - deletes entry from list without re-initialization*@entry: the element to delete from the list
5136  err_free_css :
5137  list_del_rcu - deletes entry from list without re-initialization*@entry: the element to delete from the list
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  Return ERR_PTR(err)
Caller
NameDescribe
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