Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:cgroup_procs_write_start

Proto:struct task_struct *cgroup_procs_write_start(char *buf, bool threadgroup, bool *locked)__acquires(&cgroup_threadgroup_rwsem)

Type:struct task_struct

Parameter:

TypeParameterName
char *buf
boolthreadgroup
bool *locked
2760  If kstrtoint - convert a string to an int*@s: The start of the string. The string must be null-terminated, and may also* include a single newline before its terminating null. The first character* may also be a plus sign or a minus sign. || pid < 0 Then Return ERR_PTR( - EINVAL)
2771  lockdep_assert_held( & cgroup_mutex is the master lock)
2772  If pid || threadgroup Then
2773  percpu_down_write( & cgroup_threadgroup_rwsem)
2774  * locked = true
2775  Else
2776  * locked = false
2779  _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
2780  If pid Then
2781  tsk = find_task_by_vpid(pid)
2782  If Not tsk Then
2783  tsk = ERR_PTR( - ESRCH)
2784  Go to out_unlock_threadgroup
2786  Else
2787  tsk = current process
2790  If threadgroup Then tsk = group_leader
2799  If disallow userland-initiated cgroup migration || Per task flags (PF_*), defined further below: & Userland is not allowed to meddle with cpus_mask Then
2800  tsk = ERR_PTR( - EINVAL)
2801  Go to out_unlock_threadgroup
2804  get_task_struct(tsk)
2805  Go to out_unlock_rcu
2807  out_unlock_threadgroup :
2808  If locked Then
2809  percpu_up_write( & cgroup_threadgroup_rwsem)
2810  * locked = false
2812  out_unlock_rcu :
2813  _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()
2814  Return tsk
Caller
NameDescribe
cgroup_procs_write
cgroup_threads_write
__cgroup1_procs_write