函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\process_32.c Create Date:2022-07-27 08:29:06
Last Modify:2022-05-18 16:43:57 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:switch_to(x,y) should switch tasks from x to y

函数原型:__visible __notrace_funcgraph struct task_struct *__switch_to(struct task_struct *prev_p, struct task_struct *next_p)

返回类型:struct task_struct

参数:

类型参数名称
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等于当前cpu ID()
170  如果非test_thread_flag(load FPU on return to userspace )则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  抢占保护下的写CPU(cpu_current_top_of_stack, (unsignedlong)task_stack_page(next_p) + THREAD_SIZE)
213  如果gs按位或gslazy_load_gs(gs)
216  抢占保护下的写CPU(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  返回:prev_p