How to change task scheduler?

thofyb

New Member
Joined
Jan 24, 2022
Messages
2
Reaction score
0
Credits
24
I want to compare the performance of the EAS scheduler with other schedulers like CFS, DEADLINE, etc. As far as I understood from the documentation, there are several schedulers in the kernel, and at a certain point in time, one scheduler can be selected by the kernel, which is responsible for distributing all tasks among the processor's cores.

But I can't figure out how to switch between these algorithms: is it possible to do this at runtime via the kernel api or does the kernel need to be rebuilt every time. On the Russian forum, one participant said that it is necessary to specify in the parameters when building the kernel, but he did not say exactly where this should be specified. So if you know where to configure it specifically, please tell me.

In any case, I would appreciate any information about switching schedulers. And about the schedulers themselves, because I'm not sure that I understood the principle of their work correctly. (After 2 months of googling, I realized that my skills were failing me, which brought me here)
 
Last edited:


wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
7,338
Reaction score
6,220
Credits
25,187
Works for me in Australia and @KGIII is in USA - something wrong at your end.

Welcome, BTW

Chris Turner
wizardfromoz
 
N

NorthWest

Guest
Hello thofyb.
Also in the land down under here, and the link works.
However, it's actually the same document that you link to with your "documentation" link. The two docs are just in a different format, your link being online and KGill's being a pdf of the same text.
 

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
6,490
Reaction score
5,742
Credits
52,206
Ah, I didn't realize they were the same. LOL I glimpsed through both and they didn't look the same. It must have been the formatting that threw me off. Good catch @NorthWest.
 

madhurapatil222

New Member
Joined
May 30, 2022
Messages
1
Reaction score
0
Credits
15
The first thing is to find out which scheduler is handling I/O on the system. This is done from the command line, and one must know the name of the disk. That can be sda or sdb .With that information in hand, one can find the scheduler on which system is currently working.

Changing deadline to noop.
cat /sys/block/sda/queue/scheduler

This command gives the scheduler which is being run.
One can change this task scheduler by the issuing the below command in the terminal.

sudo echo noop > /sys/block/sda/queue/scheduler.

One can change noop to cfq, or deadline.
This change can be done without having to reboot the machine. Once changed, the I/O scheduler will switch.
To change the scheduler to be persistent, one must do this within the GRUB configuration file. To do that, issue the command sudo nano /etc/default/grub and then change the line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

to

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash elevator=noop"

Again, one can change noop to whatever scheduler one needs.
For different situations and needs, one should intelligently chose which scheduler to be chosen. Thus one can change the task schedulers on linux through the commands.
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation


Top