Priority calculation for the ânoneâ I/O scheduling class
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I read the man page of ionice(1)
, and it says:
For kernels after 2.6.26 with the CFQ I/O scheduler, a process that has not asked for an I/O priority inherits its CPU scheduling class. The I/O priority is derived from the CPU nice level of the process (same as before kernel 2.6.26).
And the calculation of the I/O priority before kernel 2.6.26 is:
io_priority = (cpu_nice + 20) / 5
So I did the following experiments:
root@jacky:~# nice
0
root@jacky:~# sleep 5566 &
[1] 32527
root@jacky:~# ionice -p 32527
none: prio 4
root@jacky:~# ps hp 32527 -o nice
0
root@jacky:~# nice -n -20 sleep 5566 &
[2] 32538
root@jacky:~# ionice -p 32538
none: prio 4
root@jacky:~# ps hp 32538 -o nice
-20
The first process (pid 32527) has the I/O priority of 4, and it's reasonable because (0 + 20) / 5 = 4. The second process (pid 32538) has CPU nice of -20, so it should have I/O priority of (-20 + 20) / 5 = 0. However, it has I/O priority of 4 too.
Can someone explain that for me? Thanks!
p.s. I am using Arch Linux, and my uname -r
is 4.13.4-1-ARCH
.
ionice
add a comment |Â
up vote
0
down vote
favorite
I read the man page of ionice(1)
, and it says:
For kernels after 2.6.26 with the CFQ I/O scheduler, a process that has not asked for an I/O priority inherits its CPU scheduling class. The I/O priority is derived from the CPU nice level of the process (same as before kernel 2.6.26).
And the calculation of the I/O priority before kernel 2.6.26 is:
io_priority = (cpu_nice + 20) / 5
So I did the following experiments:
root@jacky:~# nice
0
root@jacky:~# sleep 5566 &
[1] 32527
root@jacky:~# ionice -p 32527
none: prio 4
root@jacky:~# ps hp 32527 -o nice
0
root@jacky:~# nice -n -20 sleep 5566 &
[2] 32538
root@jacky:~# ionice -p 32538
none: prio 4
root@jacky:~# ps hp 32538 -o nice
-20
The first process (pid 32527) has the I/O priority of 4, and it's reasonable because (0 + 20) / 5 = 4. The second process (pid 32538) has CPU nice of -20, so it should have I/O priority of (-20 + 20) / 5 = 0. However, it has I/O priority of 4 too.
Can someone explain that for me? Thanks!
p.s. I am using Arch Linux, and my uname -r
is 4.13.4-1-ARCH
.
ionice
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I read the man page of ionice(1)
, and it says:
For kernels after 2.6.26 with the CFQ I/O scheduler, a process that has not asked for an I/O priority inherits its CPU scheduling class. The I/O priority is derived from the CPU nice level of the process (same as before kernel 2.6.26).
And the calculation of the I/O priority before kernel 2.6.26 is:
io_priority = (cpu_nice + 20) / 5
So I did the following experiments:
root@jacky:~# nice
0
root@jacky:~# sleep 5566 &
[1] 32527
root@jacky:~# ionice -p 32527
none: prio 4
root@jacky:~# ps hp 32527 -o nice
0
root@jacky:~# nice -n -20 sleep 5566 &
[2] 32538
root@jacky:~# ionice -p 32538
none: prio 4
root@jacky:~# ps hp 32538 -o nice
-20
The first process (pid 32527) has the I/O priority of 4, and it's reasonable because (0 + 20) / 5 = 4. The second process (pid 32538) has CPU nice of -20, so it should have I/O priority of (-20 + 20) / 5 = 0. However, it has I/O priority of 4 too.
Can someone explain that for me? Thanks!
p.s. I am using Arch Linux, and my uname -r
is 4.13.4-1-ARCH
.
ionice
I read the man page of ionice(1)
, and it says:
For kernels after 2.6.26 with the CFQ I/O scheduler, a process that has not asked for an I/O priority inherits its CPU scheduling class. The I/O priority is derived from the CPU nice level of the process (same as before kernel 2.6.26).
And the calculation of the I/O priority before kernel 2.6.26 is:
io_priority = (cpu_nice + 20) / 5
So I did the following experiments:
root@jacky:~# nice
0
root@jacky:~# sleep 5566 &
[1] 32527
root@jacky:~# ionice -p 32527
none: prio 4
root@jacky:~# ps hp 32527 -o nice
0
root@jacky:~# nice -n -20 sleep 5566 &
[2] 32538
root@jacky:~# ionice -p 32538
none: prio 4
root@jacky:~# ps hp 32538 -o nice
-20
The first process (pid 32527) has the I/O priority of 4, and it's reasonable because (0 + 20) / 5 = 4. The second process (pid 32538) has CPU nice of -20, so it should have I/O priority of (-20 + 20) / 5 = 0. However, it has I/O priority of 4 too.
Can someone explain that for me? Thanks!
p.s. I am using Arch Linux, and my uname -r
is 4.13.4-1-ARCH
.
ionice
asked Dec 25 '17 at 2:49
æÂÂèªåÂÂ
305
305
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f412878%2fpriority-calculation-for-the-none-i-o-scheduling-class%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password