函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:cgroup_setup_root

函数原型:int cgroup_setup_root(struct cgroup_root *root, u16 ss_mask)

返回类型:int

参数:

类型参数名称
struct cgroup_root *root
u16ss_mask
1929  LIST_HEAD(tmp_links)
1930  root_cgrp等于 The root cgroup. Root is destroyed on its release.
1935  lockdep_assert_held( & cgroup_mutex is the master lock)
1937  ret等于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
1939  如果ret则转到:out
1949  ret等于allocate_cgrp_cset_links - allocate cgrp_cset_links*@count: the number of links to allocate*@tmp_links: list_head the allocated links are put on* Allocate @count cgrp_cset_link structures and chain them on @tmp_links* through ->cset_link
1950  如果ret则转到:cancel_ref
1953  ret等于cgroup_init_root_id(root)
1954  如果ret则转到:cancel_ref
1957  kf_sops等于如果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.A task must hold cgroup_mutex to modify cgroups.* Any task can increment and decrement the count field without lock.* So in general, code holding cgroup_mutex can't rely on the count* field not changing. However, if the count goes to zero, then only否则cgroup1_kf_syscall_ops
1960  kf_root等于kernfs_create_root(kf_sops, KERNFS_ROOT_CREATE_DEACTIVATED | KERNFS_ROOT_SUPPORT_EXPORTOP, root_cgrp)
1964  如果是错误
1965  ret等于错误
1966  转到:exit_root_id
1968  cgroup kernfs entry 等于 published fields
1969  WARN_ON_ONCE(rns ino associated with a cgroup != 1)
1970  ids of the ancestors at each level including self [0]等于Inline functions.
1972  ret等于ss_populate_dir - create subsys files in a cgroup directory*@css: target css* On failure, no file is added.
1973  如果ret则转到:destroy_root
1976  ret等于rebind_subsystems(root, ss_mask)
1977  如果ret则转到:destroy_root
1980  ret等于cgroup_bpf_inherit(root_cgrp)
1981  WARN_ON_ONCE(ret)
1983  trace_cgroup_setup_root(root)
1990  添加链表项
1991  cgroup_root_count自加
1997  spin_lock_irq( & css_set_lock)
1999  link_css_set - a helper function to link a css_set to a cgroup*@tmp_links: cgrp_cset_link objects allocated by allocate_cgrp_cset_links()*@cset: the css_set to be linked*@cgrp: the destination cgroup
2000  如果ss_set_populated - does a css_set contain any tasks?*@cset: target css_set* css_set_populated() should be the same as !!cset->nr_tasks at steady* stategroup_update_populated - update the populated count of a cgroup*@cgrp: the target cgroup*@populated: inc or dec populated count* One of the css_sets associated with @cgrp is either getting its first* task or losing the last
2003  spin_unlock_irq( & css_set_lock)
2005  BUG_ON(!链表为空)
2006  BUG_ON(atomic_read( & Number of cgroups in the hierarchy, used only for /proc/cgroups ) != 1)
2008  kernfs_activate( cgroup kernfs entry )
2009  ret等于0
2010  转到:out
2012  destroy_root :
2013  kernfs_destroy_root(kf_root)
2014  kf_root = NULL
2015  exit_root_id :
2016  cgroup_exit_root_id(root)
2017  cancel_ref :
2018  percpu_ref_exit - undo percpu_ref_init()*@ref: percpu_ref to exit* This function exits @ref
2019  out :
2020  free_cgrp_cset_links( & tmp_links)
2021  返回:ret
调用者
名称描述
cgroup_initgroup_init - cgroup initialization* Register cgroup filesystem and /proc file, and initialize* any subsystems that didn't request early init.
cgroup1_root_to_useThe guts of cgroup1 mount - find or create cgroup_root to use