Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Freeze or unfreeze all tasks in the given cgroup.

Proto:static void cgroup_do_freeze(struct cgroup *cgrp, bool freeze)

Type:void

Parameter:

TypeParameterName
struct cgroup *cgrp
boolfreeze
182  lockdep_assert_held( & cgroup_mutex is the master lock)
184  spin_lock_irq( & css_set_lock)
185  If freeze Then Atomically set a bit in memory
187  Else lear_bit - Clears a bit in memory*@nr: Bit to clear*@addr: Address to start counting from* This is a relaxed atomic operation (no implied memory barriers).
189  spin_unlock_irq( & css_set_lock)
191  If freeze Then cgroup_path() takes a spin lock(freeze, cgrp)
193  Else cgroup_path() takes a spin lock(unfreeze, cgrp)
196  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
197  When task = ss_task_iter_next - return the next task for the iterator*@it: the task iterator being iterated* The "next" function for task iteration. @it should have been* initialized via css_task_iter_start(). Returns NULL when the iteration* reaches the end. cycle
202  If Per task flags (PF_*), defined further below: & I am a kernel thread Then Continue
204  Freeze or unfreeze the task by setting or clearing the JOBCTL_TRAP_FREEZE* jobctl bit.
206  ss_task_iter_end - finish task iteration*@it: the task iterator to finish* Finish task iteration started by css_task_iter_start().
212  spin_lock_irq( & css_set_lock)
213  If * Keep track of total numbers of visible and dying descent cgroups. * Dying cgroups are cgroups which were deleted by a user, * but are still existing because someone else is holding a reference. * max_descendants is a maximum allowed number of descent cgr == Number of frozen descendant cgroups Then Revisit the cgroup frozen state.* Checks if the cgroup is really frozen and perform all state transitions.
215  spin_unlock_irq( & css_set_lock)
Caller
NameDescribe
cgroup_freeze