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:39
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:group_trasnsfer_tasks - move tasks from one cgroup to another*@to: cgroup to which the tasks will be moved*@from: cgroup in which the tasks currently reside* Locking rules between cgroup_post_fork() and the migration path* guarantee that, if a task is

Proto:int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from)

Type:int

Parameter:

TypeParameterName
struct cgroup *to
struct cgroup *from
100  DEFINE_CGROUP_MGCTX(mgctx)
106  If group_on_dfl - test whether a cgroup is on the default hierarchy*@cgrp: the cgroup of interest* The default hierarchy is the v2 interface of cgroup and this function* can be used to test whether a cgroup is on the default hierarchy for* cases where a Then Return -EINVAL
109  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*
110  If ret Then Return ret
113  mutex_lock( & cgroup_mutex is the master lock)
115  percpu_down_write( & cgroup_threadgroup_rwsem)
118  spin_lock_irq( & css_set_lock)
119  list_for_each_entry - iterate over list of given type*@pos: the type * to use as a loop cursor.*@head: the head for your list.*@member: the name of the list_head within the struct.(link, & * List of cgrp_cset_links pointing at css_sets with tasks in this * cgroup. Protected by css_set_lock., cset_link)
120  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
121  spin_unlock_irq( & css_set_lock)
123  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
124  If ret Then Go to out_err
131  Do
132  ss_task_iter_start - initiate task iteration*@css: the css to walk tasks of*@flags: CSS_TASK_ITER_* flags*@it: the task iterator to use* Initiate iteration through the tasks of @css
134  Do
136  When task && Per task flags (PF_*), defined further below: & Getting shut down cycle
138  If task Then get_task_struct(task)
140  ss_task_iter_end - finish task iteration*@it: the task iterator to finish* Finish task iteration started by css_task_iter_start().
142  If task Then
148  When task && Not ret cycle
149  out_err :
150  group_migrate_finish - cleanup after attach*@mgctx: migration context* Undo cgroup_migrate_add_src() and cgroup_migrate_prepare_dst(). See* those functions for details.
151  percpu_up_write( & cgroup_threadgroup_rwsem)
152  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.
153  Return ret
Caller
NameDescribe
remove_tasks_in_empty_cpusetIf CPU and/or memory hotplug handlers, below, unplug any CPUs* or memory nodes, we need to walk over the cpuset hierarchy,* removing that CPU or node from all cpusets. If this removes the* last CPU or node from a cpuset, then move the tasks in the empty