Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to change the scheduler value through code. 1

Status
Not open for further replies.

ashish061291

Programmer
Jan 30, 2012
11
How can we change the scheduler from "cfq" (by default) to "noop" through code.
Basically I am working with Perl.

I know how we can change it manually
"echo noop > /sys/block/sda/queue/scheduler"
but how to do it via code.
 
Well, system("echo noop > /sys/block/sda/queue/scheduler"); would be fine. Or I guess if you preferred you could open SCHEDULER,">/sys/block/sda/queue/scheduler" or die; print SCHEDULER "noop\n"; close SCHEDULER;.

Annihilannic
[small]tgmlify - code syntax highlighting for your tek-tips posts[/small]
 
Hi again,
I have a GUI which accepts the value of the scheduler.
This value is then saved in a variable.

So, how can i use that variable in echo command.

Kindly help...
 
Just put the variable name in there instead of "noop".

Annihilannic
[small]tgmlify - code syntax highlighting for your tek-tips posts[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top