Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\process_32.c Create Date:2022-07-28 07:29:51
Last Modify:2022-05-18 16:43:57 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:switch_to(x,y) should switch tasks from x to y

Proto:__visible __notrace_funcgraph struct task_struct *__switch_to(struct task_struct *prev_p, struct task_struct *next_p)

Type:struct task_struct

Parameter:

TypeParameterName
struct task_struct *prev_p
struct task_struct *next_p
162  prev = * New fields for task_struct should be added above here, so that * they are included in the randomized portion of task_struct. , next = * New fields for task_struct should be added above here, so that * they are included in the randomized portion of task_struct.
164  prev_fpu = Floating point and extended processor state
165  next_fpu = Floating point and extended processor state
166  cpu = smp_processor_id()
170  If Not test_thread_flag(load FPU on return to userspace ) Then FPU state switching for scheduling.* This is a two-stage process:* - switch_fpu_prepare() saves the old state.* This is done within the context of the old process.* - switch_fpu_finish() sets TIF_NEED_FPU_LOAD; the floating point state
183  lazy_save_gs(gs)
188  load_TLS(next, cpu)
190  This needs to be inline to optimize for the common case where no extra* work needs to be done.
197  arch_end_context_switch(next_p)
204  This is used when switching tasks or entering/exiting vm86 mode.
205  refresh_sysenter_cs(next)
206  this_cpu_write(cpu_current_top_of_stack, (unsignedlong)task_stack_page(next_p) + THREAD_SIZE)
213  If gs | gs Then lazy_load_gs(gs)
216  this_cpu_write(current_task, next_p)
218  Load PKRU from the FPU context if available. Delay loading of the* complete FPU state until the return to userland.
221  resctrl_sched_in()
223  Return prev_p