函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:mem_cgroup_can_attach

函数原型:static int mem_cgroup_can_attach(struct cgroup_taskset *tset)

返回类型:int

参数:

类型参数名称
struct cgroup_taskset *tset
5605  struct mem_cgroup * memcg = NULL
5610  ret等于0
5613  如果cgroup_subsys_on_dfl - fast test on whether a subsys is on default hierarchy*@ss: subsystem in question(memory_cgrp_subsys)则返回:0
5622  p = NULL
5623  cgroup_taskset_for_each_leader - iterate group leaders in a cgroup_taskset*@leader: the loop cursor*@dst_css: the destination css*@tset: taskset to iterate* Iterate threadgroup leaders of @tset. For single-task migrations, @tset* may not contain any.(leader, css, tset)
5624  WARN_ON_ONCE(p)
5625  p等于leader
5626  memcg等于mem_cgroup_from_css(css)
5628  如果非p则返回:0
5636  move_flags等于READ_ONCE(* Should we move charges of a task when a task is moved into this * mem_cgroup ? And what type of charges should we move ?)
5637  如果非move_flags则返回:0
5640  from等于mem_cgroup_from_task(p)
5642  VM_BUG_ON(from == memcg)
5644  mm等于get_task_mm - acquire a reference to the task's mm* Returns %NULL if the task has no mm. Checks PF_KTHREAD (meaning* this kernel workthread has transiently adopted a user mm with use_mm,* to do its AIO) is not set and if so returns a reference to it, after
5645  如果非mm则返回:0
5648  如果* "owner" points to a task that is regarded as the canonical * user/owner of this mm. All of the following must be true in * order for it to be changed: * current == mm->owner * current->mm != mm * new_owner->mm == mm * new_owner->alloc_lock is held恒等于p
5649  VM_BUG_ON(from)
5650  VM_BUG_ON(to)
5651  VM_BUG_ON(precharge)
5652  VM_BUG_ON(moved_charge)
5653  VM_BUG_ON(moved_swap)
5655  加自旋锁
5656  mm等于mm
5657  from等于from
5658  to等于memcg
5659  flags等于move_flags
5660  自旋锁解锁
5663  ret等于mem_cgroup_precharge_mc(mm)
5664  如果retmem_cgroup_clear_mc()
5666  否则
5667  Decrement the use count and release all resources for an mm.
5669  返回:ret