函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:group_attach_task - attach a task or a whole threadgroup to a cgroup*@dst_cgrp: the cgroup to attach to*@leader: the task or the leader of the threadgroup to be attached*@threadgroup: attach the whole threadgroup?

函数原型:int cgroup_attach_task(struct cgroup *dst_cgrp, struct task_struct *leader, bool threadgroup)

返回类型:int

参数:

类型参数名称
struct cgroup *dst_cgrp
struct task_struct *leader
boolthreadgroup
2720  DEFINE_CGROUP_MGCTX(mgctx)
2724  ret等于group_migrate_vet_dst - verify whether a cgroup can be migration destination*@dst_cgrp: destination cgroup to test* On the default hierarchy, except for the mixable, (possible) thread root* and threaded cgroups, subtree_control must be zero for migration*
2725  如果ret则返回:ret
2729  spin_lock_irq( & css_set_lock)
2730  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
2731  task等于leader
2732  循环
2733  group_migrate_add_src - add a migration source css_set*@src_cset: the source css_set to add*@dst_cgrp: the destination cgroup*@mgctx: migration context* Tasks belonging to @src_cset are about to be migrated to @dst_cgrp
2734  如果非threadgroup退出
2737  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
2738  spin_unlock_irq( & css_set_lock)
2741  ret等于group_migrate_prepare_dst - prepare destination css_sets for migration*@mgctx: migration context* Tasks are about to be moved and all the source css_sets have been* preloaded to @mgctx->preloaded_src_csets
2742  如果非retret等于group_migrate - migrate a process or task to a cgroup*@leader: the leader of the process or the task to migrate*@threadgroup: whether @leader points to the whole process or a single task*@mgctx: migration context
2745  group_migrate_finish - cleanup after attach*@mgctx: migration context* Undo cgroup_migrate_add_src() and cgroup_migrate_prepare_dst(). See* those functions for details.
2747  如果非retcgroup_path() takes a spin lock(attach_task, dst_cgrp, leader, threadgroup)
2750  返回:ret
调用者
名称描述
cgroup_procs_write
cgroup_threads_write
cgroup_attach_task_allgroup_attach_task_all - attach task 'tsk' to all cgroups of task 'from'*@from: attach to all cgroups of a given task*@tsk: the task to be attached
__cgroup1_procs_write