Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:int cgroup_attach_task_all(struct task_struct *from, struct task_struct *tsk)

Type:int

Parameter:

TypeParameterName
struct task_struct *from
struct task_struct *tsk
62  retval = 0
64  mutex_lock( & cgroup_mutex is the master lock)
65  percpu_down_write( & cgroup_threadgroup_rwsem)
66  rate across the hierarchies (root)
69  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
72  spin_lock_irq( & css_set_lock)
73  from_cgrp = Return the cgroup for "task" from the given hierarchy. Must be* called with cgroup_mutex and css_set_lock held.
74  spin_unlock_irq( & css_set_lock)
76  retval = 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?
77  If retval Then Break
80  percpu_up_write( & cgroup_threadgroup_rwsem)
81  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.
83  Return retval