Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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?

Proto:int cgroup_attach_task(struct cgroup *dst_cgrp, struct task_struct *leader, bool threadgroup)

Type:int

Parameter:

TypeParameterName
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  If ret Then Return 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  Do
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  If Not threadgroup Then Break
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  If Not ret Then ret = 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  If Not ret Then cgroup_path() takes a spin lock(attach_task, dst_cgrp, leader, threadgroup)
2750  Return ret
Caller
NameDescribe
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