Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:_sched_setscheduler

Proto:static int _sched_setscheduler(struct task_struct *p, int policy, const struct sched_param *param, bool check)

Type:int

Parameter:

TypeParameterName
struct task_struct *p
intpolicy
const struct sched_param *param
boolcheck
5035  struct sched_attr attr = {sched_policy = policy, SCHED_FIFO, SCHED_RR = sched_priority, SCHED_NORMAL, SCHED_BATCH = PRIO_TO_NICE(static_prio), }
5042  If policy != sched_setparam() passes in -1 for its policy, to let the functions* it calls know not to change it. && policy & Can be ORed in to make sure the process is reverted back to SCHED_NORMAL on fork Then
5043  sched_flags |= For the sched_{set,get}attr() calls
5044  policy &= ~Can be ORed in to make sure the process is reverted back to SCHED_NORMAL on fork
5045  sched_policy = policy
5048  Return __sched_setscheduler(p, & attr, check, true)
Caller
NameDescribe
sched_setschedulersched_setscheduler - change the scheduling policy and/or RT priority of a thread.*@p: the task in question.*@policy: new policy.*@param: structure containing the new RT priority.* Return: 0 on success. An error code otherwise.
sched_setscheduler_nochecksched_setscheduler_nocheck - change the scheduling policy and/or RT priority of a thread from kernelspace