函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:psi_task_change

函数原型:void psi_task_change(struct task_struct *task, int clear, int set)

返回类型:void

参数:

类型参数名称
struct task_struct *task
intclear
intset
749  cpu等于task_cpu(task)
751  bool wake_clock = true
752  void * iter = NULL
754  如果非进程ID则返回
757  如果psi_flags按位与setpsi_flags按位与clear的值不等于clear的值且非psi_bug
760  Special printk facility for scheduler/timekeeping use only, _DO_NOT_USE_ !
763  psi_bug等于1
766  psi_flags与等于clear的反
767  psi_flags或等于set
775  如果此条件成立可能性小(为编译器优化)((clear & TSK_RUNNING) && (任务标志 & 进程处于工作队列中) && wq_worker_last_func - retrieve worker's last work function*@task: Task to retrieve last work function of == psi_avgs_work)则wake_clock = false
780 group等于iterate_groups(task, & iter)循环
781  state_mask等于psi_group_change(group, cpu, clear, set)
783  如果state_mask按位与poll_statesSchedule polling if it's not already scheduled. It's safe to call even from* hotpath because even though kthread_queue_delayed_work takes worker->lock* spinlock that spinlock is never contended due to poll_scheduled atomic* preventing such competition.
786  如果wake_clock且非delayed_work_pending - Find out whether a delayable work item is currently* pending*@w: The work item in question( & avgs_work)则在延迟工作队列中放置任务
调用者
名称描述
psi_memstall_enterpsi_memstall_enter - mark the beginning of a memory stall section*@flags: flags to handle nested sections* Marks the calling task as being stalled due to a lack of memory,* such as waiting for a refault or performing reclaim.
psi_memstall_leavepsi_memstall_leave - mark the end of an memory stall section*@flags: flags to handle nested memdelay sections* Marks the calling task as no longer stalled due to lack of memory.
cgroup_move_taskgroup_move_task - move task to a different cgroup*@task: the task*@to: the target css_set* Move task to a new cgroup and safely migrate its associated stall* state between the different groups