函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:group_init - cgroup initialization* Register cgroup filesystem and /proc file, and initialize* any subsystems that didn't request early init.

函数原型:int __init cgroup_init(void)

返回类型:int

参数:

5647  BUILD_BUG_ON - break compile if a condition is true(CGROUP_SUBSYS_COUNT > 16)
5648  BUG_ON(cgroup_init_cftypes(NULL, cgroup_base_files))
5649  BUG_ON(cgroup_init_cftypes(NULL, cgroup-v1.c))
5651  cgroup_rstat_boot()
5657  _sync_enter_start - Force readers onto slow path for multiple updates*@rsp: Pointer to rcu_sync structure to use for synchronization* Must be called after rcu_sync_init() and before first use
5659  get_user_ns(user_ns)
5661  mutex_lock( & cgroup_mutex is the master lock)
5667  hash_add - add an object to a hashtable*@hashtable: hashtable to add to*@node: the &struct hlist_node of the object to be added*@key: the key of the object to be added(css_set_table, & List running through all cgroup groups in the same hash* slot. Protected by css_set_lock, css_set_hash(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).))
5670  BUG_ON(cgroup_setup_root( & 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., 0))
5672  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.
5675  如果early_init
5676  css等于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 ]
5679  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
5681  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)
5682  否则
5683  cgroup_init_subsys(ss, false)
5686  添加链表项
5694  如果cgroup_disable_mask按位与1左移ssid位则
5695  static_branch_disable(cgroup_subsys_enabled_key[ssid])
5696  printk - print a kernel message*@fmt: format string* This is printk(). It can be called from any context. We want it to work.* We try to grab the console_lock. If we succeed, it's easy - we log the* output and call the console drivers
5698  继续下一循环
5701  如果cgroup1_ssid_disabled(ssid)则printk - print a kernel message*@fmt: format string* This is printk(). It can be called from any context. We want it to work.* We try to grab the console_lock. If we succeed, it's easy - we log the* output and call the console drivers
5705  The bitmask of subsystems attached to this hierarchy 或等于1左移 the following two fields are initialized automtically during boot
5708  WARN_ON(* If %true, the controller, on the default hierarchy, doesn't show * up in "cgroup.controllers" or "cgroup.subtree_control", is * implicitly enabled on all cgroups on the default hierarchy, and * bypasses the "no internal process" constraint. This is for * && !* If %true, the controller, supports threaded mode on the default * hierarchy. In a threaded subtree, both process granularity and * no-internal-process constraint are ignored and a threaded * controllers should be able to handle that. * Note that as an im)
5710  如果* If %true, the controller, on the default hierarchy, doesn't show * up in "cgroup.controllers" or "cgroup.subtree_control", is * implicitly enabled on all cgroups on the default hierarchy, and * bypasses the "no internal process" constraint. This is for *some controllers are implicitly enabled on the default hierarchy 或等于1左移 the following two fields are initialized automtically during boot
5712  否则如果非 for the default hierarchy some controllers are not supported in the default hierarchy 或等于1左移 the following two fields are initialized automtically during boot
5715  如果* If %true, the controller, supports threaded mode on the default * hierarchy. In a threaded subtree, both process granularity and * no-internal-process constraint are ignored and a threaded * controllers should be able to handle that. * Note that as an imsome controllers can be threaded on the default hierarchy 或等于1左移 the following two fields are initialized automtically during boot
5718  如果 for the default hierarchy 恒等于 for the legacy hierarchies
5719  WARN_ON(group_add_cftypes - add an array of cftypes to a subsystem*@ss: target cgroup subsystem*@cfts: zero-length name terminated array of cftypes* Register @cfts to @ss)
5720  否则
5721  WARN_ON(group_add_dfl_cftypes - add an array of cftypes for default hierarchy*@ss: target cgroup subsystem*@cfts: zero-length name terminated array of cftypes* Similar to cgroup_add_cftypes() but the added files are only used for* the default hierarchy.)
5722  WARN_ON(group_add_legacy_cftypes - add an array of cftypes for legacy hierarchies*@ss: target cgroup subsystem*@cfts: zero-length name terminated array of cftypes* Similar to cgroup_add_cftypes() but the added files are only used for* the legacy hierarchies.)
5725  如果bindbind(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).[ssid])
5728  mutex_lock( & cgroup_mutex is the master lock)
5729  ss_populate_dir - create subsys files in a cgroup directory*@css: target css* On failure, no file is added.
5730  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.
5734  从哈希表移除对象
5735  hash_add - add an object to a hashtable*@hashtable: hashtable to add to*@node: the &struct hlist_node of the object to be added*@key: the key of the object to be added(css_set_table, & List running through all cgroup groups in the same hash* slot. Protected by css_set_lock, css_set_hash(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).))
5738  WARN_ON(sysfs_create_mount_point(/sys/fs , "cgroup"))
5739  WARN_ON(register_filesystem( & cgroup_fs_type))
5740  WARN_ON(register_filesystem( & cgroup2_fs_type))
5741  WARN_ON(!proc_create_single("cgroups", 0, NULL, proc_cgroupstats_show))
5746  返回:0
调用者
名称描述
start_kernel启动内核