函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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

函数原型:int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from)

返回类型:int

参数:

类型参数名称
struct cgroup *to
struct cgroup *from
100  DEFINE_CGROUP_MGCTX(mgctx)
106  如果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 则返回:负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  如果ret则返回: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  如果ret则转到:out_err
131  循环
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  循环
136 task任务标志按位与Getting shut down 循环
138  如果taskget_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  如果task
148 task且非ret循环
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  返回:ret
调用者
名称描述
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