sched_setscheduler_nocheck(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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