Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sched\core.c Create Date:2022-07-28 09:35:54
Last Modify:2022-05-22 13:40:38 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:ext_switch - switch to the new MM and the new thread's register state.

Proto:static __always_inline struct rq *context_switch(struct rq *rq, struct task_struct *prev, struct task_struct *next, struct rq_flags *rf)

Type:struct rq

Parameter:

TypeParameterName
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  If Not mm Then
3355  enter_lazy_tlb(active_mm, next)
3357  active_mm = active_mm
3358  If mm Then mmgrab() - Pin a &struct mm_struct
3360  Else active_mm = NULL
3362  Else
3363  membarrier_switch_mm(rq, active_mm, mm)
3372  switch_mm_irqs_off(active_mm, mm, next)
3374  If Not mm Then
3376  prev_mm = active_mm
3377  active_mm = 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  Return sh_task_switch - clean up after a task-switch*@prev: the thread we just switched away from
Caller
NameDescribe
__schedule__schedule() is the main scheduler function.* The main means of driving the scheduler and thus entering this function are:* 1. Explicit blocking: mutex, semaphore, waitqueue, etc.* 2. TIF_NEED_RESCHED flag is checked on interrupt and userspace return