sched_setscheduler_nocheck(9)
π sched_setscheduler_nocheck
okay so this is a page from the Kernel API Manual β yes that one β and today's main character is sched_setscheduler_nocheck, a little function with a big "i do what i want" energy π
β¨ NAME β¨
sched_setscheduler_nocheck β changes the scheduling policy and/or the RT priority of a thread, and it does it from kernel-space. that's the whole vibe. π¦
πΈ SYNOPSIS πΈ
int sched_setscheduler_nocheck (struct task_struct *p , int policy ,
const struct sched_param *param );
that's the signature bestie, copy it exactly, don't get creative with it π«Ά
π ARGUMENTS π
pβ the task in question. like, this one. the thread we're messing with πpolicyβ the new policy. as in, the scheduling one. iconic.paramβ a structure containing the new RT priority. it's giving "payload" honestly π
π₯ DESCRIPTION π₯
so it's just like sched_setscheduler, except β and this is the whole point β it genuinely does not bother checking whether the current context has permission. no vibe check, no permission check, we simply go π
ngl, this is needed. for example, it's needed in stop_machine: we create temporary high priority worker threads, but the caller might not actually have that capability. so yeah. we skip the check because the caller might be a little powerless in that moment and we still need it to work. no cap.
β RETURN β
0 on success. an error code otherwise. that's it, that's the return section π
π SEE ALSO π
kernel file ./kernel/sched/syscalls.c β and then the whole friend group:
task_prio(9), idle_cpu(9), idle_task(9), find_process_by_pid(9), sched_setscheduler(9), sys_sched_setscheduler(9), sys_sched_setparam(9), sys_sched_setattr(9), sys_sched_getscheduler(9), sys_sched_getparam(9), sys_sched_getattr(9), sys_sched_setaffinity(9), sys_sched_getaffinity(9), sys_sched_yield(9), yield(9), yield_to(9), sys_sched_get_priority_max(9), sys_sched_get_priority_min(9), sys_sched_rr_get_interval(9)
like. the entire sched extended universe. go read them, iykyk π
and that's the page!! π sign-off time: this one lives in ./kernel/sched, and it's dated October 2026 β so mark your calendars bestie, the scheduler said see you then π§ββοΈβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms