函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:调度进程

函数原型:int sched_fork(unsigned long clone_flags, struct task_struct *p)

返回类型:int

参数:

类型参数名称
unsigned longclone_flags
struct task_struct *p
2845  Perform scheduler related setup for a newly forked process p.* p is forked by current.* __sched_fork() is basic setup used by init_idle() too:
2851  任务状态等于TASK_NEW
2856  prio等于normal_prio
2858  uclamp_fork(p)
2863  如果此条件成立可能性小(为编译器优化)( Scheduler bits, serialized by scheduler locks: )则
2867  实时任务优先级等于0
2868  否则如果PRIO_TO_NICE(静态优先级)小于0则静态优先级等于Convert user-nice values [ -20 ... 0 ... 19 ]* to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ],* and back.(0)
2871  prio等于动态优先级等于__normal_prio - return the priority that is based on the static prio
2872  set_load_weight(p, false)
2878  Scheduler bits, serialized by scheduler locks: 等于0
2881  如果dl_prio(prio)则返回:负EAGAIN
2883  否则如果rt_prio(prio)则调度函数等于rt_sched_class
2885  否则调度函数等于fair_sched_class
2888  init_entity_runnable_average( & 调度实体)
2897  raw_spin_lock_irqsave( & Protection of the PI data structures: , flags)
2902  __set_task_cpu(p, 当前cpu ID())
2903  如果task_forktask_fork(p)
2905  raw_spin_unlock_irqrestore( & Protection of the PI data structures: , flags)
2914  must be macros to avoid header recursion hell(p)
2919  返回:0
调用者
名称描述
copy_process创建进程