Reputation: 2755
I am trying to implement some kind of new Linux task scheduler so I found this article http://www.eetimes.com/design/embedded/4204929/Real-Time-Linux-Scheduling-Part-1 is really helpful. However, it said that we not only need to define the new scheduling macro in /kernel-source-code/include/linux/sched.h but also need to define the same thing in /usr/include/bits/sched.h.
So why do we need to change the user space head file since the scheduler works in the kernel. I do not know why do we have the user space head file? Anyway the user space program can not use the function defined in the kernel directly (unless through a system call), right? And if we also need to change the user space file in order to implement a new scheduler, then how can the scheduler be portable since the user not only needs to use the new kernel image but also needs to change their user space file?
Upvotes: 2
Views: 235
Reputation: 84239
The article talks about adding a new class of scheduling, or new scheduling policy, and not about replacing kernel scheduling algorithm wholesale. You need userland process be able to select the policy with sched_setscheduler(2)
, thus the need for userland-visible header file.
Take a look here for more details.
Upvotes: 3