Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:The guts of cgroup1 mount - find or create cgroup_root to use

Proto:static int cgroup1_root_to_use(struct fs_context *fc)

Type:int

Parameter:

TypeParameterName
struct fs_context *fc
1115  ctx = cgroup_fc2context(fc)
1121  ret = check_cgroupfs_options(fc)
1122  If ret Then Return ret
1133  If Not (Selected subsystems & 1 << i ) || 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. Then Continue
1137  If Not percpu_ref_tryget_live - try to increment a live percpu refcount*@ref: percpu_ref to try-get* Increment a percpu refcount unless it has already been killed Then Return 1
1139  cgroup_put( & The root cgroup. Root is destroyed on its release. )
1142  rate across the hierarchies (root)
1143  bool name_match = false
1145  If 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. Then Continue
1153  If Hierarchy name Then
1156  name_match = true
1165  If Not name_match Then Continue
1167  Return -EBUSY
1170  If Hierarchy-specific flags ^ CGRP_ROOT_* flags Then pr_warn("new mount options do not match the existing superblock, will be ignored\n")
1173  root = root
1174  Return 0
1182  If Not Selected subsystems && Not User explicitly requested empty subsystem Then Return cg_invalf(fc, "cgroup1: No subsys list or none specified")
1186  If ns != cgroup namespace for init task Then Return -EPERM
1189  root = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
1190  If Not root Then Return -ENOMEM
1193  root = root
1194  init_cgroup_root(ctx)
1196  ret = cgroup_setup_root(root, Selected subsystems )
1197  If ret Then cgroup_free_root(root)
1199  Return ret
Caller
NameDescribe
cgroup1_get_tree