函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sched\core.c Create Date:2022-07-27 10:36:30
Last Modify:2022-05-22 13:40:38 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:进程切换

函数原型:static __always_inline struct rq *context_switch(struct rq *rq, struct task_struct *prev, struct task_struct *next, struct rq_flags *rf)

返回类型:struct rq

参数:

类型参数名称
struct rq *rq
struct task_struct *prev
struct task_struct *next
struct rq_flags *rf
3338  prepare_task_switch - prepare to switch tasks*@rq: the runqueue preparing to switch*@prev: the current task that is being switched out*@next: the task we are going to switch to
3345  A facility to provide batching of the reload of page tables and* other process state with the actual context switch code for* paravirtualized guests(prev)
3354  如果非内存信息
3355  通知底层不需要切换虚拟地址空间
3357  活跃内存信息等于活跃内存信息
3358  如果内存信息mmgrab() - Pin a &struct mm_struct
3360  否则活跃内存信息 = NULL
3362  否则
3363  membarrier_switch_mm(rq, 活跃内存信息, 内存信息)
3372  switch_mm_irqs_off(活跃内存信息, 内存信息, next)
3374  如果非内存信息
3377  活跃内存信息 = NULL
3381  clock_update_flags与等于RQCF_ACT_SKIP按位或q::clock_update_flags bits* %RQCF_REQ_SKIP - will request skipping of clock update on the next* call to __schedule(). This is an optimisation to avoid* neighbouring rq clock updates.* %RQCF_ACT_SKIP - is set from inside of __schedule() when skipping is的值的反
3383  prepare_lock_switch(rq, next, rf)
3386  switch_to(prev, next, prev)
3387  The "volatile" is due to gcc bugs ()
3389  返回:sh_task_switch - clean up after a task-switch*@prev: the thread we just switched away from
调用者
名称描述
__schedule调度器