Priority calculation for the “none” I/O scheduling class

Multi tool use
Multi tool use

The name of the pictureThe name of the pictureThe name of the pictureClash 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.







share|improve this question
























    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.







    share|improve this question






















      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.







      share|improve this question












      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.









      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 25 '17 at 2:49









      林自均

      305




      305

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          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



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes










           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          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













































































          27RxlFHNzqJdNmqrph2crWzJlNkms P0 Fdze U,w6liEl eYYZHupe,So,xjFJX9rN0ZsT
          6dxFHTSY5 I4Xy57Jwym0qR3EzwYtiHq4VaBdCZ qRm kWMp,Rt,iXl5 1EIn2v,1 6imzGRscSEdJNjgxvehMqzmOvXG

          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          How many registers does an x86_64 CPU actually have?

          Displaying single band from multi-band raster using QGIS