The theory behind task scheduling is very simple. If there are runnable processes in a system, at least one process must always be running. If there are more runnable processes than processors in a system, not all the processes can be running all the time.
Therefore, some processes need to be stopped temporarily, or suspended, so that others can be running again. The scheduler decides what process in the queue will run next.
Linux default scheduling approach aims to maximise overall CPU utilisation while also maximising interactive performance.
The Linux kernel controls the way tasks (or processes) are managed in the running system. The task scheduler, sometimes called process scheduler, is the part of the kernel that decides which task to run next.
The Completely Fair Scheduler (CFS) is a process scheduler which was merged into the 2.6.23 release of the Linux kernel and is the default scheduler. CFS uses red-black tree(a balanced binary tree).
To do it, custom linux kernel is needed. Interested person needs to Configure, Build and Install a Custom Linux Kernel
chrt(1) sets or retrieves the real-time scheduling attributes of an existing PID or runs COMMAND with the given attributes.
$ chrt -p 18711
pid 18711's current scheduling policy: SCHED_OTHER
pid 18711's current scheduling priority: 0
https://doc.opensuse.org/documentation/html/openSUSE_121/opensuse-tuning/cha.tuning.taskscheduler.html
https://en.wikipedia.org/wiki/Completely_Fair_Scheduler
https://en.opensuse.org/Configure,_Build_and_Install_a_Custom_Linux_Kernel
http://linux.die.net/man/1/chrt