Does Linux 3.10 CFS have “timeslices”?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












Does Linux 3.10 CFS have "timeslices"?



I am confused, because sched-design-CFS.txt clearly states:




CFS uses nanosecond granularity accounting and does not rely on any jiffies or
other HZ detail. Thus the CFS scheduler has no notion of "timeslices" in the
way the previous scheduler had, and has no heuristics whatsoever. There is
only one central tunable (you have to switch on CONFIG_SCHED_DEBUG):



/proc/sys/kernel/sched_min_granularity_ns



which can be used to tune the scheduler from "desktop" (i.e., low latencies) to
"server" (i.e., good batching) workloads.




But then multiple task scheduler tuning guides suggest two different formulas of calculating a "timeslice". (Depending on the number of runnable tasks.) For example this OpenSUSE guide.



I am running only SCHED_FIFO threads on isolated CPUs.







share|improve this question

























    up vote
    0
    down vote

    favorite












    Does Linux 3.10 CFS have "timeslices"?



    I am confused, because sched-design-CFS.txt clearly states:




    CFS uses nanosecond granularity accounting and does not rely on any jiffies or
    other HZ detail. Thus the CFS scheduler has no notion of "timeslices" in the
    way the previous scheduler had, and has no heuristics whatsoever. There is
    only one central tunable (you have to switch on CONFIG_SCHED_DEBUG):



    /proc/sys/kernel/sched_min_granularity_ns



    which can be used to tune the scheduler from "desktop" (i.e., low latencies) to
    "server" (i.e., good batching) workloads.




    But then multiple task scheduler tuning guides suggest two different formulas of calculating a "timeslice". (Depending on the number of runnable tasks.) For example this OpenSUSE guide.



    I am running only SCHED_FIFO threads on isolated CPUs.







    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Does Linux 3.10 CFS have "timeslices"?



      I am confused, because sched-design-CFS.txt clearly states:




      CFS uses nanosecond granularity accounting and does not rely on any jiffies or
      other HZ detail. Thus the CFS scheduler has no notion of "timeslices" in the
      way the previous scheduler had, and has no heuristics whatsoever. There is
      only one central tunable (you have to switch on CONFIG_SCHED_DEBUG):



      /proc/sys/kernel/sched_min_granularity_ns



      which can be used to tune the scheduler from "desktop" (i.e., low latencies) to
      "server" (i.e., good batching) workloads.




      But then multiple task scheduler tuning guides suggest two different formulas of calculating a "timeslice". (Depending on the number of runnable tasks.) For example this OpenSUSE guide.



      I am running only SCHED_FIFO threads on isolated CPUs.







      share|improve this question













      Does Linux 3.10 CFS have "timeslices"?



      I am confused, because sched-design-CFS.txt clearly states:




      CFS uses nanosecond granularity accounting and does not rely on any jiffies or
      other HZ detail. Thus the CFS scheduler has no notion of "timeslices" in the
      way the previous scheduler had, and has no heuristics whatsoever. There is
      only one central tunable (you have to switch on CONFIG_SCHED_DEBUG):



      /proc/sys/kernel/sched_min_granularity_ns



      which can be used to tune the scheduler from "desktop" (i.e., low latencies) to
      "server" (i.e., good batching) workloads.




      But then multiple task scheduler tuning guides suggest two different formulas of calculating a "timeslice". (Depending on the number of runnable tasks.) For example this OpenSUSE guide.



      I am running only SCHED_FIFO threads on isolated CPUs.









      share|improve this question












      share|improve this question




      share|improve this question








      edited Jun 27 at 9:08
























      asked Jun 27 at 8:39









      Väinö Ertanen

      32




      32




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote



          accepted










          CFS doesn't have timeslices "in the way the previous scheduler had".



          In CFS a timeslice is basically the duration between consecutive switches to grant CPU execution time to the same thread. This gives you two options:



          • All of your threads have enough time to execute for at least min_granularity_ns within one latency_ns. Then, your timeslice = scheduling period * (task's weight/total weight of tasks in the run queue)


          • There are too many threads to fit in the latency_ns, so your timeslices get bigger to accommodate more threads that want to run according to timeslice = number_of_running_tasks * sched_min_granularity_ns


          This is why CFS stands for a Completely Fair Scheduler, as is doesn't exclude threads with lower priorities but rather indiscriminately extends the timeslices for everyone.






          share|improve this answer





















          • aha, excellent! Thank you. So seems that I only had trouble understanding the "doesn't have timeslices in the way the previous scheduler had". :) Thanks a lot!!
            – Väinö Ertanen
            Jun 27 at 13:16










          • mind accepting the answer, then? ;) @VäinöErtanen
            – emmrk
            Jun 27 at 13:30











          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%2f452172%2fdoes-linux-3-10-cfs-have-timeslices%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote



          accepted










          CFS doesn't have timeslices "in the way the previous scheduler had".



          In CFS a timeslice is basically the duration between consecutive switches to grant CPU execution time to the same thread. This gives you two options:



          • All of your threads have enough time to execute for at least min_granularity_ns within one latency_ns. Then, your timeslice = scheduling period * (task's weight/total weight of tasks in the run queue)


          • There are too many threads to fit in the latency_ns, so your timeslices get bigger to accommodate more threads that want to run according to timeslice = number_of_running_tasks * sched_min_granularity_ns


          This is why CFS stands for a Completely Fair Scheduler, as is doesn't exclude threads with lower priorities but rather indiscriminately extends the timeslices for everyone.






          share|improve this answer





















          • aha, excellent! Thank you. So seems that I only had trouble understanding the "doesn't have timeslices in the way the previous scheduler had". :) Thanks a lot!!
            – Väinö Ertanen
            Jun 27 at 13:16










          • mind accepting the answer, then? ;) @VäinöErtanen
            – emmrk
            Jun 27 at 13:30















          up vote
          0
          down vote



          accepted










          CFS doesn't have timeslices "in the way the previous scheduler had".



          In CFS a timeslice is basically the duration between consecutive switches to grant CPU execution time to the same thread. This gives you two options:



          • All of your threads have enough time to execute for at least min_granularity_ns within one latency_ns. Then, your timeslice = scheduling period * (task's weight/total weight of tasks in the run queue)


          • There are too many threads to fit in the latency_ns, so your timeslices get bigger to accommodate more threads that want to run according to timeslice = number_of_running_tasks * sched_min_granularity_ns


          This is why CFS stands for a Completely Fair Scheduler, as is doesn't exclude threads with lower priorities but rather indiscriminately extends the timeslices for everyone.






          share|improve this answer





















          • aha, excellent! Thank you. So seems that I only had trouble understanding the "doesn't have timeslices in the way the previous scheduler had". :) Thanks a lot!!
            – Väinö Ertanen
            Jun 27 at 13:16










          • mind accepting the answer, then? ;) @VäinöErtanen
            – emmrk
            Jun 27 at 13:30













          up vote
          0
          down vote



          accepted







          up vote
          0
          down vote



          accepted






          CFS doesn't have timeslices "in the way the previous scheduler had".



          In CFS a timeslice is basically the duration between consecutive switches to grant CPU execution time to the same thread. This gives you two options:



          • All of your threads have enough time to execute for at least min_granularity_ns within one latency_ns. Then, your timeslice = scheduling period * (task's weight/total weight of tasks in the run queue)


          • There are too many threads to fit in the latency_ns, so your timeslices get bigger to accommodate more threads that want to run according to timeslice = number_of_running_tasks * sched_min_granularity_ns


          This is why CFS stands for a Completely Fair Scheduler, as is doesn't exclude threads with lower priorities but rather indiscriminately extends the timeslices for everyone.






          share|improve this answer













          CFS doesn't have timeslices "in the way the previous scheduler had".



          In CFS a timeslice is basically the duration between consecutive switches to grant CPU execution time to the same thread. This gives you two options:



          • All of your threads have enough time to execute for at least min_granularity_ns within one latency_ns. Then, your timeslice = scheduling period * (task's weight/total weight of tasks in the run queue)


          • There are too many threads to fit in the latency_ns, so your timeslices get bigger to accommodate more threads that want to run according to timeslice = number_of_running_tasks * sched_min_granularity_ns


          This is why CFS stands for a Completely Fair Scheduler, as is doesn't exclude threads with lower priorities but rather indiscriminately extends the timeslices for everyone.







          share|improve this answer













          share|improve this answer



          share|improve this answer











          answered Jun 27 at 12:19









          emmrk

          17913




          17913











          • aha, excellent! Thank you. So seems that I only had trouble understanding the "doesn't have timeslices in the way the previous scheduler had". :) Thanks a lot!!
            – Väinö Ertanen
            Jun 27 at 13:16










          • mind accepting the answer, then? ;) @VäinöErtanen
            – emmrk
            Jun 27 at 13:30

















          • aha, excellent! Thank you. So seems that I only had trouble understanding the "doesn't have timeslices in the way the previous scheduler had". :) Thanks a lot!!
            – Väinö Ertanen
            Jun 27 at 13:16










          • mind accepting the answer, then? ;) @VäinöErtanen
            – emmrk
            Jun 27 at 13:30
















          aha, excellent! Thank you. So seems that I only had trouble understanding the "doesn't have timeslices in the way the previous scheduler had". :) Thanks a lot!!
          – Väinö Ertanen
          Jun 27 at 13:16




          aha, excellent! Thank you. So seems that I only had trouble understanding the "doesn't have timeslices in the way the previous scheduler had". :) Thanks a lot!!
          – Väinö Ertanen
          Jun 27 at 13:16












          mind accepting the answer, then? ;) @VäinöErtanen
          – emmrk
          Jun 27 at 13:30





          mind accepting the answer, then? ;) @VäinöErtanen
          – emmrk
          Jun 27 at 13:30













           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f452172%2fdoes-linux-3-10-cfs-have-timeslices%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

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

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?