History

sched: Provide sched_set_fifo()

SCHED_FIFO (or any static priority scheduler) is a broken scheduler model; it is fundamentally incapable of resource management, the one thing an OS is actually supposed to do. It is impossible to compose static priority workloads. One cannot take two well designed and functional static priority workloads and mash them together and still expect them to work. Therefore it doesn't make sense to expose the priority field; the kernel is fundamentally incapable of setting a sensible value, it needs systems knowledge that it doesn't have. Take away sched_setschedule() / sched_setattr() from modules and replace them with: - sched_set_fifo(p); create a FIFO task (at prio 50) - sched_set_fifo_low(p); create a task higher than NORMAL, which ends up being a FIFO task at prio 1. - sched_set_normal(p, nice); (re)set the task to normal This stops the proliferation of randomly chosen, and irrelevant, FIFO priorities that dont't really mean anything anyway. The system administrator/integrator, whoever has insight into the actual system design and requirements (userspace) can set-up appropriate priorities if and when needed.

Peter Zijlstra committed 6 years ago

Commit 7318d4c1 parent 87e867b2 files · +50 −0Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/sched.h+3−0
@@ -1653,6 +1653,9 @@ extern int idle_cpu(int cpu); · 1652 unmodified lines
16531653 extern int available_idle_cpu(int cpu);
16541654 extern int sched_setscheduler(struct task_struct *, int, const struct sched_param *);
16551655 extern int sched_setscheduler_nocheck(struct task_struct *, int, const struct sched_param *);
1656+extern int sched_set_fifo(struct task_struct *p);
1657+extern int sched_set_fifo_low(struct task_struct *p);
1658+extern int sched_set_normal(struct task_struct *p, int nice);
16561659 extern int sched_setattr(struct task_struct *, const struct sched_attr *);
16571660 extern int sched_setattr_nocheck(struct task_struct *, const struct sched_attr *);
16581661 extern struct task_struct *idle_task(int cpu);