Does Linux 3.10 CFS have âtimeslicesâ?
Clash 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.
linux-kernel scheduling
add a comment |Â
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.
linux-kernel scheduling
add a comment |Â
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.
linux-kernel scheduling
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.
linux-kernel scheduling
edited Jun 27 at 9:08
asked Jun 27 at 8:39
Väinö Ertanen
32
32
add a comment |Â
add a comment |Â
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 onelatency_ns
. Then, yourtimeslice = 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 totimeslice = 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.
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
add a comment |Â
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 onelatency_ns
. Then, yourtimeslice = 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 totimeslice = 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.
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
add a comment |Â
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 onelatency_ns
. Then, yourtimeslice = 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 totimeslice = 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.
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
add a comment |Â
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 onelatency_ns
. Then, yourtimeslice = 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 totimeslice = 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.
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 onelatency_ns
. Then, yourtimeslice = 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 totimeslice = 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.
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
add a comment |Â
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
add a comment |Â
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%2f452172%2fdoes-linux-3-10-cfs-have-timeslices%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