函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\exit.c Create Date:2022-07-27 10:02:47
Last Modify:2020-03-17 11:17:32 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:A task is exiting. If it owned this mm, find a new owner for the mm.

函数原型:void mm_update_next_owner(struct mm_struct *mm)

返回类型:void

参数:

类型参数名称
struct mm_struct *mm
349  p等于当前进程
351  retry :
356  如果* "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则返回
363  如果atomic_read( & *@mm_users: The number of users including userspace. * Use mmget()/mmget_not_zero()/mmput() to modify. When this * drops to 0 (i.e. when the task exits and there are no other * temporary reference holders), we also release a reference on *@mm_count (which )小于等于1则
364  WRITE_ONCE(* "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, NULL)
365  返回
368  read_lock( & tasklist_lock)
373  如果内存信息恒等于mm则转到:assign_new_owner
381  如果内存信息恒等于mm则转到:assign_new_owner
389  如果任务标志按位与I am a kernel thread 则继续下一循环
391  for_each_thread(g, c)
392  如果内存信息恒等于mm则转到:assign_new_owner
394  如果内存信息退出
398  read_unlock( & tasklist_lock)
404  WRITE_ONCE(* "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, NULL)
405  返回
407  assign_new_owner :
408  BUG_ON(c == p)
409  get_task_struct(c)
414  Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring* subscriptions and synchronises with wait4(). Also used in procfs. Also* pins the final release of task.io_context. Also protects ->cpuset and* ->cgroup.subsys[]. And ->vfork_done.
419  read_unlock( & tasklist_lock)
420  如果内存信息不等于mm
421  task_unlock(c)
422  put_task_struct(c)
423  转到:retry
425  WRITE_ONCE(* "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, c)
426  task_unlock(c)
427  put_task_struct(c)
调用者
名称描述
exit_mmTurn us into a lazy TLB process if we* aren't already..
exec_mmap