Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:int __init cgroup_init(void)

Type:int

Parameter:Nothing

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  If early_init Then
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  Else
5683  cgroup_init_subsys(ss, false)
5686  list_add_tail - add a new entry*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head.* This is useful for implementing queues.
5694  If cgroup_disable_mask & 1 << ssid Then
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  Continue
5701  If cgroup1_ssid_disabled(ssid) Then 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 * 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 * Then some controllers are implicitly enabled on the default hierarchy |= 1 << the following two fields are initialized automtically during boot
5712  Else if Not for the default hierarchy Then some controllers are not supported in the default hierarchy |= 1 << the following two fields are initialized automtically during boot
5715  If * 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 Then some controllers can be threaded on the default hierarchy |= 1 << the following two fields are initialized automtically during boot
5718  If for the default hierarchy == for the legacy hierarchies Then
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  Else
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  If bind Then bind(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  hash_del - remove an object from a hashtable*@node: &struct hlist_node of the object to remove
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  Return 0