Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:sh_task_switch - clean up after a task-switch*@prev: the thread we just switched away from

Proto:static struct rq *finish_task_switch(struct task_struct *prev)__releases(rq->lock)

Type:struct rq

Parameter:

TypeParameterName
struct task_struct *prev
3188  rq = this_rq()
3189  mm = prev_mm
3203  If WARN_ONCE(We mask the PREEMPT_NEED_RESCHED bit so as not to confuse all current users* that think a non-zero value indicates we cannot preempt. != 2 * PREEMPT_DISABLE_OFFSET, "corrupted preempt_count: %s/%d/0x%x\n", comm, pid, We mask the PREEMPT_NEED_RESCHED bit so as not to confuse all current users* that think a non-zero value indicates we cannot preempt.) Then preempt_count_set(Initial preempt_count value; reflects the preempt_count schedule invariant* which states that during context switches:* preempt_count() == 2*PREEMPT_DISABLE_OFFSET* Note: PREEMPT_DISABLE_OFFSET is 0 for !PREEMPT_COUNT kernels.)
3208  prev_mm = NULL
3221  prev_state = run state
3222  vtime_task_switch(prev)
3223  perf_event_task_sched_in(prev, current process)
3224  finish_task(prev)
3225  finish_lock_switch(rq)
3226  finish_arch_post_lock_switch()
3227  kcov_finish_switch(current process)
3229  fire_sched_in_preempt_notifiers(current process)
3242  If mm Then
3243  membarrier_mm_sync_core_before_usermode(mm)
3244  mmdrop(mm)
3246  If Value for the false possibility is greater at compile time(prev_state == TASK_DEAD) Then
3247  If task_dead Then task_dead(prev)
3254  kprobe_flush_task(prev)
3257  put_task_stack(prev)
3259  put_task_struct_rcu_user(prev)
3262  tick_nohz_task_switch()
3263  Return rq
Caller
NameDescribe
schedule_tailschedule_tail - first thing a freshly forked thread must call.*@prev: the thread we just switched away from.
context_switchext_switch - switch to the new MM and the new thread's register state.