函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:_sched_setscheduler

函数原型:static int _sched_setscheduler(struct task_struct *p, int policy, const struct sched_param *param, bool check)

返回类型:int

参数:

类型参数名称
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(静态优先级), }
5042  如果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
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  返回:__sched_setscheduler(p, & attr, check, true)
调用者
名称描述
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_nocheck改变调度策略和线程优先级