Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:rk()/clone()-time setup:

Proto:int sched_fork(unsigned long clone_flags, struct task_struct *p)

Type:int

Parameter:

TypeParameterName
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  run state = TASK_NEW
2856  prio = normal_prio
2858  uclamp_fork(p)
2863  If Value for the false possibility is greater at compile time( Scheduler bits, serialized by scheduler locks: ) Then
2867  rt_priority = 0
2868  Else if PRIO_TO_NICE(static_prio) < 0 Then static_prio = Convert user-nice values [ -20 ... 0 ... 19 ]* to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ],* and back.(0)
2871  prio = normal_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  If dl_prio(prio) Then Return -EAGAIN
2883  Else if rt_prio(prio) Then sched_class = rt_sched_class
2885  Else sched_class = fair_sched_class
2888  init_entity_runnable_average( & se)
2897  raw_spin_lock_irqsave( & Protection of the PI data structures: , flags)
2902  __set_task_cpu(p, smp_processor_id())
2903  If task_fork Then task_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  Return 0