函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:cgroup_init_subsys

函数原型:static void __init cgroup_init_subsys(struct cgroup_subsys *ss, bool early)

返回类型:void

参数:

类型参数名称
struct cgroup_subsys *ss
boolearly
5548  pr_debug("Initializing cgroup subsys %s\n", name)
5550  mutex_lock( & cgroup_mutex is the master lock)
5552  dr_init() - Initialise an IDR.*@idr: IDR handle.* Initialise a dynamically allocated IDR. To initialise a* statically allocated IDR, use DEFINE_IDR().
5553  初始化链表头
5556  link to parent, protected by cgroup_lock() 等于The default hierarchy, reserved for the subsystems that are otherwise* unattached - it never has more than a single cgroup, and all tasks are* part of that cgroup.
5557  css等于css_alloc(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)
5559  BUG_ON(是错误)
5560  init_and_link_css(css, ss, & The root cgroup. Root is destroyed on its release. )
5566  flags或等于CSS_NO_REF
5568  如果early
5570  PI: Subsys-unique ID. 0 is unused and root is always 1. The* matching css can be looked up using css_from_id().等于1
5571  否则
5572  PI: Subsys-unique ID. 0 is unused and root is always 1. The* matching css can be looked up using css_from_id().等于IDR wrappers which synchronize using cgroup_idr_lock
5573  BUG_ON(PI: Subsys-unique ID. 0 is unused and root is always 1. The* matching css can be looked up using css_from_id(). < 0)
5580  Set of subsystem states, one for each subsystem. This array is* immutable after creation apart from the init_css_set during* subsystem registration (at boot time).[ the following two fields are initialized automtically during boot ]等于css
5582  These bitmasks identify subsystems with specific features to avoid* having to do iterative checks repeatedly.或等于fork左移 the following two fields are initialized automtically during boot
5583  have_exit_callback或等于exit左移 the following two fields are initialized automtically during boot
5584  have_release_callback或等于release左移 the following two fields are initialized automtically during boot
5585  have_canfork_callback或等于can_fork左移 the following two fields are initialized automtically during boot
5590  BUG_ON(!链表为空)
5592  BUG_ON(voke ->css_online() on a new CSS and mark it online if successful )
5594  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
调用者
名称描述
cgroup_init_earlygroup_init_early - cgroup initialization at system boot* Initialize cgroups at system boot, and initialize any* subsystems that request early init.
cgroup_initgroup_init - cgroup initialization* Register cgroup filesystem and /proc file, and initialize* any subsystems that didn't request early init.