Another proportional weight IO controller
Subsystems (9)
Quoted 15 lines · Nauman Rafique
If we start with bfq patches, this is how plan would look like:
1 Start with BFQ take 2.
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for disk time budgets, besides sector budget that is currently available (configurable option). (Fabio: Do you think we can just emulate
that using the existing code?). Another approach would be to give time slices just like CFQ (discussing?)
4 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Quoted 8 lines
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which re-uses memory resource controller code but is not dependent on it (may be biocgroup patches from dm-ioband can be used here directly)
The newest bio_cgroup doesn't use much memcg code I think. The older biocgroup tracks IO using mem_cgroup_charge(), and mem_cgroup_charge() remembers a struct page owns by which cgroup. But now biocgroup changes to directly put some hooks in __set_page_dirty() and some other places to track pages.
Quoted 6 lines
7 Start an offline email thread to keep track of progress on the above goals.
BFQ's support for hierarchy of cgroups means that its close to where we want to get. Any comments on what approach looks better?
Looks like a sane way :) . We are also trying to keep track of the discussion and development of IO controller. I'll start to have a look into BFQ.
Quoted 51 lines · Li Zefan
Quoted 25 lines
Quoted 24 lines · Vivek Goyal
Quoted 7 lines · Nauman Rafique
In an attempt to make sure that this discussion leads to something useful, we have summarized the points raised in this discussion and have come up with a strategy for future. The goal of this is to find common ground between all the approaches proposed on this mailing list.
1 Start with Satoshi's latest patches.
I have had a brief look at both Satoshi's patch and bfq. I kind of like bfq's patches for keeping track of per cgroup, per queue data structures. May be we can look there also.
Quoted 12 lines
2 Do the following to support propotional division:
a) Give time slices in proportion to weights (configurable option). We can support both priorities and weights by doing propotional division between requests with same priorities.
3 Schedule time slices using WF2Q+ instead of round robin.
Test the performance impact (both throughput and jitter in latency).
4 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support exists in dm-ioband and is provided by Andrea Righi's patches too.Quoted 5 lines
Quoted 3 lines
Does dm-iobnd support abosolute limit? I think till last version they did not. I have not check the latest version though.
No, dm-ioband still provides weight/share control only. Only Andrea Righi's patches support absolute limit.
Thanks for the correction.
Quoted 16 lines
Quoted 15 lines
Quoted 15 lines
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
5 Support multiple layers of cgroups to align IO controller behavior
with CPU scheduling behavior (more discussion?)
6 Incorporate an IO tracking approach which re-uses memory resource controller code but is not dependent on it (may be biocgroup patches from dm-ioband can be used here directly)
7 Start an offline email thread to keep track of progress on the above goals.Please feel free to add/modify items to the list
when you respond back. Any comments/suggestions are more than welcome.
Hi,
Quoted 5 lines
From: Nauman Rafique <[email protected]>
Date: Mon, Nov 17, 2008 09:01:48PM -0800If we start with bfq patches, this is how plan would look like:
Quoted 8 lines
1 Start with BFQ take 2.
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for disk time budgets, besides sector budget that is currently available (configurable option). (Fabio: Do you think we can just emulate
that using the existing code?). Another approach would be to give time slices just like CFQ (discussing?)
it should be possible without altering the code. The slices can be
assigned in the time domain using big values for max_budget. The logic
is: each process is assigned a budget (in the range [max_budget/2, max_budget], choosen from the feedback mechanism, driven in __bfq_bfqq_recalc_budget()), and if it does not complete it in timeout_sync milliseconds, it is charged a fixed amount of sectors of service.
Using big values for max_budget (where big means greater than two times the number of sectors the hard drive can transfer in timeout_sync milliseconds) makes the budgets always to time out, so the disk time is scheduled in slices of timeout_sync.
However this is just a temporary workaround to do some basic testing.
Modifying the scheduler to support time slices instead of sector budgets would indeed simplify the code; I think that the drawback would be being too unfair in the service domain. Of course we have to consider how much is important to be fair in the service domain, and how much added complexity/new code can we accept for it.
[ Better service domain fairness is one of the main reasons why
we started working on bfq, so, talking for me and Paolo it _is_ important :) ]
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
Quoted 16 lines
4 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which re-uses memory resource controller code but is not dependent on it (may be biocgroup patches from dm-ioband can be used here directly)
7 Start an offline email thread to keep track of progress on the above goals.
Quoted 3 lines
BFQ's support for hierarchy of cgroups means that its close to where we want to get. Any comments on what approach looks better?
The main problems with this approach (as with the cfq-based ones) in my opinion are:
- the request descriptor allocation problem Divyesh talked about,
- the impossibility of respecting different weights, resulting from the interlock problem with synchronous requests Vivek talked about [ in cfq/bfq this can happen when idling is disabled, e.g., for SSDs, or when using NCQ ],
but I think that correctly addressing your points 4.a) and 4.b) should solve them.
Quoted 15 lines · Nauman Rafique
If we start with bfq patches, this is how plan would look like:
1 Start with BFQ take 2.
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for disk time budgets, besides sector budget that is currently available (configurable option). (Fabio: Do you think we can just emulate
that using the existing code?). Another approach would be to give time slices just like CFQ (discussing?)
4 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Quoted 8 lines
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which re-uses memory resource controller code but is not dependent on it (may be biocgroup patches from dm-ioband can be used here directly)
The newest bio_cgroup doesn't use much memcg code I think. The older biocgroup tracks IO using mem_cgroup_charge(), and mem_cgroup_charge() remembers a struct page owns by which cgroup. But now biocgroup changes to directly put some hooks in __set_page_dirty() and some other places to track pages.
Quoted 6 lines
7 Start an offline email thread to keep track of progress on the above goals.
BFQ's support for hierarchy of cgroups means that its close to where we want to get. Any comments on what approach looks better?
Looks like a sane way :) . We are also trying to keep track of the discussion and development of IO controller. I'll start to have a look into BFQ.
Quoted 51 lines · Li Zefan
Quoted 25 lines
Quoted 24 lines · Vivek Goyal
Quoted 7 lines · Nauman Rafique
In an attempt to make sure that this discussion leads to something useful, we have summarized the points raised in this discussion and have come up with a strategy for future. The goal of this is to find common ground between all the approaches proposed on this mailing list.
1 Start with Satoshi's latest patches.
I have had a brief look at both Satoshi's patch and bfq. I kind of like bfq's patches for keeping track of per cgroup, per queue data structures. May be we can look there also.
Quoted 12 lines
2 Do the following to support propotional division:
a) Give time slices in proportion to weights (configurable option). We can support both priorities and weights by doing propotional division between requests with same priorities.
3 Schedule time slices using WF2Q+ instead of round robin.
Test the performance impact (both throughput and jitter in latency).
4 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support exists in dm-ioband and is provided by Andrea Righi's patches too.Quoted 5 lines
Quoted 3 lines
Does dm-iobnd support abosolute limit? I think till last version they did not. I have not check the latest version though.
No, dm-ioband still provides weight/share control only. Only Andrea Righi's patches support absolute limit.
Thanks for the correction.
Quoted 16 lines
Quoted 15 lines
Quoted 15 lines
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
5 Support multiple layers of cgroups to align IO controller behavior
with CPU scheduling behavior (more discussion?)
6 Incorporate an IO tracking approach which re-uses memory resource controller code but is not dependent on it (may be biocgroup patches from dm-ioband can be used here directly)
7 Start an offline email thread to keep track of progress on the above goals.Please feel free to add/modify items to the list
when you respond back. Any comments/suggestions are more than welcome.
Quoted 15 lines · Nauman Rafique
If we start with bfq patches, this is how plan would look like:
1 Start with BFQ take 2.
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for disk time budgets, besides sector budget that is currently available (configurable option). (Fabio: Do you think we can just emulate
that using the existing code?). Another approach would be to give time slices just like CFQ (discussing?)
4 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Quoted 8 lines
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which re-uses memory resource controller code but is not dependent on it (may be biocgroup patches from dm-ioband can be used here directly)
The newest bio_cgroup doesn't use much memcg code I think. The older biocgroup tracks IO using mem_cgroup_charge(), and mem_cgroup_charge() remembers a struct page owns by which cgroup. But now biocgroup changes to directly put some hooks in __set_page_dirty() and some other places to track pages.
Quoted 6 lines
7 Start an offline email thread to keep track of progress on the above goals.
BFQ's support for hierarchy of cgroups means that its close to where we want to get. Any comments on what approach looks better?
Looks like a sane way :) . We are also trying to keep track of the discussion and development of IO controller. I'll start to have a look into BFQ.
Quoted 51 lines · Li Zefan
Quoted 25 lines
Quoted 24 lines · Vivek Goyal
Quoted 7 lines · Nauman Rafique
In an attempt to make sure that this discussion leads to something useful, we have summarized the points raised in this discussion and have come up with a strategy for future. The goal of this is to find common ground between all the approaches proposed on this mailing list.
1 Start with Satoshi's latest patches.
I have had a brief look at both Satoshi's patch and bfq. I kind of like bfq's patches for keeping track of per cgroup, per queue data structures. May be we can look there also.
Quoted 12 lines
2 Do the following to support propotional division:
a) Give time slices in proportion to weights (configurable option). We can support both priorities and weights by doing propotional division between requests with same priorities.
3 Schedule time slices using WF2Q+ instead of round robin.
Test the performance impact (both throughput and jitter in latency).
4 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support exists in dm-ioband and is provided by Andrea Righi's patches too.Quoted 5 lines
Quoted 3 lines
Does dm-iobnd support abosolute limit? I think till last version they did not. I have not check the latest version though.
No, dm-ioband still provides weight/share control only. Only Andrea Righi's patches support absolute limit.
Thanks for the correction.
Quoted 16 lines
Quoted 15 lines
Quoted 15 lines
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
5 Support multiple layers of cgroups to align IO controller behavior
with CPU scheduling behavior (more discussion?)
6 Incorporate an IO tracking approach which re-uses memory resource controller code but is not dependent on it (may be biocgroup patches from dm-ioband can be used here directly)
7 Start an offline email thread to keep track of progress on the above goals.Please feel free to add/modify items to the list
when you respond back. Any comments/suggestions are more than welcome.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 25 lines · Li Zefan
Quoted 15 lines · Nauman Rafique
If we start with bfq patches, this is how plan would look like:
1 Start with BFQ take 2.
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for disk time budgets, besides sector budget that is currently available (configurable option). (Fabio: Do you think we can just emulate
that using the existing code?). Another approach would be to give time slices just like CFQ (discussing?)
4 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by AndreaQuoted 8 lines
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which re-uses memory resource controller code but is not dependent on it (may be biocgroup patches from dm-ioband can be used here directly)
Quoted 4 lines
The newest
bio_cgroupdoesn't use much memcg code I think. The older biocgroup tracks IO usingmem_cgroup_charge(), andmem_cgroup_charge()remembers a struct page owns by which cgroup. But now biocgroup changes to directly put some hooks in__set_page_dirty()and some other places to track pages.
I did not look into latest biocgroup patches, so may be you are right. Nevertheless, bfq currently gets cgroup info out of io context and so would handle only synchronous reads. For this action item, we have to make the latest biocgroup patches to work with bfq.
Quoted 63 lines
Quoted 7 lines
7 Start an offline email thread to keep track of progress on the above goals.
BFQ's support for hierarchy of cgroups means that its close to where we want to get. Any comments on what approach looks better?
Looks like a sane way :) . We are also trying to keep track of the discussion and development of IO controller. I'll start to have a look into BFQ.
Quoted 51 lines · Li Zefan
Quoted 25 lines
Quoted 24 lines · Vivek Goyal
Quoted 7 lines · Nauman Rafique
In an attempt to make sure that this discussion leads to something useful, we have summarized the points raised in this discussion and have come up with a strategy for future. The goal of this is to find common ground between all the approaches proposed on this mailing list.
1 Start with Satoshi's latest patches.
I have had a brief look at both Satoshi's patch and bfq. I kind of like bfq's patches for keeping track of per cgroup, per queue data structures. May be we can look there also.
Quoted 12 lines
2 Do the following to support propotional division:
a) Give time slices in proportion to weights (configurable option). We can support both priorities and weights by doing propotional division between requests with same priorities.
3 Schedule time slices using WF2Q+ instead of round robin.
Test the performance impact (both throughput and jitter in latency).
4 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support exists in dm-ioband and is provided by Andrea Righi's patches too.Quoted 5 lines
Quoted 3 lines
Does dm-iobnd support abosolute limit? I think till last version they did not. I have not check the latest version though.
No, dm-ioband still provides weight/share control only. Only Andrea Righi's patches support absolute limit.
Thanks for the correction.
Quoted 16 lines
Quoted 15 lines
Quoted 15 lines
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
5 Support multiple layers of cgroups to align IO controller behavior
with CPU scheduling behavior (more discussion?)
6 Incorporate an IO tracking approach which re-uses memory resource controller code but is not dependent on it (may be biocgroup patches from dm-ioband can be used here directly)
7 Start an offline email thread to keep track of progress on the above goals.Please feel free to add/modify items to the list
when you respond back. Any comments/suggestions are more than welcome.
Quoted 25 lines · Li Zefan
Quoted 15 lines · Nauman Rafique
If we start with bfq patches, this is how plan would look like:
1 Start with BFQ take 2.
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for disk time budgets, besides sector budget that is currently available (configurable option). (Fabio: Do you think we can just emulate
that using the existing code?). Another approach would be to give time slices just like CFQ (discussing?)
4 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by AndreaQuoted 8 lines
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which re-uses memory resource controller code but is not dependent on it (may be biocgroup patches from dm-ioband can be used here directly)
Quoted 4 lines
The newest
bio_cgroupdoesn't use much memcg code I think. The older biocgroup tracks IO usingmem_cgroup_charge(), andmem_cgroup_charge()remembers a struct page owns by which cgroup. But now biocgroup changes to directly put some hooks in__set_page_dirty()and some other places to track pages.
I did not look into latest biocgroup patches, so may be you are right. Nevertheless, bfq currently gets cgroup info out of io context and so would handle only synchronous reads. For this action item, we have to make the latest biocgroup patches to work with bfq.
Quoted 63 lines
Quoted 7 lines
7 Start an offline email thread to keep track of progress on the above goals.
BFQ's support for hierarchy of cgroups means that its close to where we want to get. Any comments on what approach looks better?
Looks like a sane way :) . We are also trying to keep track of the discussion and development of IO controller. I'll start to have a look into BFQ.
Quoted 51 lines · Li Zefan
Quoted 25 lines
Quoted 24 lines · Vivek Goyal
Quoted 7 lines · Nauman Rafique
In an attempt to make sure that this discussion leads to something useful, we have summarized the points raised in this discussion and have come up with a strategy for future. The goal of this is to find common ground between all the approaches proposed on this mailing list.
1 Start with Satoshi's latest patches.
I have had a brief look at both Satoshi's patch and bfq. I kind of like bfq's patches for keeping track of per cgroup, per queue data structures. May be we can look there also.
Quoted 12 lines
2 Do the following to support propotional division:
a) Give time slices in proportion to weights (configurable option). We can support both priorities and weights by doing propotional division between requests with same priorities.
3 Schedule time slices using WF2Q+ instead of round robin.
Test the performance impact (both throughput and jitter in latency).
4 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support exists in dm-ioband and is provided by Andrea Righi's patches too.Quoted 5 lines
Quoted 3 lines
Does dm-iobnd support abosolute limit? I think till last version they did not. I have not check the latest version though.
No, dm-ioband still provides weight/share control only. Only Andrea Righi's patches support absolute limit.
Thanks for the correction.
Quoted 16 lines
Quoted 15 lines
Quoted 15 lines
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
5 Support multiple layers of cgroups to align IO controller behavior
with CPU scheduling behavior (more discussion?)
6 Incorporate an IO tracking approach which re-uses memory resource controller code but is not dependent on it (may be biocgroup patches from dm-ioband can be used here directly)
7 Start an offline email thread to keep track of progress on the above goals.Please feel free to add/modify items to the list
when you respond back. Any comments/suggestions are more than welcome.
Quoted 25 lines · Li Zefan
Quoted 15 lines · Nauman Rafique
If we start with bfq patches, this is how plan would look like:
1 Start with BFQ take 2.
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for disk time budgets, besides sector budget that is currently available (configurable option). (Fabio: Do you think we can just emulate
that using the existing code?). Another approach would be to give time slices just like CFQ (discussing?)
4 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by AndreaQuoted 8 lines
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which re-uses memory resource controller code but is not dependent on it (may be biocgroup patches from dm-ioband can be used here directly)
Quoted 4 lines
The newest
bio_cgroupdoesn't use much memcg code I think. The older biocgroup tracks IO usingmem_cgroup_charge(), andmem_cgroup_charge()remembers a struct page owns by which cgroup. But now biocgroup changes to directly put some hooks in__set_page_dirty()and some other places to track pages.
I did not look into latest biocgroup patches, so may be you are right. Nevertheless, bfq currently gets cgroup info out of io context and so would handle only synchronous reads. For this action item, we have to make the latest biocgroup patches to work with bfq.
Quoted 63 lines
Quoted 7 lines
7 Start an offline email thread to keep track of progress on the above goals.
BFQ's support for hierarchy of cgroups means that its close to where we want to get. Any comments on what approach looks better?
Looks like a sane way :) . We are also trying to keep track of the discussion and development of IO controller. I'll start to have a look into BFQ.
Quoted 51 lines · Li Zefan
Quoted 25 lines
Quoted 24 lines · Vivek Goyal
Quoted 7 lines · Nauman Rafique
In an attempt to make sure that this discussion leads to something useful, we have summarized the points raised in this discussion and have come up with a strategy for future. The goal of this is to find common ground between all the approaches proposed on this mailing list.
1 Start with Satoshi's latest patches.
I have had a brief look at both Satoshi's patch and bfq. I kind of like bfq's patches for keeping track of per cgroup, per queue data structures. May be we can look there also.
Quoted 12 lines
2 Do the following to support propotional division:
a) Give time slices in proportion to weights (configurable option). We can support both priorities and weights by doing propotional division between requests with same priorities.
3 Schedule time slices using WF2Q+ instead of round robin.
Test the performance impact (both throughput and jitter in latency).
4 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support exists in dm-ioband and is provided by Andrea Righi's patches too.Quoted 5 lines
Quoted 3 lines
Does dm-iobnd support abosolute limit? I think till last version they did not. I have not check the latest version though.
No, dm-ioband still provides weight/share control only. Only Andrea Righi's patches support absolute limit.
Thanks for the correction.
Quoted 16 lines
Quoted 15 lines
Quoted 15 lines
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
5 Support multiple layers of cgroups to align IO controller behavior
with CPU scheduling behavior (more discussion?)
6 Incorporate an IO tracking approach which re-uses memory resource controller code but is not dependent on it (may be biocgroup patches from dm-ioband can be used here directly)
7 Start an offline email thread to keep track of progress on the above goals.Please feel free to add/modify items to the list
when you respond back. Any comments/suggestions are more than welcome.
Hi,
Quoted 5 lines
From: Nauman Rafique <[email protected]>
Date: Mon, Nov 17, 2008 09:01:48PM -0800If we start with bfq patches, this is how plan would look like:
Quoted 8 lines
1 Start with BFQ take 2.
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for disk time budgets, besides sector budget that is currently available (configurable option). (Fabio: Do you think we can just emulate
that using the existing code?). Another approach would be to give time slices just like CFQ (discussing?)
it should be possible without altering the code. The slices can be
assigned in the time domain using big values for max_budget. The logic
is: each process is assigned a budget (in the range [max_budget/2, max_budget], choosen from the feedback mechanism, driven in __bfq_bfqq_recalc_budget()), and if it does not complete it in timeout_sync milliseconds, it is charged a fixed amount of sectors of service.
Using big values for max_budget (where big means greater than two times the number of sectors the hard drive can transfer in timeout_sync milliseconds) makes the budgets always to time out, so the disk time is scheduled in slices of timeout_sync.
However this is just a temporary workaround to do some basic testing.
Modifying the scheduler to support time slices instead of sector budgets would indeed simplify the code; I think that the drawback would be being too unfair in the service domain. Of course we have to consider how much is important to be fair in the service domain, and how much added complexity/new code can we accept for it.
[ Better service domain fairness is one of the main reasons why
we started working on bfq, so, talking for me and Paolo it _is_ important :) ]
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
Quoted 16 lines
4 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which re-uses memory resource controller code but is not dependent on it (may be biocgroup patches from dm-ioband can be used here directly)
7 Start an offline email thread to keep track of progress on the above goals.
Quoted 3 lines
BFQ's support for hierarchy of cgroups means that its close to where we want to get. Any comments on what approach looks better?
The main problems with this approach (as with the cfq-based ones) in my opinion are:
- the request descriptor allocation problem Divyesh talked about,
- the impossibility of respecting different weights, resulting from the interlock problem with synchronous requests Vivek talked about [ in cfq/bfq this can happen when idling is disabled, e.g., for SSDs, or when using NCQ ],
but I think that correctly addressing your points 4.a) and 4.b) should solve them.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 36 lines · Fabio Checconi
Hi,
Quoted 5 lines
From: Nauman Rafique <[email protected]>
Date: Mon, Nov 17, 2008 09:01:48PM -0800If we start with bfq patches, this is how plan would look like:
Quoted 8 lines
1 Start with BFQ take 2.
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for disk time budgets, besides sector budget that is currently available (configurable option). (Fabio: Do you think we can just emulate
that using the existing code?). Another approach would be to give time slices just like CFQ (discussing?)it should be possible without altering the code. The slices can be
assigned in the time domain using big values formax_budget. The logic
is: each process is assigned a budget (in the range [max_budget/2,max_budget], choosen from the feedback mechanism, driven in__bfq_bfqq_recalc_budget()), and if it does not complete it intimeout_syncmilliseconds, it is charged a fixed amount of sectors of service.Using big values for
max_budget(where big means greater than two times the number of sectors the hard drive can transfer intimeout_syncmilliseconds) makes the budgets always to time out, so the disk time is scheduled in slices oftimeout_sync.However this is just a temporary workaround to do some basic testing.
Modifying the scheduler to support time slices instead of sector budgets would indeed simplify the code; I think that the drawback would be being too unfair in the service domain. Of course we have to consider how much is important to be fair in the service domain, and how much added complexity/new code can we accept for it.
Quoted 8 lines
[ Better service domain fairness is one of the main reasons why
we started working on bfq, so, talking for me and Paolo it _is_ important :) ]I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.
We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
Thanks
Vivek
Quoted 36 lines · Fabio Checconi
Hi,
Quoted 5 lines
From: Nauman Rafique <[email protected]>
Date: Mon, Nov 17, 2008 09:01:48PM -0800If we start with bfq patches, this is how plan would look like:
Quoted 8 lines
1 Start with BFQ take 2.
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for disk time budgets, besides sector budget that is currently available (configurable option). (Fabio: Do you think we can just emulate
that using the existing code?). Another approach would be to give time slices just like CFQ (discussing?)it should be possible without altering the code. The slices can be
assigned in the time domain using big values formax_budget. The logic
is: each process is assigned a budget (in the range [max_budget/2,max_budget], choosen from the feedback mechanism, driven in__bfq_bfqq_recalc_budget()), and if it does not complete it intimeout_syncmilliseconds, it is charged a fixed amount of sectors of service.Using big values for
max_budget(where big means greater than two times the number of sectors the hard drive can transfer intimeout_syncmilliseconds) makes the budgets always to time out, so the disk time is scheduled in slices oftimeout_sync.However this is just a temporary workaround to do some basic testing.
Modifying the scheduler to support time slices instead of sector budgets would indeed simplify the code; I think that the drawback would be being too unfair in the service domain. Of course we have to consider how much is important to be fair in the service domain, and how much added complexity/new code can we accept for it.
Quoted 7 lines
[ Better service domain fairness is one of the main reasons why
we started working on bfq, so, talking for me and Paolo it _is_ important :) ]I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
I think "time only budget" vs "sector budget" is dependent on the definition of fairness: do you want to be fair in the time that is given to each cgroup or fair in total number of sectors transferred. And the appropriate definition of fairness depends on how/where the IO scheduler is used. Do you think the work-around that you mentioned would have a significant performance difference compared to direct built-in support?
Quoted 33 lines
Quoted 18 lines
4 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which re-uses memory resource controller code but is not dependent on it (may be biocgroup patches from dm-ioband can be used here directly)
7 Start an offline email thread to keep track of progress on the above goals.Quoted 3 lines
BFQ's support for hierarchy of cgroups means that its close to where we want to get. Any comments on what approach looks better?
The main problems with this approach (as with the cfq-based ones) in my opinion are:
- the request descriptor allocation problem Divyesh talked about,
- the impossibility of respecting different weights, resulting from the interlock problem with synchronous requests Vivek talked about [ in cfq/bfq this can happen when idling is disabled, e.g., for SSDs, or when using NCQ ],but I think that correctly addressing your points 4.a) and 4.b) should solve them.
Quoted 36 lines · Fabio Checconi
Hi,
Quoted 5 lines
From: Nauman Rafique <[email protected]>
Date: Mon, Nov 17, 2008 09:01:48PM -0800If we start with bfq patches, this is how plan would look like:
Quoted 8 lines
1 Start with BFQ take 2.
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for disk time budgets, besides sector budget that is currently available (configurable option). (Fabio: Do you think we can just emulate
that using the existing code?). Another approach would be to give time slices just like CFQ (discussing?)it should be possible without altering the code. The slices can be
assigned in the time domain using big values formax_budget. The logic
is: each process is assigned a budget (in the range [max_budget/2,max_budget], choosen from the feedback mechanism, driven in__bfq_bfqq_recalc_budget()), and if it does not complete it intimeout_syncmilliseconds, it is charged a fixed amount of sectors of service.Using big values for
max_budget(where big means greater than two times the number of sectors the hard drive can transfer intimeout_syncmilliseconds) makes the budgets always to time out, so the disk time is scheduled in slices oftimeout_sync.However this is just a temporary workaround to do some basic testing.
Modifying the scheduler to support time slices instead of sector budgets would indeed simplify the code; I think that the drawback would be being too unfair in the service domain. Of course we have to consider how much is important to be fair in the service domain, and how much added complexity/new code can we accept for it.
Quoted 8 lines
[ Better service domain fairness is one of the main reasons why
we started working on bfq, so, talking for me and Paolo it _is_ important :) ]I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.
We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
Thanks
Vivek
Quoted 36 lines · Fabio Checconi
Hi,
Quoted 5 lines
From: Nauman Rafique <[email protected]>
Date: Mon, Nov 17, 2008 09:01:48PM -0800If we start with bfq patches, this is how plan would look like:
Quoted 8 lines
1 Start with BFQ take 2.
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for disk time budgets, besides sector budget that is currently available (configurable option). (Fabio: Do you think we can just emulate
that using the existing code?). Another approach would be to give time slices just like CFQ (discussing?)it should be possible without altering the code. The slices can be
assigned in the time domain using big values formax_budget. The logic
is: each process is assigned a budget (in the range [max_budget/2,max_budget], choosen from the feedback mechanism, driven in__bfq_bfqq_recalc_budget()), and if it does not complete it intimeout_syncmilliseconds, it is charged a fixed amount of sectors of service.Using big values for
max_budget(where big means greater than two times the number of sectors the hard drive can transfer intimeout_syncmilliseconds) makes the budgets always to time out, so the disk time is scheduled in slices oftimeout_sync.However this is just a temporary workaround to do some basic testing.
Modifying the scheduler to support time slices instead of sector budgets would indeed simplify the code; I think that the drawback would be being too unfair in the service domain. Of course we have to consider how much is important to be fair in the service domain, and how much added complexity/new code can we accept for it.
Quoted 8 lines
[ Better service domain fairness is one of the main reasons why
we started working on bfq, so, talking for me and Paolo it _is_ important :) ]I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.
We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
Thanks
Vivek
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling, hw_tag detection and to the CIC_SEEKY heuristic.
The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;
- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.
Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness, hw_tag checking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
My main goal here is basically avoiding addition of Yet Another IO scheduler, especially one that is so closely tied to CFQ already.
I'll start things off by splitting cfq into a few files similar to what bfq has done, as I think it makes a lot of sense. Fabio, if you could create patches for the small behavioural changes you made, we can discuss and hopefully merge those next.
Signature · 1 line
Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.
Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
Hi Fabio,
I though will give bfq a try. I get following when I put my current shell into a newly created cgroup and then try to do "ls".
Thanks
Vivek
[ 1246.498412] BUG: unable to handle kernel NULL pointer dereference at 000000bc [ 1246.498674] IP: [<c034210b>] __bfq_cic_change_cgroup+0x148/0x239 [ 1246.498674] *pde = 00000000 [ 1246.498674] Oops: 0002 [#1] SMP [ 1246.498674] last sysfs file: /sys/devices/pci0000:00/0000:00:01.1/host0/target0:0:1/0:0:1:0/block/sdb/queue/scheduler [ 1246.498674] Modules linked in: [ 1246.498674] [ 1246.498674] Pid: 2352, comm: dd Not tainted (2.6.28-rc4-bfq #2) [ 1246.498674] EIP: 0060:[<c034210b>] EFLAGS: 00200046 CPU: 0 [ 1246.498674] EIP is at __bfq_cic_change_cgroup+0x148/0x239 [ 1246.498674] EAX: df0e50ac EBX: df0e5000 ECX: 00200046 EDX: df32f300 [ 1246.498674] ESI: dece6ee0 EDI: df0e5000 EBP: df37fc14 ESP: df37fbdc [ 1246.498674] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 [ 1246.498674] Process dd (pid: 2352, ti=df37e000 task=dfb01e00 task.ti=df37e000) [ 1246.498674] Stack: [ 1246.498674] decc9780 dfa98948 df32f300 00000000 00000000 00200046 dece6ef0 00000000 [ 1246.498674] df0e5000 00000000 df0f8014 df32f300 dfa98948 dec0c548 df37fc54 c034351b [ 1246.498674] 00000010 dfabe6c0 dec0c548 00080000 df32f300 00000001 00200246 dfa98988 [ 1246.498674] Call Trace: [ 1246.498674] [<c034351b>] ? bfq_set_request+0x1f5/0x291 [ 1246.498674] [<c0343326>] ? bfq_set_request+0x0/0x291 [ 1246.498674] [<c0333ffe>] ? elv_set_request+0x17/0x26 [ 1246.498674] [<c03365ad>] ? get_request+0x15e/0x1e7 [ 1246.498674] [<c0336af5>] ? get_request_wait+0x22/0xd8 [ 1246.498674] [<c04943b9>] ? dm_merge_bvec+0x88/0xb5 [ 1246.498674] [<c0336f31>] ? __make_request+0x25e/0x310 [ 1246.498674] [<c0494c02>] ? dm_request+0x137/0x150 [ 1246.498674] [<c0335ecf>] ? generic_make_request+0x1e9/0x21f [ 1246.498674] [<c033708b>] ? submit_bio+0xa8/0xb1 [ 1246.498674] [<c0264e49>] ? get_page+0x8/0xe [ 1246.498674] [<c0265157>] ? __lru_cache_add+0x27/0x43 [ 1246.498674] [<c029fea2>] ? mpage_end_io_read+0x0/0x70 [ 1246.498674] [<c029f453>] ? mpage_bio_submit+0x1c/0x21 [ 1246.498674] [<c029ffc3>] ? mpage_readpages+0xb1/0xbe [ 1246.498674] [<c02c04d6>] ? ext3_readpages+0x0/0x16 [ 1246.498674] [<c02c04ea>] ? ext3_readpages+0x14/0x16 [ 1246.498674] [<c02c0f4a>] ? ext3_get_block+0x0/0xd4 [ 1246.498674] [<c02649ee>] ? __do_page_cache_readahead+0xde/0x15b [ 1246.498674] [<c0264cab>] ? ondemand_readahead+0xf9/0x107 [ 1246.498674] [<c0264d1e>] ? page_cache_sync_readahead+0x16/0x1c [ 1246.498674] [<c02600b2>] ? generic_file_aio_read+0x1ad/0x463 [ 1246.498674] [<c02811cb>] ? do_sync_read+0xab/0xe9 [ 1246.498674] [<c0235fe4>] ? autoremove_wake_function+0x0/0x33 [ 1246.498674] [<c0268f15>] ? __inc_zone_page_state+0x12/0x15 [ 1246.498674] [<c026c1a9>] ? handle_mm_fault+0x5a0/0x5b5 [ 1246.498674] [<c0314bcc>] ? security_file_permission+0xf/0x11 [ 1246.498674] [<c0281949>] ? vfs_read+0x80/0xda [ 1246.498674] [<c0281120>] ? do_sync_read+0x0/0xe9 [ 1246.498674] [<c0281bab>] ? sys_read+0x3b/0x5d [ 1246.498674] [<c0203a3d>] ? sysenter_do_call+0x12/0x21 [ 1246.498674] Code: 55 e4 8b 55 d0 89 f0 e8 72 ea ff ff 85 c0 74 04 0f 0b eb fe 8d 46 10 89 45 e0 e8 57 a5 28 00 89 45 dc 8b 55 d0 8d 83 ac 00 00 00 <89> 15 bc 00 00 00 8d 56 14 e8 18 e9 ff ff 8b 75 d0 8d 93 b4 00 [ 1246.498674] EIP: [<c034210b>] __bfq_cic_change_cgroup+0x148/0x239 SS:ESP 0068:df37fbdc [ 1246.498674] ---[ end trace 6bd1df99b7a9cb00 ]---
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.
Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness, hw_tag checking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
My main goal here is basically avoiding addition of Yet Another IO scheduler, especially one that is so closely tied to CFQ already.
I'll start things off by splitting cfq into a few files similar to what bfq has done, as I think it makes a lot of sense. Fabio, if you could create patches for the small behavioural changes you made, we can discuss and hopefully merge those next.
Signature · 1 line
Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.
Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness, hw_tag checking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
My main goal here is basically avoiding addition of Yet Another IO scheduler, especially one that is so closely tied to CFQ already.
I'll start things off by splitting cfq into a few files similar to what bfq has done, as I think it makes a lot of sense. Fabio, if you could create patches for the small behavioural changes you made, we can discuss and hopefully merge those next.
Signature · 1 line
Jens Axboe
A message that is not in the archive (sent off-list or not yet received): 20081118191208.GJ26308-tSWWG44O7X1aa/[email protected]
Quoted 50 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
Quoted 6 lines
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.
Hi Jens,
What do you think about "hierarchical" and cgroup part of BFQ patch? Do you intend to incorporate/include that piece also or do you think that's not the way to go for IO controller stuff.
Thanks
Vivek
Quoted 15 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
My main goal here is basically avoiding addition of Yet Another IO scheduler, especially one that is so closely tied to CFQ already.
I'll start things off by splitting cfq into a few files similar to what bfq has done, as I think it makes a lot of sense. Fabio, if you could create patches for the small behavioural changes you made, we can discuss and hopefully merge those next.
Signature · 1 line
Jens Axboe
Quoted 8 lines
From: Jens Axboe <[email protected]>
Date: Tue, Nov 18, 2008 08:12:08PM +0100Quoted 4 lines · Fabio Checconi
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.
...
Quoted 11 lines
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
Quoted 8 lines
My main goal here is basically avoiding addition of Yet Another IO scheduler, especially one that is so closely tied to CFQ already.
I'll start things off by splitting cfq into a few files similar to what bfq has done, as I think it makes a lot of sense. Fabio, if you could create patches for the small behavioural changes you made, we can discuss and hopefully merge those next.
Ok, I can do that, I need just a little bit of time to organize the work.
About these small (some of them are really small) changes, a mixed list of things that they will touch and/or things that I'd like to have clear before starting to write the patches (maybe we can start another thread for them):
- In cfq_exit_single_io_context() and in changed_ioprio(), cic->key is dereferenced without holding any lock. As I reported in [1] this seems to be a problem when an exit() races with a cfq_exit_queue() and in a few other cases. In BFQ we used a somehow involved mechanism to avoid that, abusing rcu (of course we'll have to wait the patch to talk about it :) ), but given my lack of understanding of some parts of the block layer, I'd be interested in knowing if the race is possible and/or if there is something more involved going on that can cause the same effects.
- set_task_ioprio() in fs/ioprio.c doesn't seem to have a write memory barrier to pair with the dependent read one in cfq_get_io_context().
- CFQ_MIN_TT is 2ms, this can result, depending on the value of HZ in timeouts of one jiffy, that may expire too early, so we are just wasting time and do not actually wait for the task to present its new request. Dealing with seeky traffic we've seen a lot of early timeouts due to one jiffy timers expiring too early, is it worth fixing or can we live with that?
- To detect hw tagging in BFQ we consider a sample valid iff the number of requests that the scheduler could have dispatched (given by cfqd->rb_queued + cfqd->rq_in_driver, i.e., the ones still into the scheduler plus the ones into the driver) is higher than the CFQ_HW_QUEUE_MIN threshold. This obviously caused no problems during testing, but the way CFQ uses now seems a little bit strange.
- Initially, cic->last_request_pos is zero, so the sdist charged to a task for its first seek depends on the position on the disk that is accessed first, independently from its seekiness. Even if there is a cap on that value, we choose to not charge the first seek to processes; that resulted in less wrong predictions for purely sequential loads.
- From my understanding, with shared I/O contexts, two different tasks may concurrently lookup for a cfqd into the same ioc. This may result in cfq_drop_dead_cic() being called two times for the same cic. Am I missing something that prevents that from happening?
Regarding the code splitup, do you think you'll go for the CFS(BFQ) way, using a single compilation unit and including the .c files, or a layout with different compilation units (like the ll_rw_blk.c splitup)?
Quoted 52 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
Quoted 8 lines
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality to elv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.
Jens, what is your opinion everything beyond (1) in the above list?
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Quoted 13 lines
My main goal here is basically avoiding addition of Yet Another IO scheduler, especially one that is so closely tied to CFQ already.
I'll start things off by splitting cfq into a few files similar to what bfq has done, as I think it makes a lot of sense. Fabio, if you could create patches for the small behavioural changes you made, we can discuss and hopefully merge those next.
--
Jens Axboe
Quoted 50 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
Quoted 6 lines
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.
Hi Jens,
What do you think about "hierarchical" and cgroup part of BFQ patch? Do you intend to incorporate/include that piece also or do you think that's not the way to go for IO controller stuff.
Thanks
Vivek
Quoted 15 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
My main goal here is basically avoiding addition of Yet Another IO scheduler, especially one that is so closely tied to CFQ already.
I'll start things off by splitting cfq into a few files similar to what bfq has done, as I think it makes a lot of sense. Fabio, if you could create patches for the small behavioural changes you made, we can discuss and hopefully merge those next.
Signature · 1 line
Jens Axboe
Quoted 50 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
Quoted 6 lines
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.
Hi Jens,
What do you think about "hierarchical" and cgroup part of BFQ patch? Do you intend to incorporate/include that piece also or do you think that's not the way to go for IO controller stuff.
Thanks
Vivek
Quoted 15 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
My main goal here is basically avoiding addition of Yet Another IO scheduler, especially one that is so closely tied to CFQ already.
I'll start things off by splitting cfq into a few files similar to what bfq has done, as I think it makes a lot of sense. Fabio, if you could create patches for the small behavioural changes you made, we can discuss and hopefully merge those next.
Signature · 1 line
Jens Axboe
Quoted 8 lines
From: Jens Axboe <[email protected]>
Date: Tue, Nov 18, 2008 08:12:08PM +0100Quoted 4 lines · Fabio Checconi
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.
...
Quoted 11 lines
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
Quoted 8 lines
My main goal here is basically avoiding addition of Yet Another IO scheduler, especially one that is so closely tied to CFQ already.
I'll start things off by splitting cfq into a few files similar to what bfq has done, as I think it makes a lot of sense. Fabio, if you could create patches for the small behavioural changes you made, we can discuss and hopefully merge those next.
Ok, I can do that, I need just a little bit of time to organize the work.
About these small (some of them are really small) changes, a mixed list of things that they will touch and/or things that I'd like to have clear before starting to write the patches (maybe we can start another thread for them):
- In cfq_exit_single_io_context() and in changed_ioprio(), cic->key is dereferenced without holding any lock. As I reported in [1] this seems to be a problem when an exit() races with a cfq_exit_queue() and in a few other cases. In BFQ we used a somehow involved mechanism to avoid that, abusing rcu (of course we'll have to wait the patch to talk about it :) ), but given my lack of understanding of some parts of the block layer, I'd be interested in knowing if the race is possible and/or if there is something more involved going on that can cause the same effects.
- set_task_ioprio() in fs/ioprio.c doesn't seem to have a write memory barrier to pair with the dependent read one in cfq_get_io_context().
- CFQ_MIN_TT is 2ms, this can result, depending on the value of HZ in timeouts of one jiffy, that may expire too early, so we are just wasting time and do not actually wait for the task to present its new request. Dealing with seeky traffic we've seen a lot of early timeouts due to one jiffy timers expiring too early, is it worth fixing or can we live with that?
- To detect hw tagging in BFQ we consider a sample valid iff the number of requests that the scheduler could have dispatched (given by cfqd->rb_queued + cfqd->rq_in_driver, i.e., the ones still into the scheduler plus the ones into the driver) is higher than the CFQ_HW_QUEUE_MIN threshold. This obviously caused no problems during testing, but the way CFQ uses now seems a little bit strange.
- Initially, cic->last_request_pos is zero, so the sdist charged to a task for its first seek depends on the position on the disk that is accessed first, independently from its seekiness. Even if there is a cap on that value, we choose to not charge the first seek to processes; that resulted in less wrong predictions for purely sequential loads.
- From my understanding, with shared I/O contexts, two different tasks may concurrently lookup for a cfqd into the same ioc. This may result in cfq_drop_dead_cic() being called two times for the same cic. Am I missing something that prevents that from happening?
Regarding the code splitup, do you think you'll go for the CFS(BFQ) way, using a single compilation unit and including the .c files, or a layout with different compilation units (like the ll_rw_blk.c splitup)?
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 7 lines · Fabio Checconi
- To detect hw tagging in BFQ we consider a sample valid iff the number of requests that the scheduler could have dispatched (given by
cfqd->rb_queued+cfqd->rq_in_driver, i.e., the ones still into the scheduler plus the ones into the driver) is higher than theCFQ_HW_QUEUE_MINthreshold. This obviously caused no problems during testing, but the way CFQ uses now seems a little bit strange.
BFQ's tag detection logic is broken in the same way that CFQ's used to be. Explanation is in this patch:
============================x8============================ commit 45333d5a31296d0af886d94f1d08f128231cab8e
Author: Aaron Carroll <[email protected]> Date: Tue Aug 26 15:52:36 2008 +0200
cfq-iosched: fix queue depth detection
CFQ's detection of queueing devices assumes a non-queuing device and detects if the queue depth reaches a certain threshold. Under some workloads (e.g. synchronous reads), CFQ effectively forces a unit queue depth, thus defeating the detection logic. This leads to poor performance on queuing hardware, since the idle window remains enabled.
This patch inverts the sense of the logic: assume a queuing-capable device, and detect if the depth does not exceed the threshold.
============================x8=============================
BFQ seems better than CFQ at avoiding this problem though. Using the following fio job, I can routinely trigger it for 10s or so before BFQ detects queuing.
============================x8============================= [global]
direct=1
ioengine=sync
norandommap
randrepeat=0
filename=/dev/sdb
bs=16k
runtime=200time_based
[reader]
rw=randread
numjobs=128 ============================x8=============================
Quoted 37 lines · Fabio Checconi
Quoted 8 lines
From: Jens Axboe <[email protected]>
Date: Tue, Nov 18, 2008 08:12:08PM +0100Quoted 4 lines · Fabio Checconi
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic....
Quoted 11 lines
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
Quoted 8 lines
My main goal here is basically avoiding addition of Yet Another IO scheduler, especially one that is so closely tied to CFQ already.
I'll start things off by splitting cfq into a few files similar to what bfq has done, as I think it makes a lot of sense. Fabio, if you could create patches for the small behavioural changes you made, we can discuss and hopefully merge those next.
Ok, I can do that, I need just a little bit of time to organize the work.
About these small (some of them are really small) changes, a mixed list of things that they will touch and/or things that I'd like to have clear before starting to write the patches (maybe we can start another thread for them):
Quoted 9 lines
- In
cfq_exit_single_io_context()and inchanged_ioprio(),cic->keyis dereferenced without holding any lock. As I reported in [1] this seems to be a problem when anexit()races with acfq_exit_queue()and in a few other cases. In BFQ we used a somehow involved mechanism to avoid that, abusing rcu (of course we'll have to wait the patch to talk about it :) ), but given my lack of understanding of some parts of the block layer, I'd be interested in knowing if the race is possible and/or if there is something more involved going on that can cause the same effects.
OK, I'm assuming this is where Nikanth got his idea for the patch from? It does seem racy in spots, we can definitely proceed on getting that tightened up some more.
Quoted 3 lines
-
set_task_ioprio()infs/ioprio.cdoesn't seem to have a write memory barrier to pair with the dependent read one incfq_get_io_context().
Agree, that needs fixing.
Quoted 6 lines
-
CFQ_MIN_TTis 2ms, this can result, depending on the value of HZ in timeouts of one jiffy, that may expire too early, so we are just wasting time and do not actually wait for the task to present its new request. Dealing with seeky traffic we've seen a lot of early timeouts due to one jiffy timers expiring too early, is it worth fixing or can we live with that?
We probably just need to enfore a '2 jiffies minimum' rule for that.
Quoted 7 lines
- To detect hw tagging in BFQ we consider a sample valid iff the number of requests that the scheduler could have dispatched (given by
cfqd->rb_queued+cfqd->rq_in_driver, i.e., the ones still into the scheduler plus the ones into the driver) is higher than theCFQ_HW_QUEUE_MINthreshold. This obviously caused no problems during testing, but the way CFQ uses now seems a little bit strange.
Not sure this matters a whole lot, but your approach makes sense. Have you seen the later change to the CFQ logic from Aaron?
Quoted 6 lines
- Initially,
cic->last_request_posis zero, so the sdist charged to a task for its first seek depends on the position on the disk that is accessed first, independently from its seekiness. Even if there is a cap on that value, we choose to not charge the first seek to processes; that resulted in less wrong predictions for purely sequential loads.
Agreed, that's is definitely off.
Quoted 5 lines
- From my understanding, with shared I/O contexts, two different tasks may concurrently lookup for a cfqd into the same ioc. This may result in
cfq_drop_dead_cic()being called two times for the same cic. Am I missing something that prevents that from happening?
That also looks problematic. I guess we need to recheck that under the lock when in cfq_drop_dead_cic().
Quoted 3 lines
Regarding the code splitup, do you think you'll go for the CFS(BFQ) way, using a single compilation unit and including the .c files, or a layout with different compilation units (like the
ll_rw_blk.csplitup)?
Different compilation units would be my preferred choice.
Signature · 1 line
Jens Axboe
Quoted 7 lines · Fabio Checconi
- To detect hw tagging in BFQ we consider a sample valid iff the number of requests that the scheduler could have dispatched (given by
cfqd->rb_queued+cfqd->rq_in_driver, i.e., the ones still into the scheduler plus the ones into the driver) is higher than theCFQ_HW_QUEUE_MINthreshold. This obviously caused no problems during testing, but the way CFQ uses now seems a little bit strange.
BFQ's tag detection logic is broken in the same way that CFQ's used to be. Explanation is in this patch:
============================x8============================ commit 45333d5a31296d0af886d94f1d08f128231cab8e
Author: Aaron Carroll <[email protected]> Date: Tue Aug 26 15:52:36 2008 +0200
cfq-iosched: fix queue depth detection
CFQ's detection of queueing devices assumes a non-queuing device and detects if the queue depth reaches a certain threshold. Under some workloads (e.g. synchronous reads), CFQ effectively forces a unit queue depth, thus defeating the detection logic. This leads to poor performance on queuing hardware, since the idle window remains enabled.
This patch inverts the sense of the logic: assume a queuing-capable device, and detect if the depth does not exceed the threshold.
============================x8=============================
BFQ seems better than CFQ at avoiding this problem though. Using the following fio job, I can routinely trigger it for 10s or so before BFQ detects queuing.
============================x8============================= [global]
direct=1
ioengine=sync
norandommap
randrepeat=0
filename=/dev/sdb
bs=16k
runtime=200time_based
[reader]
rw=randread
numjobs=128 ============================x8=============================
Quoted 7 lines · Fabio Checconi
- To detect hw tagging in BFQ we consider a sample valid iff the number of requests that the scheduler could have dispatched (given by
cfqd->rb_queued+cfqd->rq_in_driver, i.e., the ones still into the scheduler plus the ones into the driver) is higher than theCFQ_HW_QUEUE_MINthreshold. This obviously caused no problems during testing, but the way CFQ uses now seems a little bit strange.
BFQ's tag detection logic is broken in the same way that CFQ's used to be. Explanation is in this patch:
============================x8============================ commit 45333d5a31296d0af886d94f1d08f128231cab8e
Author: Aaron Carroll <[email protected]> Date: Tue Aug 26 15:52:36 2008 +0200
cfq-iosched: fix queue depth detection
CFQ's detection of queueing devices assumes a non-queuing device and detects if the queue depth reaches a certain threshold. Under some workloads (e.g. synchronous reads), CFQ effectively forces a unit queue depth, thus defeating the detection logic. This leads to poor performance on queuing hardware, since the idle window remains enabled.
This patch inverts the sense of the logic: assume a queuing-capable device, and detect if the depth does not exceed the threshold.
============================x8=============================
BFQ seems better than CFQ at avoiding this problem though. Using the following fio job, I can routinely trigger it for 10s or so before BFQ detects queuing.
============================x8============================= [global]
direct=1
ioengine=sync
norandommap
randrepeat=0
filename=/dev/sdb
bs=16k
runtime=200time_based
[reader]
rw=randread
numjobs=128 ============================x8=============================
Quoted 12 lines
From: Aaron Carroll <[email protected]>
Date: Wed, Nov 19, 2008 12:52:42PM +1100Quoted 7 lines · Fabio Checconi
- To detect hw tagging in BFQ we consider a sample valid iff the number of requests that the scheduler could have dispatched (given by
cfqd->rb_queued+cfqd->rq_in_driver, i.e., the ones still into the scheduler plus the ones into the driver) is higher than theCFQ_HW_QUEUE_MINthreshold. This obviously caused no problems during testing, but the way CFQ uses now seems a little bit strange.
Quoted 3 lines
BFQ's tag detection logic is broken in the same way that CFQ's used to be. Explanation is in this patch:
If you look at bfq_update_hw_tag(), the logic introduced by the patch you mention is still there; BFQ starts with ->hw_tag = 1, and updates it every 32 valid samples. What changed WRT your patch, apart from the number of samples, is that the condition for a sample to be valid is:
bfqd->rq_in_driver + bfqd->queued >= 5
while in your patch it is:
cfqd->rq_queued > 5 || cfqd->rq_in_driver > 5
We preferred the first one because that sum better reflects the number of requests that could have been dispatched, and I don't think that this is wrong.
There is a problem, but it's not within the tag detection logic itself.
Quoted 1 line
From some quick experiments, what happens is that when a process starts,
CFQ considers it seeky (*), BFQ doesn't. As a side effect BFQ does not always dispatch enough requests to correctly detect tagging.
At the first seek you cannot tell if the process is going to bee seeky or not, and we have chosen to consider it sequential because it improved fairness in some sequential workloads (the CIC_SEEKY heuristic is used also to determine the idle_window length in [bc]fq_arm_slice_timer()).
Anyway, we're dealing with heuristics, and they tend to favor some workload over other ones. If recovering this thoughput loss is more important than a transient unfairness due to short idling windows assigned to sequential processes when they start, I've no problems in switching the CIC_SEEKY logic to consider a process seeky when it starts.
Thank you for testing and for pointing out this issue, we missed it in our testing.
(*) to be correct, the initial classification depends on the position
of the first accessed sector.
Quoted 50 lines
From: Fabio Checconi <[email protected]>
Date: Wed, Nov 19, 2008 11:17:01AM +0100Quoted 12 lines
From: Aaron Carroll <[email protected]>
Date: Wed, Nov 19, 2008 12:52:42PM +1100Quoted 7 lines · Fabio Checconi
- To detect hw tagging in BFQ we consider a sample valid iff the number of requests that the scheduler could have dispatched (given by
cfqd->rb_queued+cfqd->rq_in_driver, i.e., the ones still into the scheduler plus the ones into the driver) is higher than theCFQ_HW_QUEUE_MINthreshold. This obviously caused no problems during testing, but the way CFQ uses now seems a little bit strange.Quoted 3 lines
BFQ's tag detection logic is broken in the same way that CFQ's used to be. Explanation is in this patch:
If you look at
bfq_update_hw_tag(), the logic introduced by the patch you mention is still there; BFQ starts with ->hw_tag = 1, and updates it every 32 valid samples. What changed WRT your patch, apart from the number of samples, is that the condition for a sample to be valid is:
bfqd->rq_in_driver+bfqd->queued>= 5while in your patch it is:
cfqd->rq_queued > 5 || cfqd->rq_in_driver > 5We preferred the first one because that sum better reflects the number of requests that could have been dispatched, and I don't think that this is wrong.
There is a problem, but it's not within the tag detection logic itself. From some quick experiments, what happens is that when a process starts, CFQ considers it seeky (*), BFQ doesn't. As a side effect BFQ does not always dispatch enough requests to correctly detect tagging.
At the first seek you cannot tell if the process is going to bee seeky or not, and we have chosen to consider it sequential because it improved fairness in some sequential workloads (the
CIC_SEEKYheuristic is used also to determine theidle_windowlength in [bc]fq_arm_slice_timer()).Anyway, we're dealing with heuristics, and they tend to favor some workload over other ones. If recovering this thoughput loss is more important than a transient unfairness due to short idling windows assigned to sequential processes when they start, I've no problems in switching the
CIC_SEEKYlogic to consider a process seeky when it starts.
Quoted 6 lines
Thank you for testing and for pointing out this issue, we missed it in our testing.
(*) to be correct, the initial classification depends on the position
of the first accessed sector.
Sorry, I forgot the patch... This seems to solve the problem with your workload here, does it work for you?
[ The magic number would not appear in a definitive fix... ]
---
block/bfq-iosched.c +5 -3
@@ -1322,10 +1322,12 @@ static void bfq_update_io_seektime(struct bfq_data *bfqd,/* * Don't allow the seek distance to get too large from the -* odd fragment, pagein, etc. +* odd fragment, pagein, etc. The first request is not +* really a seek, but we consider a cic seeky on creation +* to make the hw_tag detection logic work better. */ -if (cic->seek_samples ==0 )/* first request, not really a seek */ - sdist =0 ; +if (cic->seek_samples ==0 ) + sdist =8 *1024 +1 ;else if (cic->seek_samples <=60 )/* second&third seek */ sdist =min (sdist, (cic->seek_mean *4 ) +2 *1024 *1024 );else
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 8 lines · Fabio Checconi
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines · Fabio Checconi
- To detect hw tagging in BFQ we consider a sample valid iff the number of requests that the scheduler could have dispatched (given by
cfqd->rb_queued+cfqd->rq_in_driver, i.e., the ones still into the scheduler plus the ones into the driver) is higher than theCFQ_HW_QUEUE_MINthreshold. This obviously caused no problems during testing, but the way CFQ uses now seems a little bit strange.
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
BFQ's tag detection logic is broken in the same way that CFQ's used to be. Explanation is in this patch:
If you look at
bfq_update_hw_tag(), the logic introduced by the patch you mention is still there; BFQ starts with ->hw_tag = 1, and updates it
Yes, I missed that. So which part of CFQ's hw_tag detection is strange?
Quoted 5 lines
Quoted 5 lines
every 32 valid samples. What changed WRT your patch, apart from the number of samples, is that the condition for a sample to be valid is:
bfqd->rq_in_driver+bfqd->queued>= 5
Quoted 7 lines
Quoted 7 lines
while in your patch it is:
cfqd->rq_queued > 5 || cfqd->rq_in_driver > 5We preferred the first one because that sum better reflects the number of requests that could have been dispatched, and I don't think that this is wrong.
I think it's fine too. CFQ's condition accounts for a few rare situations, such as the device stalling or hw_tag being updated right after a bunch of requests are queued. They are probably irrelevant, but can't hurt.
Quoted 20 lines
Quoted 20 lines
There is a problem, but it's not within the tag detection logic itself. From some quick experiments, what happens is that when a process starts, CFQ considers it seeky (*), BFQ doesn't. As a side effect BFQ does not always dispatch enough requests to correctly detect tagging.
At the first seek you cannot tell if the process is going to bee seeky or not, and we have chosen to consider it sequential because it improved fairness in some sequential workloads (the
CIC_SEEKYheuristic is used also to determine theidle_windowlength in [bc]fq_arm_slice_timer()).Anyway, we're dealing with heuristics, and they tend to favor some workload over other ones. If recovering this thoughput loss is more important than a transient unfairness due to short idling windows assigned to sequential processes when they start, I've no problems in switching the
CIC_SEEKYlogic to consider a process seeky when it starts.Thank you for testing and for pointing out this issue, we missed it in our testing.
Quoted 5 lines
Quoted 2 lines
(*) to be correct, the initial classification depends on the position
of the first accessed sector.Sorry, I forgot the patch... This seems to solve the problem with your workload here, does it work for you?
Yes, it works fine now :)
However, hw_tag detection (in CFQ and BFQ) is still broken in a few ways:
* If you go from queue_depth=1 to queue_depth=large, it's possible that the detection logic fails. This could happen if setting queue_depth to a larger value at boot, which seems a reasonable situation.
* It depends too much on the hardware. If you have a seekly load on a fast disk with a unit queue depth, idling sucks for performance (I imagine this is particularly bad on SSDs). If you have any disk with a deep queue, not idling sucks for fairness.
I suppose CFQ's slice_resid is supposed to help here, but as far as I can tell, it doesn't do a thing.
-- Aaron
Quoted 8 lines · Fabio Checconi
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines · Fabio Checconi
- To detect hw tagging in BFQ we consider a sample valid iff the number of requests that the scheduler could have dispatched (given by
cfqd->rb_queued+cfqd->rq_in_driver, i.e., the ones still into the scheduler plus the ones into the driver) is higher than theCFQ_HW_QUEUE_MINthreshold. This obviously caused no problems during testing, but the way CFQ uses now seems a little bit strange.
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
BFQ's tag detection logic is broken in the same way that CFQ's used to be. Explanation is in this patch:
If you look at
bfq_update_hw_tag(), the logic introduced by the patch you mention is still there; BFQ starts with ->hw_tag = 1, and updates it
Yes, I missed that. So which part of CFQ's hw_tag detection is strange?
Quoted 5 lines
Quoted 5 lines
every 32 valid samples. What changed WRT your patch, apart from the number of samples, is that the condition for a sample to be valid is:
bfqd->rq_in_driver+bfqd->queued>= 5
Quoted 7 lines
Quoted 7 lines
while in your patch it is:
cfqd->rq_queued > 5 || cfqd->rq_in_driver > 5We preferred the first one because that sum better reflects the number of requests that could have been dispatched, and I don't think that this is wrong.
I think it's fine too. CFQ's condition accounts for a few rare situations, such as the device stalling or hw_tag being updated right after a bunch of requests are queued. They are probably irrelevant, but can't hurt.
Quoted 20 lines
Quoted 20 lines
There is a problem, but it's not within the tag detection logic itself. From some quick experiments, what happens is that when a process starts, CFQ considers it seeky (*), BFQ doesn't. As a side effect BFQ does not always dispatch enough requests to correctly detect tagging.
At the first seek you cannot tell if the process is going to bee seeky or not, and we have chosen to consider it sequential because it improved fairness in some sequential workloads (the
CIC_SEEKYheuristic is used also to determine theidle_windowlength in [bc]fq_arm_slice_timer()).Anyway, we're dealing with heuristics, and they tend to favor some workload over other ones. If recovering this thoughput loss is more important than a transient unfairness due to short idling windows assigned to sequential processes when they start, I've no problems in switching the
CIC_SEEKYlogic to consider a process seeky when it starts.Thank you for testing and for pointing out this issue, we missed it in our testing.
Quoted 5 lines
Quoted 2 lines
(*) to be correct, the initial classification depends on the position
of the first accessed sector.Sorry, I forgot the patch... This seems to solve the problem with your workload here, does it work for you?
Yes, it works fine now :)
However, hw_tag detection (in CFQ and BFQ) is still broken in a few ways:
* If you go from queue_depth=1 to queue_depth=large, it's possible that the detection logic fails. This could happen if setting queue_depth to a larger value at boot, which seems a reasonable situation.
* It depends too much on the hardware. If you have a seekly load on a fast disk with a unit queue depth, idling sucks for performance (I imagine this is particularly bad on SSDs). If you have any disk with a deep queue, not idling sucks for fairness.
I suppose CFQ's slice_resid is supposed to help here, but as far as I can tell, it doesn't do a thing.
-- Aaron
Quoted 8 lines · Fabio Checconi
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines · Fabio Checconi
- To detect hw tagging in BFQ we consider a sample valid iff the number of requests that the scheduler could have dispatched (given by
cfqd->rb_queued+cfqd->rq_in_driver, i.e., the ones still into the scheduler plus the ones into the driver) is higher than theCFQ_HW_QUEUE_MINthreshold. This obviously caused no problems during testing, but the way CFQ uses now seems a little bit strange.
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
BFQ's tag detection logic is broken in the same way that CFQ's used to be. Explanation is in this patch:
If you look at
bfq_update_hw_tag(), the logic introduced by the patch you mention is still there; BFQ starts with ->hw_tag = 1, and updates it
Yes, I missed that. So which part of CFQ's hw_tag detection is strange?
Quoted 5 lines
Quoted 5 lines
every 32 valid samples. What changed WRT your patch, apart from the number of samples, is that the condition for a sample to be valid is:
bfqd->rq_in_driver+bfqd->queued>= 5
Quoted 7 lines
Quoted 7 lines
while in your patch it is:
cfqd->rq_queued > 5 || cfqd->rq_in_driver > 5We preferred the first one because that sum better reflects the number of requests that could have been dispatched, and I don't think that this is wrong.
I think it's fine too. CFQ's condition accounts for a few rare situations, such as the device stalling or hw_tag being updated right after a bunch of requests are queued. They are probably irrelevant, but can't hurt.
Quoted 20 lines
Quoted 20 lines
There is a problem, but it's not within the tag detection logic itself. From some quick experiments, what happens is that when a process starts, CFQ considers it seeky (*), BFQ doesn't. As a side effect BFQ does not always dispatch enough requests to correctly detect tagging.
At the first seek you cannot tell if the process is going to bee seeky or not, and we have chosen to consider it sequential because it improved fairness in some sequential workloads (the
CIC_SEEKYheuristic is used also to determine theidle_windowlength in [bc]fq_arm_slice_timer()).Anyway, we're dealing with heuristics, and they tend to favor some workload over other ones. If recovering this thoughput loss is more important than a transient unfairness due to short idling windows assigned to sequential processes when they start, I've no problems in switching the
CIC_SEEKYlogic to consider a process seeky when it starts.Thank you for testing and for pointing out this issue, we missed it in our testing.
Quoted 5 lines
Quoted 2 lines
(*) to be correct, the initial classification depends on the position
of the first accessed sector.Sorry, I forgot the patch... This seems to solve the problem with your workload here, does it work for you?
Yes, it works fine now :)
However, hw_tag detection (in CFQ and BFQ) is still broken in a few ways:
* If you go from queue_depth=1 to queue_depth=large, it's possible that the detection logic fails. This could happen if setting queue_depth to a larger value at boot, which seems a reasonable situation.
* It depends too much on the hardware. If you have a seekly load on a fast disk with a unit queue depth, idling sucks for performance (I imagine this is particularly bad on SSDs). If you have any disk with a deep queue, not idling sucks for fairness.
I suppose CFQ's slice_resid is supposed to help here, but as far as I can tell, it doesn't do a thing.
-- Aaron
Quoted 12 lines
From: Aaron Carroll <[email protected]>
Date: Thu, Nov 20, 2008 03:45:02PM +1100Quoted 8 lines · Fabio Checconi
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines · Fabio Checconi
- To detect hw tagging in BFQ we consider a sample valid iff the number of requests that the scheduler could have dispatched (given by
cfqd->rb_queued+cfqd->rq_in_driver, i.e., the ones still into the scheduler plus the ones into the driver) is higher than theCFQ_HW_QUEUE_MINthreshold. This obviously caused no problems during testing, but the way CFQ uses now seems a little bit strange.
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
BFQ's tag detection logic is broken in the same way that CFQ's used to be. Explanation is in this patch:
If you look at
bfq_update_hw_tag(), the logic introduced by the patch you mention is still there; BFQ starts with ->hw_tag = 1, and updates itYes, I missed that. So which part of CFQ's
hw_tagdetection is strange?
I just think that is rather counterintuitive to consider invalid a sample when you have, say, rq_in_driver = 1,2,3 or 4 and other 4 queued requests. Considering the actual number of requests that could have been dispatched seemed more straightforward than considering the two values separately.
Anyway I think the validity of the samples is a minor issue, while the throughput loss you experienced was a more serious one.
Quoted 37 lines
Quoted 5 lines
Quoted 5 lines
every 32 valid samples. What changed WRT your patch, apart from the number of samples, is that the condition for a sample to be valid is:
bfqd->rq_in_driver+bfqd->queued>= 5Quoted 7 lines
Quoted 7 lines
while in your patch it is:
cfqd->rq_queued > 5 || cfqd->rq_in_driver > 5We preferred the first one because that sum better reflects the number of requests that could have been dispatched, and I don't think that this is wrong.
I think it's fine too. CFQ's condition accounts for a few rare situations, such as the device stalling or
hw_tagbeing updated right after a bunch of requests are queued. They are probably irrelevant, but can't hurt.Quoted 20 lines
Quoted 20 lines
There is a problem, but it's not within the tag detection logic itself. From some quick experiments, what happens is that when a process starts, CFQ considers it seeky (*), BFQ doesn't. As a side effect BFQ does not always dispatch enough requests to correctly detect tagging.
At the first seek you cannot tell if the process is going to bee seeky or not, and we have chosen to consider it sequential because it improved fairness in some sequential workloads (the
CIC_SEEKYheuristic is used also to determine theidle_windowlength in [bc]fq_arm_slice_timer()).Anyway, we're dealing with heuristics, and they tend to favor some workload over other ones. If recovering this thoughput loss is more important than a transient unfairness due to short idling windows assigned to sequential processes when they start, I've no problems in switching the
CIC_SEEKYlogic to consider a process seeky when it starts.Thank you for testing and for pointing out this issue, we missed it in our testing.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
(*) to be correct, the initial classification depends on the position
of the first accessed sector.Sorry, I forgot the patch... This seems to solve the problem with your workload here, does it work for you?
Yes, it works fine now :)
Thank you very much for trying it.
Quoted 4 lines
However,
hw_tagdetection (in CFQ and BFQ) is still broken in a few ways:
* If you go from queue_depth=1 to queue_depth=large, it's possible that the detection logic fails. This could happen if settingqueue_depthto a larger value at boot, which seems a reasonable situation.
I think that the transition of hw_tag from 1 to 0 can be quite easy, and may depend only on the workload, while getting back to 1 is more difficult, because when hw_tag is 0 there may be too few dispatches to detect queueing...
Quoted 4 lines
* It depends too much on the hardware. If you have a seekly load on a fast disk with a unit queue depth, idling sucks for performance (I imagine this is particularly bad on SSDs). If you have any disk with a deep queue, not idling sucks for fairness.
Agreed. This fairness vs. throughput conflict is very workload dependent too.
Quoted 3 lines
I suppose CFQ's
slice_residis supposed to help here, but as far as I can tell, it doesn't do a thing.
A message that is not in the archive (sent off-list or not yet received): 4924EB4E.7050600-M3ycANVxPotyL3EAZA59ERCuuivNXqWP@public.gmane.org
Quoted 12 lines
From: Aaron Carroll <[email protected]>
Date: Thu, Nov 20, 2008 03:45:02PM +1100Quoted 8 lines · Fabio Checconi
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines · Fabio Checconi
- To detect hw tagging in BFQ we consider a sample valid iff the number of requests that the scheduler could have dispatched (given by
cfqd->rb_queued+cfqd->rq_in_driver, i.e., the ones still into the scheduler plus the ones into the driver) is higher than theCFQ_HW_QUEUE_MINthreshold. This obviously caused no problems during testing, but the way CFQ uses now seems a little bit strange.
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
BFQ's tag detection logic is broken in the same way that CFQ's used to be. Explanation is in this patch:
If you look at
bfq_update_hw_tag(), the logic introduced by the patch you mention is still there; BFQ starts with ->hw_tag = 1, and updates itYes, I missed that. So which part of CFQ's
hw_tagdetection is strange?
I just think that is rather counterintuitive to consider invalid a sample when you have, say, rq_in_driver = 1,2,3 or 4 and other 4 queued requests. Considering the actual number of requests that could have been dispatched seemed more straightforward than considering the two values separately.
Anyway I think the validity of the samples is a minor issue, while the throughput loss you experienced was a more serious one.
Quoted 37 lines
Quoted 5 lines
Quoted 5 lines
every 32 valid samples. What changed WRT your patch, apart from the number of samples, is that the condition for a sample to be valid is:
bfqd->rq_in_driver+bfqd->queued>= 5Quoted 7 lines
Quoted 7 lines
while in your patch it is:
cfqd->rq_queued > 5 || cfqd->rq_in_driver > 5We preferred the first one because that sum better reflects the number of requests that could have been dispatched, and I don't think that this is wrong.
I think it's fine too. CFQ's condition accounts for a few rare situations, such as the device stalling or
hw_tagbeing updated right after a bunch of requests are queued. They are probably irrelevant, but can't hurt.Quoted 20 lines
Quoted 20 lines
There is a problem, but it's not within the tag detection logic itself. From some quick experiments, what happens is that when a process starts, CFQ considers it seeky (*), BFQ doesn't. As a side effect BFQ does not always dispatch enough requests to correctly detect tagging.
At the first seek you cannot tell if the process is going to bee seeky or not, and we have chosen to consider it sequential because it improved fairness in some sequential workloads (the
CIC_SEEKYheuristic is used also to determine theidle_windowlength in [bc]fq_arm_slice_timer()).Anyway, we're dealing with heuristics, and they tend to favor some workload over other ones. If recovering this thoughput loss is more important than a transient unfairness due to short idling windows assigned to sequential processes when they start, I've no problems in switching the
CIC_SEEKYlogic to consider a process seeky when it starts.Thank you for testing and for pointing out this issue, we missed it in our testing.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
(*) to be correct, the initial classification depends on the position
of the first accessed sector.Sorry, I forgot the patch... This seems to solve the problem with your workload here, does it work for you?
Yes, it works fine now :)
Thank you very much for trying it.
Quoted 4 lines
However,
hw_tagdetection (in CFQ and BFQ) is still broken in a few ways:
* If you go from queue_depth=1 to queue_depth=large, it's possible that the detection logic fails. This could happen if settingqueue_depthto a larger value at boot, which seems a reasonable situation.
I think that the transition of hw_tag from 1 to 0 can be quite easy, and may depend only on the workload, while getting back to 1 is more difficult, because when hw_tag is 0 there may be too few dispatches to detect queueing...
Quoted 4 lines
* It depends too much on the hardware. If you have a seekly load on a fast disk with a unit queue depth, idling sucks for performance (I imagine this is particularly bad on SSDs). If you have any disk with a deep queue, not idling sucks for fairness.
Agreed. This fairness vs. throughput conflict is very workload dependent too.
Quoted 3 lines
I suppose CFQ's
slice_residis supposed to help here, but as far as I can tell, it doesn't do a thing.
Quoted 12 lines
From: Aaron Carroll <[email protected]>
Date: Thu, Nov 20, 2008 03:45:02PM +1100Quoted 8 lines · Fabio Checconi
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines · Fabio Checconi
- To detect hw tagging in BFQ we consider a sample valid iff the number of requests that the scheduler could have dispatched (given by
cfqd->rb_queued+cfqd->rq_in_driver, i.e., the ones still into the scheduler plus the ones into the driver) is higher than theCFQ_HW_QUEUE_MINthreshold. This obviously caused no problems during testing, but the way CFQ uses now seems a little bit strange.
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
BFQ's tag detection logic is broken in the same way that CFQ's used to be. Explanation is in this patch:
If you look at
bfq_update_hw_tag(), the logic introduced by the patch you mention is still there; BFQ starts with ->hw_tag = 1, and updates itYes, I missed that. So which part of CFQ's
hw_tagdetection is strange?
I just think that is rather counterintuitive to consider invalid a sample when you have, say, rq_in_driver = 1,2,3 or 4 and other 4 queued requests. Considering the actual number of requests that could have been dispatched seemed more straightforward than considering the two values separately.
Anyway I think the validity of the samples is a minor issue, while the throughput loss you experienced was a more serious one.
Quoted 37 lines
Quoted 5 lines
Quoted 5 lines
every 32 valid samples. What changed WRT your patch, apart from the number of samples, is that the condition for a sample to be valid is:
bfqd->rq_in_driver+bfqd->queued>= 5Quoted 7 lines
Quoted 7 lines
while in your patch it is:
cfqd->rq_queued > 5 || cfqd->rq_in_driver > 5We preferred the first one because that sum better reflects the number of requests that could have been dispatched, and I don't think that this is wrong.
I think it's fine too. CFQ's condition accounts for a few rare situations, such as the device stalling or
hw_tagbeing updated right after a bunch of requests are queued. They are probably irrelevant, but can't hurt.Quoted 20 lines
Quoted 20 lines
There is a problem, but it's not within the tag detection logic itself. From some quick experiments, what happens is that when a process starts, CFQ considers it seeky (*), BFQ doesn't. As a side effect BFQ does not always dispatch enough requests to correctly detect tagging.
At the first seek you cannot tell if the process is going to bee seeky or not, and we have chosen to consider it sequential because it improved fairness in some sequential workloads (the
CIC_SEEKYheuristic is used also to determine theidle_windowlength in [bc]fq_arm_slice_timer()).Anyway, we're dealing with heuristics, and they tend to favor some workload over other ones. If recovering this thoughput loss is more important than a transient unfairness due to short idling windows assigned to sequential processes when they start, I've no problems in switching the
CIC_SEEKYlogic to consider a process seeky when it starts.Thank you for testing and for pointing out this issue, we missed it in our testing.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
(*) to be correct, the initial classification depends on the position
of the first accessed sector.Sorry, I forgot the patch... This seems to solve the problem with your workload here, does it work for you?
Yes, it works fine now :)
Thank you very much for trying it.
Quoted 4 lines
However,
hw_tagdetection (in CFQ and BFQ) is still broken in a few ways:
* If you go from queue_depth=1 to queue_depth=large, it's possible that the detection logic fails. This could happen if settingqueue_depthto a larger value at boot, which seems a reasonable situation.
I think that the transition of hw_tag from 1 to 0 can be quite easy, and may depend only on the workload, while getting back to 1 is more difficult, because when hw_tag is 0 there may be too few dispatches to detect queueing...
Quoted 4 lines
* It depends too much on the hardware. If you have a seekly load on a fast disk with a unit queue depth, idling sucks for performance (I imagine this is particularly bad on SSDs). If you have any disk with a deep queue, not idling sucks for fairness.
Agreed. This fairness vs. throughput conflict is very workload dependent too.
Quoted 3 lines
I suppose CFQ's
slice_residis supposed to help here, but as far as I can tell, it doesn't do a thing.
Quoted 50 lines
From: Fabio Checconi <[email protected]>
Date: Wed, Nov 19, 2008 11:17:01AM +0100Quoted 12 lines
From: Aaron Carroll <[email protected]>
Date: Wed, Nov 19, 2008 12:52:42PM +1100Quoted 7 lines · Fabio Checconi
- To detect hw tagging in BFQ we consider a sample valid iff the number of requests that the scheduler could have dispatched (given by
cfqd->rb_queued+cfqd->rq_in_driver, i.e., the ones still into the scheduler plus the ones into the driver) is higher than theCFQ_HW_QUEUE_MINthreshold. This obviously caused no problems during testing, but the way CFQ uses now seems a little bit strange.Quoted 3 lines
BFQ's tag detection logic is broken in the same way that CFQ's used to be. Explanation is in this patch:
If you look at
bfq_update_hw_tag(), the logic introduced by the patch you mention is still there; BFQ starts with ->hw_tag = 1, and updates it every 32 valid samples. What changed WRT your patch, apart from the number of samples, is that the condition for a sample to be valid is:
bfqd->rq_in_driver+bfqd->queued>= 5while in your patch it is:
cfqd->rq_queued > 5 || cfqd->rq_in_driver > 5We preferred the first one because that sum better reflects the number of requests that could have been dispatched, and I don't think that this is wrong.
There is a problem, but it's not within the tag detection logic itself. From some quick experiments, what happens is that when a process starts, CFQ considers it seeky (*), BFQ doesn't. As a side effect BFQ does not always dispatch enough requests to correctly detect tagging.
At the first seek you cannot tell if the process is going to bee seeky or not, and we have chosen to consider it sequential because it improved fairness in some sequential workloads (the
CIC_SEEKYheuristic is used also to determine theidle_windowlength in [bc]fq_arm_slice_timer()).Anyway, we're dealing with heuristics, and they tend to favor some workload over other ones. If recovering this thoughput loss is more important than a transient unfairness due to short idling windows assigned to sequential processes when they start, I've no problems in switching the
CIC_SEEKYlogic to consider a process seeky when it starts.
Quoted 6 lines
Thank you for testing and for pointing out this issue, we missed it in our testing.
(*) to be correct, the initial classification depends on the position
of the first accessed sector.
Sorry, I forgot the patch... This seems to solve the problem with your workload here, does it work for you?
[ The magic number would not appear in a definitive fix... ]
---
block/bfq-iosched.c +5 -3
@@ -1322,10 +1322,12 @@ static void bfq_update_io_seektime(struct bfq_data *bfqd,/* * Don't allow the seek distance to get too large from the -* odd fragment, pagein, etc. +* odd fragment, pagein, etc. The first request is not +* really a seek, but we consider a cic seeky on creation +* to make the hw_tag detection logic work better. */ -if (cic->seek_samples ==0 )/* first request, not really a seek */ - sdist =0 ; +if (cic->seek_samples ==0 ) + sdist =8 *1024 +1 ;else if (cic->seek_samples <=60 )/* second&third seek */ sdist =min (sdist, (cic->seek_mean *4 ) +2 *1024 *1024 );else
A message that is not in the archive (sent off-list or not yet received): 4923716A.5090104-M3ycANVxPotyL3EAZA59ERCuuivNXqWP@public.gmane.org
Quoted 12 lines
From: Aaron Carroll <[email protected]>
Date: Wed, Nov 19, 2008 12:52:42PM +1100Quoted 7 lines · Fabio Checconi
- To detect hw tagging in BFQ we consider a sample valid iff the number of requests that the scheduler could have dispatched (given by
cfqd->rb_queued+cfqd->rq_in_driver, i.e., the ones still into the scheduler plus the ones into the driver) is higher than theCFQ_HW_QUEUE_MINthreshold. This obviously caused no problems during testing, but the way CFQ uses now seems a little bit strange.
Quoted 3 lines
BFQ's tag detection logic is broken in the same way that CFQ's used to be. Explanation is in this patch:
If you look at bfq_update_hw_tag(), the logic introduced by the patch you mention is still there; BFQ starts with ->hw_tag = 1, and updates it every 32 valid samples. What changed WRT your patch, apart from the number of samples, is that the condition for a sample to be valid is:
bfqd->rq_in_driver + bfqd->queued >= 5
while in your patch it is:
cfqd->rq_queued > 5 || cfqd->rq_in_driver > 5
We preferred the first one because that sum better reflects the number of requests that could have been dispatched, and I don't think that this is wrong.
There is a problem, but it's not within the tag detection logic itself. From some quick experiments, what happens is that when a process starts, CFQ considers it seeky (*), BFQ doesn't. As a side effect BFQ does not always dispatch enough requests to correctly detect tagging.
At the first seek you cannot tell if the process is going to bee seeky or not, and we have chosen to consider it sequential because it improved fairness in some sequential workloads (the CIC_SEEKY heuristic is used also to determine the idle_window length in [bc]fq_arm_slice_timer()).
Anyway, we're dealing with heuristics, and they tend to favor some workload over other ones. If recovering this thoughput loss is more important than a transient unfairness due to short idling windows assigned to sequential processes when they start, I've no problems in switching the CIC_SEEKY logic to consider a process seeky when it starts.
Thank you for testing and for pointing out this issue, we missed it in our testing.
(*) to be correct, the initial classification depends on the position
of the first accessed sector.
Quoted 12 lines
From: Aaron Carroll <[email protected]>
Date: Wed, Nov 19, 2008 12:52:42PM +1100Quoted 7 lines · Fabio Checconi
- To detect hw tagging in BFQ we consider a sample valid iff the number of requests that the scheduler could have dispatched (given by
cfqd->rb_queued+cfqd->rq_in_driver, i.e., the ones still into the scheduler plus the ones into the driver) is higher than theCFQ_HW_QUEUE_MINthreshold. This obviously caused no problems during testing, but the way CFQ uses now seems a little bit strange.
Quoted 3 lines
BFQ's tag detection logic is broken in the same way that CFQ's used to be. Explanation is in this patch:
If you look at bfq_update_hw_tag(), the logic introduced by the patch you mention is still there; BFQ starts with ->hw_tag = 1, and updates it every 32 valid samples. What changed WRT your patch, apart from the number of samples, is that the condition for a sample to be valid is:
bfqd->rq_in_driver + bfqd->queued >= 5
while in your patch it is:
cfqd->rq_queued > 5 || cfqd->rq_in_driver > 5
We preferred the first one because that sum better reflects the number of requests that could have been dispatched, and I don't think that this is wrong.
There is a problem, but it's not within the tag detection logic itself. From some quick experiments, what happens is that when a process starts, CFQ considers it seeky (*), BFQ doesn't. As a side effect BFQ does not always dispatch enough requests to correctly detect tagging.
At the first seek you cannot tell if the process is going to bee seeky or not, and we have chosen to consider it sequential because it improved fairness in some sequential workloads (the CIC_SEEKY heuristic is used also to determine the idle_window length in [bc]fq_arm_slice_timer()).
Anyway, we're dealing with heuristics, and they tend to favor some workload over other ones. If recovering this thoughput loss is more important than a transient unfairness due to short idling windows assigned to sequential processes when they start, I've no problems in switching the CIC_SEEKY logic to consider a process seeky when it starts.
Thank you for testing and for pointing out this issue, we missed it in our testing.
(*) to be correct, the initial classification depends on the position
of the first accessed sector.
Quoted 37 lines · Fabio Checconi
Quoted 8 lines
From: Jens Axboe <[email protected]>
Date: Tue, Nov 18, 2008 08:12:08PM +0100Quoted 4 lines · Fabio Checconi
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic....
Quoted 11 lines
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
Quoted 8 lines
My main goal here is basically avoiding addition of Yet Another IO scheduler, especially one that is so closely tied to CFQ already.
I'll start things off by splitting cfq into a few files similar to what bfq has done, as I think it makes a lot of sense. Fabio, if you could create patches for the small behavioural changes you made, we can discuss and hopefully merge those next.
Ok, I can do that, I need just a little bit of time to organize the work.
About these small (some of them are really small) changes, a mixed list of things that they will touch and/or things that I'd like to have clear before starting to write the patches (maybe we can start another thread for them):
Quoted 9 lines
- In
cfq_exit_single_io_context()and inchanged_ioprio(),cic->keyis dereferenced without holding any lock. As I reported in [1] this seems to be a problem when anexit()races with acfq_exit_queue()and in a few other cases. In BFQ we used a somehow involved mechanism to avoid that, abusing rcu (of course we'll have to wait the patch to talk about it :) ), but given my lack of understanding of some parts of the block layer, I'd be interested in knowing if the race is possible and/or if there is something more involved going on that can cause the same effects.
OK, I'm assuming this is where Nikanth got his idea for the patch from? It does seem racy in spots, we can definitely proceed on getting that tightened up some more.
Quoted 3 lines
-
set_task_ioprio()infs/ioprio.cdoesn't seem to have a write memory barrier to pair with the dependent read one incfq_get_io_context().
Agree, that needs fixing.
Quoted 6 lines
-
CFQ_MIN_TTis 2ms, this can result, depending on the value of HZ in timeouts of one jiffy, that may expire too early, so we are just wasting time and do not actually wait for the task to present its new request. Dealing with seeky traffic we've seen a lot of early timeouts due to one jiffy timers expiring too early, is it worth fixing or can we live with that?
We probably just need to enfore a '2 jiffies minimum' rule for that.
Quoted 7 lines
- To detect hw tagging in BFQ we consider a sample valid iff the number of requests that the scheduler could have dispatched (given by
cfqd->rb_queued+cfqd->rq_in_driver, i.e., the ones still into the scheduler plus the ones into the driver) is higher than theCFQ_HW_QUEUE_MINthreshold. This obviously caused no problems during testing, but the way CFQ uses now seems a little bit strange.
Not sure this matters a whole lot, but your approach makes sense. Have you seen the later change to the CFQ logic from Aaron?
Quoted 6 lines
- Initially,
cic->last_request_posis zero, so the sdist charged to a task for its first seek depends on the position on the disk that is accessed first, independently from its seekiness. Even if there is a cap on that value, we choose to not charge the first seek to processes; that resulted in less wrong predictions for purely sequential loads.
Agreed, that's is definitely off.
Quoted 5 lines
- From my understanding, with shared I/O contexts, two different tasks may concurrently lookup for a cfqd into the same ioc. This may result in
cfq_drop_dead_cic()being called two times for the same cic. Am I missing something that prevents that from happening?
That also looks problematic. I guess we need to recheck that under the lock when in cfq_drop_dead_cic().
Quoted 3 lines
Regarding the code splitup, do you think you'll go for the CFS(BFQ) way, using a single compilation unit and including the .c files, or a layout with different compilation units (like the
ll_rw_blk.csplitup)?
Different compilation units would be my preferred choice.
Signature · 1 line
Jens Axboe
Quoted 37 lines · Fabio Checconi
Quoted 8 lines
From: Jens Axboe <[email protected]>
Date: Tue, Nov 18, 2008 08:12:08PM +0100Quoted 4 lines · Fabio Checconi
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic....
Quoted 11 lines
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
Quoted 8 lines
My main goal here is basically avoiding addition of Yet Another IO scheduler, especially one that is so closely tied to CFQ already.
I'll start things off by splitting cfq into a few files similar to what bfq has done, as I think it makes a lot of sense. Fabio, if you could create patches for the small behavioural changes you made, we can discuss and hopefully merge those next.
Ok, I can do that, I need just a little bit of time to organize the work.
About these small (some of them are really small) changes, a mixed list of things that they will touch and/or things that I'd like to have clear before starting to write the patches (maybe we can start another thread for them):
Quoted 9 lines
- In
cfq_exit_single_io_context()and inchanged_ioprio(),cic->keyis dereferenced without holding any lock. As I reported in [1] this seems to be a problem when anexit()races with acfq_exit_queue()and in a few other cases. In BFQ we used a somehow involved mechanism to avoid that, abusing rcu (of course we'll have to wait the patch to talk about it :) ), but given my lack of understanding of some parts of the block layer, I'd be interested in knowing if the race is possible and/or if there is something more involved going on that can cause the same effects.
OK, I'm assuming this is where Nikanth got his idea for the patch from? It does seem racy in spots, we can definitely proceed on getting that tightened up some more.
Quoted 3 lines
-
set_task_ioprio()infs/ioprio.cdoesn't seem to have a write memory barrier to pair with the dependent read one incfq_get_io_context().
Agree, that needs fixing.
Quoted 6 lines
-
CFQ_MIN_TTis 2ms, this can result, depending on the value of HZ in timeouts of one jiffy, that may expire too early, so we are just wasting time and do not actually wait for the task to present its new request. Dealing with seeky traffic we've seen a lot of early timeouts due to one jiffy timers expiring too early, is it worth fixing or can we live with that?
We probably just need to enfore a '2 jiffies minimum' rule for that.
Quoted 7 lines
- To detect hw tagging in BFQ we consider a sample valid iff the number of requests that the scheduler could have dispatched (given by
cfqd->rb_queued+cfqd->rq_in_driver, i.e., the ones still into the scheduler plus the ones into the driver) is higher than theCFQ_HW_QUEUE_MINthreshold. This obviously caused no problems during testing, but the way CFQ uses now seems a little bit strange.
Not sure this matters a whole lot, but your approach makes sense. Have you seen the later change to the CFQ logic from Aaron?
Quoted 6 lines
- Initially,
cic->last_request_posis zero, so the sdist charged to a task for its first seek depends on the position on the disk that is accessed first, independently from its seekiness. Even if there is a cap on that value, we choose to not charge the first seek to processes; that resulted in less wrong predictions for purely sequential loads.
Agreed, that's is definitely off.
Quoted 5 lines
- From my understanding, with shared I/O contexts, two different tasks may concurrently lookup for a cfqd into the same ioc. This may result in
cfq_drop_dead_cic()being called two times for the same cic. Am I missing something that prevents that from happening?
That also looks problematic. I guess we need to recheck that under the lock when in cfq_drop_dead_cic().
Quoted 3 lines
Regarding the code splitup, do you think you'll go for the CFS(BFQ) way, using a single compilation unit and including the .c files, or a layout with different compilation units (like the
ll_rw_blk.csplitup)?
Different compilation units would be my preferred choice.
Signature · 1 line
Jens Axboe
Quoted 4 lines
From: Jens Axboe <[email protected]>
Date: Wed, Nov 19, 2008 03:30:07PM +0100On Tue, Nov 18 2008, Fabio Checconi wrote:
...
Quoted 11 lines
Quoted 9 lines
- In
cfq_exit_single_io_context()and inchanged_ioprio(),cic->keyis dereferenced without holding any lock. As I reported in [1] this seems to be a problem when anexit()races with acfq_exit_queue()and in a few other cases. In BFQ we used a somehow involved mechanism to avoid that, abusing rcu (of course we'll have to wait the patch to talk about it :) ), but given my lack of understanding of some parts of the block layer, I'd be interested in knowing if the race is possible and/or if there is something more involved going on that can cause the same effects.OK, I'm assuming this is where Nikanth got his idea for the patch from?
I think so.
Quoted 26 lines
It does seem racy in spots, we can definitely proceed on getting that tightened up some more.
Quoted 3 lines
-
set_task_ioprio()infs/ioprio.cdoesn't seem to have a write memory barrier to pair with the dependent read one incfq_get_io_context().Agree, that needs fixing.
Quoted 6 lines
-
CFQ_MIN_TTis 2ms, this can result, depending on the value of HZ in timeouts of one jiffy, that may expire too early, so we are just wasting time and do not actually wait for the task to present its new request. Dealing with seeky traffic we've seen a lot of early timeouts due to one jiffy timers expiring too early, is it worth fixing or can we live with that?We probably just need to enfore a '2 jiffies minimum' rule for that.
Quoted 7 lines
- To detect hw tagging in BFQ we consider a sample valid iff the number of requests that the scheduler could have dispatched (given by
cfqd->rb_queued+cfqd->rq_in_driver, i.e., the ones still into the scheduler plus the ones into the driver) is higher than theCFQ_HW_QUEUE_MINthreshold. This obviously caused no problems during testing, but the way CFQ uses now seems a little bit strange.
Quoted 3 lines
Not sure this matters a whole lot, but your approach makes sense. Have you seen the later change to the CFQ logic from Aaron?
Yes, we started from his code. As Aaron reported, on BFQ our change to the CIC_SEEKY logic has a bad interaction with the hw tag detection on some workloads, but that problem should be easy to solve (test patch posted in http://lkml.org/lkml/2008/11/19/100).
Quoted 15 lines
Quoted 6 lines
- Initially,
cic->last_request_posis zero, so the sdist charged to a task for its first seek depends on the position on the disk that is accessed first, independently from its seekiness. Even if there is a cap on that value, we choose to not charge the first seek to processes; that resulted in less wrong predictions for purely sequential loads.Agreed, that's is definitely off.
Quoted 5 lines
- From my understanding, with shared I/O contexts, two different tasks may concurrently lookup for a cfqd into the same ioc. This may result in
cfq_drop_dead_cic()being called two times for the same cic. Am I missing something that prevents that from happening?
Quoted 9 lines
That also looks problematic. I guess we need to recheck that under the lock when in
cfq_drop_dead_cic().Quoted 3 lines
Regarding the code splitup, do you think you'll go for the CFS(BFQ) way, using a single compilation unit and including the .c files, or a layout with different compilation units (like the
ll_rw_blk.csplitup)?Different compilation units would be my preferred choice.
Ok, thank you, I'll try to put together and test some patches, and to post them for discussion in the next few days.
A message that is not in the archive (sent off-list or not yet received): 20081119143006.GI26308-tSWWG44O7X1aa/[email protected]
Quoted 4 lines
From: Jens Axboe <[email protected]>
Date: Wed, Nov 19, 2008 03:30:07PM +0100On Tue, Nov 18 2008, Fabio Checconi wrote:
...
Quoted 11 lines
Quoted 9 lines
- In
cfq_exit_single_io_context()and inchanged_ioprio(),cic->keyis dereferenced without holding any lock. As I reported in [1] this seems to be a problem when anexit()races with acfq_exit_queue()and in a few other cases. In BFQ we used a somehow involved mechanism to avoid that, abusing rcu (of course we'll have to wait the patch to talk about it :) ), but given my lack of understanding of some parts of the block layer, I'd be interested in knowing if the race is possible and/or if there is something more involved going on that can cause the same effects.OK, I'm assuming this is where Nikanth got his idea for the patch from?
I think so.
Quoted 26 lines
It does seem racy in spots, we can definitely proceed on getting that tightened up some more.
Quoted 3 lines
-
set_task_ioprio()infs/ioprio.cdoesn't seem to have a write memory barrier to pair with the dependent read one incfq_get_io_context().Agree, that needs fixing.
Quoted 6 lines
-
CFQ_MIN_TTis 2ms, this can result, depending on the value of HZ in timeouts of one jiffy, that may expire too early, so we are just wasting time and do not actually wait for the task to present its new request. Dealing with seeky traffic we've seen a lot of early timeouts due to one jiffy timers expiring too early, is it worth fixing or can we live with that?We probably just need to enfore a '2 jiffies minimum' rule for that.
Quoted 7 lines
- To detect hw tagging in BFQ we consider a sample valid iff the number of requests that the scheduler could have dispatched (given by
cfqd->rb_queued+cfqd->rq_in_driver, i.e., the ones still into the scheduler plus the ones into the driver) is higher than theCFQ_HW_QUEUE_MINthreshold. This obviously caused no problems during testing, but the way CFQ uses now seems a little bit strange.
Quoted 3 lines
Not sure this matters a whole lot, but your approach makes sense. Have you seen the later change to the CFQ logic from Aaron?
Yes, we started from his code. As Aaron reported, on BFQ our change to the CIC_SEEKY logic has a bad interaction with the hw tag detection on some workloads, but that problem should be easy to solve (test patch posted in http://lkml.org/lkml/2008/11/19/100).
Quoted 15 lines
Quoted 6 lines
- Initially,
cic->last_request_posis zero, so the sdist charged to a task for its first seek depends on the position on the disk that is accessed first, independently from its seekiness. Even if there is a cap on that value, we choose to not charge the first seek to processes; that resulted in less wrong predictions for purely sequential loads.Agreed, that's is definitely off.
Quoted 5 lines
- From my understanding, with shared I/O contexts, two different tasks may concurrently lookup for a cfqd into the same ioc. This may result in
cfq_drop_dead_cic()being called two times for the same cic. Am I missing something that prevents that from happening?
Quoted 9 lines
That also looks problematic. I guess we need to recheck that under the lock when in
cfq_drop_dead_cic().Quoted 3 lines
Regarding the code splitup, do you think you'll go for the CFS(BFQ) way, using a single compilation unit and including the .c files, or a layout with different compilation units (like the
ll_rw_blk.csplitup)?Different compilation units would be my preferred choice.
Ok, thank you, I'll try to put together and test some patches, and to post them for discussion in the next few days.
Quoted 4 lines
From: Jens Axboe <[email protected]>
Date: Wed, Nov 19, 2008 03:30:07PM +0100On Tue, Nov 18 2008, Fabio Checconi wrote:
...
Quoted 11 lines
Quoted 9 lines
- In
cfq_exit_single_io_context()and inchanged_ioprio(),cic->keyis dereferenced without holding any lock. As I reported in [1] this seems to be a problem when anexit()races with acfq_exit_queue()and in a few other cases. In BFQ we used a somehow involved mechanism to avoid that, abusing rcu (of course we'll have to wait the patch to talk about it :) ), but given my lack of understanding of some parts of the block layer, I'd be interested in knowing if the race is possible and/or if there is something more involved going on that can cause the same effects.OK, I'm assuming this is where Nikanth got his idea for the patch from?
I think so.
Quoted 26 lines
It does seem racy in spots, we can definitely proceed on getting that tightened up some more.
Quoted 3 lines
-
set_task_ioprio()infs/ioprio.cdoesn't seem to have a write memory barrier to pair with the dependent read one incfq_get_io_context().Agree, that needs fixing.
Quoted 6 lines
-
CFQ_MIN_TTis 2ms, this can result, depending on the value of HZ in timeouts of one jiffy, that may expire too early, so we are just wasting time and do not actually wait for the task to present its new request. Dealing with seeky traffic we've seen a lot of early timeouts due to one jiffy timers expiring too early, is it worth fixing or can we live with that?We probably just need to enfore a '2 jiffies minimum' rule for that.
Quoted 7 lines
- To detect hw tagging in BFQ we consider a sample valid iff the number of requests that the scheduler could have dispatched (given by
cfqd->rb_queued+cfqd->rq_in_driver, i.e., the ones still into the scheduler plus the ones into the driver) is higher than theCFQ_HW_QUEUE_MINthreshold. This obviously caused no problems during testing, but the way CFQ uses now seems a little bit strange.
Quoted 3 lines
Not sure this matters a whole lot, but your approach makes sense. Have you seen the later change to the CFQ logic from Aaron?
Yes, we started from his code. As Aaron reported, on BFQ our change to the CIC_SEEKY logic has a bad interaction with the hw tag detection on some workloads, but that problem should be easy to solve (test patch posted in http://lkml.org/lkml/2008/11/19/100).
Quoted 15 lines
Quoted 6 lines
- Initially,
cic->last_request_posis zero, so the sdist charged to a task for its first seek depends on the position on the disk that is accessed first, independently from its seekiness. Even if there is a cap on that value, we choose to not charge the first seek to processes; that resulted in less wrong predictions for purely sequential loads.Agreed, that's is definitely off.
Quoted 5 lines
- From my understanding, with shared I/O contexts, two different tasks may concurrently lookup for a cfqd into the same ioc. This may result in
cfq_drop_dead_cic()being called two times for the same cic. Am I missing something that prevents that from happening?
Quoted 9 lines
That also looks problematic. I guess we need to recheck that under the lock when in
cfq_drop_dead_cic().Quoted 3 lines
Regarding the code splitup, do you think you'll go for the CFS(BFQ) way, using a single compilation unit and including the .c files, or a layout with different compilation units (like the
ll_rw_blk.csplitup)?Different compilation units would be my preferred choice.
Ok, thank you, I'll try to put together and test some patches, and to post them for discussion in the next few days.
Quoted 8 lines
From: Jens Axboe <[email protected]>
Date: Tue, Nov 18, 2008 08:12:08PM +0100Quoted 4 lines · Fabio Checconi
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.
...
Quoted 11 lines
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
Quoted 8 lines
My main goal here is basically avoiding addition of Yet Another IO scheduler, especially one that is so closely tied to CFQ already.
I'll start things off by splitting cfq into a few files similar to what bfq has done, as I think it makes a lot of sense. Fabio, if you could create patches for the small behavioural changes you made, we can discuss and hopefully merge those next.
Ok, I can do that, I need just a little bit of time to organize the work.
About these small (some of them are really small) changes, a mixed list of things that they will touch and/or things that I'd like to have clear before starting to write the patches (maybe we can start another thread for them):
- In cfq_exit_single_io_context() and in changed_ioprio(), cic->key is dereferenced without holding any lock. As I reported in [1] this seems to be a problem when an exit() races with a cfq_exit_queue() and in a few other cases. In BFQ we used a somehow involved mechanism to avoid that, abusing rcu (of course we'll have to wait the patch to talk about it :) ), but given my lack of understanding of some parts of the block layer, I'd be interested in knowing if the race is possible and/or if there is something more involved going on that can cause the same effects.
- set_task_ioprio() in fs/ioprio.c doesn't seem to have a write memory barrier to pair with the dependent read one in cfq_get_io_context().
- CFQ_MIN_TT is 2ms, this can result, depending on the value of HZ in timeouts of one jiffy, that may expire too early, so we are just wasting time and do not actually wait for the task to present its new request. Dealing with seeky traffic we've seen a lot of early timeouts due to one jiffy timers expiring too early, is it worth fixing or can we live with that?
- To detect hw tagging in BFQ we consider a sample valid iff the number of requests that the scheduler could have dispatched (given by cfqd->rb_queued + cfqd->rq_in_driver, i.e., the ones still into the scheduler plus the ones into the driver) is higher than the CFQ_HW_QUEUE_MIN threshold. This obviously caused no problems during testing, but the way CFQ uses now seems a little bit strange.
- Initially, cic->last_request_pos is zero, so the sdist charged to a task for its first seek depends on the position on the disk that is accessed first, independently from its seekiness. Even if there is a cap on that value, we choose to not charge the first seek to processes; that resulted in less wrong predictions for purely sequential loads.
- From my understanding, with shared I/O contexts, two different tasks may concurrently lookup for a cfqd into the same ioc. This may result in cfq_drop_dead_cic() being called two times for the same cic. Am I missing something that prevents that from happening?
Regarding the code splitup, do you think you'll go for the CFS(BFQ) way, using a single compilation unit and including the .c files, or a layout with different compilation units (like the ll_rw_blk.c splitup)?
Quoted 52 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
Quoted 8 lines
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality to elv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.
Jens, what is your opinion everything beyond (1) in the above list?
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Quoted 13 lines
My main goal here is basically avoiding addition of Yet Another IO scheduler, especially one that is so closely tied to CFQ already.
I'll start things off by splitting cfq into a few files similar to what bfq has done, as I think it makes a lot of sense. Fabio, if you could create patches for the small behavioural changes you made, we can discuss and hopefully merge those next.
--
Jens Axboe
Quoted 52 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
Quoted 8 lines
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality to elv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.
Jens, what is your opinion everything beyond (1) in the above list?
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Quoted 13 lines
My main goal here is basically avoiding addition of Yet Another IO scheduler, especially one that is so closely tied to CFQ already.
I'll start things off by splitting cfq into a few files similar to what bfq has done, as I think it makes a lot of sense. Fabio, if you could create patches for the small behavioural changes you made, we can discuss and hopefully merge those next.
--
Jens Axboe
A message that is not in the archive (sent off-list or not yet received): e98e18940811181507t6b1473act2efa23df21dab270-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 57 lines · Nauman Rafique
Quoted 56 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.
Quoted 7 lines
Quoted 4 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
Yep, at least that is my preference.
Quoted 20 lines
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.
Quoted 5 lines
Jens, what is your opinion everything beyond (1) in the above list?
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Sounds feasible, I'd like to see the cgroups approach get more traction. My primary concern is just that I don't want to merge it into specific IO schedulers. As you mention, we can hook into the may queue logic for that subset of the problem, that avoids touching the io scheduler. If we can get this supported 'generically', then I'd be happy to help out.
Signature · 1 line
Jens Axboe
Quoted 57 lines · Nauman Rafique
Quoted 56 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.
Quoted 7 lines
Quoted 4 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
Yep, at least that is my preference.
Quoted 20 lines
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.
Quoted 5 lines
Jens, what is your opinion everything beyond (1) in the above list?
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Sounds feasible, I'd like to see the cgroups approach get more traction. My primary concern is just that I don't want to merge it into specific IO schedulers. As you mention, we can hook into the may queue logic for that subset of the problem, that avoids touching the io scheduler. If we can get this supported 'generically', then I'd be happy to help out.
Signature · 1 line
Jens Axboe
Quoted 57 lines · Nauman Rafique
Quoted 56 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.
Quoted 7 lines
Quoted 4 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
Yep, at least that is my preference.
Quoted 20 lines
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.
Quoted 5 lines
Jens, what is your opinion everything beyond (1) in the above list?
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Sounds feasible, I'd like to see the cgroups approach get more traction. My primary concern is just that I don't want to merge it into specific IO schedulers. As you mention, we can hook into the may queue logic for that subset of the problem, that avoids touching the io scheduler. If we can get this supported 'generically', then I'd be happy to help out.
Signature · 1 line
Jens Axboe
A message that is not in the archive (sent off-list or not yet received): 20081119142446.GH26308-tSWWG44O7X1aa/[email protected]
Quoted 90 lines · Jens Axboe
Quoted 57 lines · Nauman Rafique
Quoted 56 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.Quoted 7 lines
Quoted 4 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
Yep, at least that is my preference.
Quoted 22 lines
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.Jens, what is your opinion everything beyond (1) in the above list?
Quoted 7 lines
Quoted 3 lines
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Sounds feasible, I'd like to see the cgroups approach get more traction. My primary concern is just that I don't want to merge it into specific IO schedulers.
Jens,
So are you saying you don't prefer cgroups based proportional IO
division solutions in the IO scheduler but at a layer above so it can be shared with all IO schedulers?
If yes, then in that case, what do you think about Vivek Goyal's
patch or dm-ioband that achieve that. Of course, both solutions don't meet all the requirements in the list above, but we can work on that once we know which direction we should be heading in. In fact, it would help if you could express the reservations (if you have any) about these approaches. That would help in coming up with a plan that everyone agrees on.
Thanks,
DIvyesh
As you mention, we can hook into the may queue logic for
Quoted 7 lines
that subset of the problem, that avoids touching the io scheduler. If we can get this supported 'generically', then I'd be happy to help out.
--
Jens Axboe
Quoted 90 lines · Jens Axboe
Quoted 57 lines · Nauman Rafique
Quoted 56 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.Quoted 7 lines
Quoted 4 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
Yep, at least that is my preference.
Quoted 22 lines
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.Jens, what is your opinion everything beyond (1) in the above list?
Quoted 7 lines
Quoted 3 lines
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Sounds feasible, I'd like to see the cgroups approach get more traction. My primary concern is just that I don't want to merge it into specific IO schedulers.
Jens,
So are you saying you don't prefer cgroups based proportional IO
division solutions in the IO scheduler but at a layer above so it can be shared with all IO schedulers?
If yes, then in that case, what do you think about Vivek Goyal's
patch or dm-ioband that achieve that. Of course, both solutions don't meet all the requirements in the list above, but we can work on that once we know which direction we should be heading in. In fact, it would help if you could express the reservations (if you have any) about these approaches. That would help in coming up with a plan that everyone agrees on.
Thanks,
DIvyesh
As you mention, we can hook into the may queue logic for
Quoted 7 lines
that subset of the problem, that avoids touching the io scheduler. If we can get this supported 'generically', then I'd be happy to help out.
--
Jens Axboe
Quoted 90 lines · Jens Axboe
Quoted 57 lines · Nauman Rafique
Quoted 56 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.Quoted 7 lines
Quoted 4 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
Yep, at least that is my preference.
Quoted 22 lines
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.Jens, what is your opinion everything beyond (1) in the above list?
Quoted 7 lines
Quoted 3 lines
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Sounds feasible, I'd like to see the cgroups approach get more traction. My primary concern is just that I don't want to merge it into specific IO schedulers.
Jens,
So are you saying you don't prefer cgroups based proportional IO
division solutions in the IO scheduler but at a layer above so it can be shared with all IO schedulers?
If yes, then in that case, what do you think about Vivek Goyal's
patch or dm-ioband that achieve that. Of course, both solutions don't meet all the requirements in the list above, but we can work on that once we know which direction we should be heading in. In fact, it would help if you could express the reservations (if you have any) about these approaches. That would help in coming up with a plan that everyone agrees on.
Thanks,
DIvyesh
As you mention, we can hook into the may queue logic for
Quoted 7 lines
that subset of the problem, that avoids touching the io scheduler. If we can get this supported 'generically', then I'd be happy to help out.
--
Jens Axboe
A message that is not in the archive (sent off-list or not yet received): af41c7c40811191612v5db13ae7n3cfe537beb6a157c-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 104 lines · Divyesh Shah
Quoted 90 lines · Jens Axboe
Quoted 57 lines · Nauman Rafique
Quoted 56 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.Quoted 7 lines
Quoted 4 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
Yep, at least that is my preference.
Quoted 22 lines
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.Jens, what is your opinion everything beyond (1) in the above list?
Quoted 7 lines
Quoted 3 lines
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Sounds feasible, I'd like to see the cgroups approach get more traction. My primary concern is just that I don't want to merge it into specific IO schedulers.
Jens,
So are you saying you don't prefer cgroups based proportional IO
division solutions in the IO scheduler but at a layer above so it can be shared with all IO schedulers?
Quoted 7 lines
If yes, then in that case, what do you think about Vivek Goyal's
patch or dm-ioband that achieve that. Of course, both solutions don't meet all the requirements in the list above, but we can work on that once we know which direction we should be heading in. In fact, it would help if you could express the reservations (if you have any) about these approaches. That would help in coming up with a plan that everyone agrees on.
The dm approach has some merrits, the major one being that it'll fit directly into existing setups that use dm and can be controlled with familiar tools. That is a bonus. The draw back is partially the same - it'll require dm. So it's still not a fit-all approach, unfortunately.
So I'd prefer an approach that doesn't force you to use dm.
Signature · 1 line
Jens Axboe
Quoted 104 lines · Divyesh Shah
Quoted 90 lines · Jens Axboe
Quoted 57 lines · Nauman Rafique
Quoted 56 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.Quoted 7 lines
Quoted 4 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
Yep, at least that is my preference.
Quoted 22 lines
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.Jens, what is your opinion everything beyond (1) in the above list?
Quoted 7 lines
Quoted 3 lines
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Sounds feasible, I'd like to see the cgroups approach get more traction. My primary concern is just that I don't want to merge it into specific IO schedulers.
Jens,
So are you saying you don't prefer cgroups based proportional IO
division solutions in the IO scheduler but at a layer above so it can be shared with all IO schedulers?
Quoted 7 lines
If yes, then in that case, what do you think about Vivek Goyal's
patch or dm-ioband that achieve that. Of course, both solutions don't meet all the requirements in the list above, but we can work on that once we know which direction we should be heading in. In fact, it would help if you could express the reservations (if you have any) about these approaches. That would help in coming up with a plan that everyone agrees on.
The dm approach has some merrits, the major one being that it'll fit directly into existing setups that use dm and can be controlled with familiar tools. That is a bonus. The draw back is partially the same - it'll require dm. So it's still not a fit-all approach, unfortunately.
So I'd prefer an approach that doesn't force you to use dm.
Signature · 1 line
Jens Axboe
Quoted 104 lines · Divyesh Shah
Quoted 90 lines · Jens Axboe
Quoted 57 lines · Nauman Rafique
Quoted 56 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.Quoted 7 lines
Quoted 4 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
Yep, at least that is my preference.
Quoted 22 lines
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.Jens, what is your opinion everything beyond (1) in the above list?
Quoted 7 lines
Quoted 3 lines
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Sounds feasible, I'd like to see the cgroups approach get more traction. My primary concern is just that I don't want to merge it into specific IO schedulers.
Jens,
So are you saying you don't prefer cgroups based proportional IO
division solutions in the IO scheduler but at a layer above so it can be shared with all IO schedulers?
Quoted 7 lines
If yes, then in that case, what do you think about Vivek Goyal's
patch or dm-ioband that achieve that. Of course, both solutions don't meet all the requirements in the list above, but we can work on that once we know which direction we should be heading in. In fact, it would help if you could express the reservations (if you have any) about these approaches. That would help in coming up with a plan that everyone agrees on.
The dm approach has some merrits, the major one being that it'll fit directly into existing setups that use dm and can be controlled with familiar tools. That is a bonus. The draw back is partially the same - it'll require dm. So it's still not a fit-all approach, unfortunately.
So I'd prefer an approach that doesn't force you to use dm.
Signature · 1 line
Jens Axboe
A message that is not in the archive (sent off-list or not yet received): 20081120081640.GE26308-tSWWG44O7X1aa/[email protected]
Quoted 113 lines · Jens Axboe
Quoted 104 lines · Divyesh Shah
Quoted 90 lines · Jens Axboe
Quoted 57 lines · Nauman Rafique
Quoted 56 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.Quoted 7 lines
Quoted 4 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
Yep, at least that is my preference.
Quoted 22 lines
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.Jens, what is your opinion everything beyond (1) in the above list?
Quoted 7 lines
Quoted 3 lines
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Sounds feasible, I'd like to see the cgroups approach get more traction. My primary concern is just that I don't want to merge it into specific IO schedulers.
Jens,
So are you saying you don't prefer cgroups based proportional IO
division solutions in the IO scheduler but at a layer above so it can be shared with all IO schedulers?Quoted 7 lines
If yes, then in that case, what do you think about Vivek Goyal's
patch or dm-ioband that achieve that. Of course, both solutions don't meet all the requirements in the list above, but we can work on that once we know which direction we should be heading in. In fact, it would help if you could express the reservations (if you have any) about these approaches. That would help in coming up with a plan that everyone agrees on.
Quoted 6 lines
The dm approach has some merrits, the major one being that it'll fit directly into existing setups that use dm and can be controlled with familiar tools. That is a bonus. The draw back is partially the same - it'll require dm. So it's still not a fit-all approach, unfortunately.
So I'd prefer an approach that doesn't force you to use dm.
Hi Jens,
My patches met the goal of not using the dm for every device one wants to control.
Having said that, few things come to mind.
- In what cases do we need to control the higher level logical devices like dm. It looks like real contention for resources is at leaf nodes. Hence any kind of resource management/fair queueing should probably be done at leaf nodes and not at higher level logical nodes.
If that makes sense, then probably we don't need to control dm device and we don't need such higher level solutions.
- Any kind of 2 level scheduler solution has the potential to break the underlying IO scheduler. Higher level solution requires buffering of bios and controlled release of bios to lower layers. This control breaks the assumptions of lower layer IO scheduler which knows in what order bios should be dispatched to device to meet the semantics exported by the IO scheduler.
- 2nd level scheduler does not keep track of tasks but task groups lets every group dispatch fair share. This has got little semantic problem in the sense that tasks and groups in root cgroup will not be considered at same level. "root" will be considered one group at same level with all child group hence competing with them for resources.
This looks little odd. Considering tasks and groups same level kind of makes more sense. cpu scheduler also consideres tasks and groups at same level and deviation from that probably is not very good.
Considering tasks and groups at same level will matter only if IO scheduler maintains separate queue for the task, like CFQ. Because in that case IO scheduler tries to provide fairness among various task queues. Some schedulers like noop don't have any notion of separate task queues and fairness among them. In that case probably we don't have a choice but to assume root group competing with child groups.
Keeping above points in mind, probably two level scheduling is not a very good idea. If putting the code in a particular IO scheduler is a concern we can probably explore ways regarding how we can maximize the sharing of cgroup code among IO schedulers.
Thanks
Vivek
Quoted 113 lines · Jens Axboe
Quoted 104 lines · Divyesh Shah
Quoted 90 lines · Jens Axboe
Quoted 57 lines · Nauman Rafique
Quoted 56 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.Quoted 7 lines
Quoted 4 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
Yep, at least that is my preference.
Quoted 22 lines
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.Jens, what is your opinion everything beyond (1) in the above list?
Quoted 7 lines
Quoted 3 lines
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Sounds feasible, I'd like to see the cgroups approach get more traction. My primary concern is just that I don't want to merge it into specific IO schedulers.
Jens,
So are you saying you don't prefer cgroups based proportional IO
division solutions in the IO scheduler but at a layer above so it can be shared with all IO schedulers?Quoted 7 lines
If yes, then in that case, what do you think about Vivek Goyal's
patch or dm-ioband that achieve that. Of course, both solutions don't meet all the requirements in the list above, but we can work on that once we know which direction we should be heading in. In fact, it would help if you could express the reservations (if you have any) about these approaches. That would help in coming up with a plan that everyone agrees on.
Quoted 6 lines
The dm approach has some merrits, the major one being that it'll fit directly into existing setups that use dm and can be controlled with familiar tools. That is a bonus. The draw back is partially the same - it'll require dm. So it's still not a fit-all approach, unfortunately.
So I'd prefer an approach that doesn't force you to use dm.
Hi Jens,
My patches met the goal of not using the dm for every device one wants to control.
Having said that, few things come to mind.
- In what cases do we need to control the higher level logical devices like dm. It looks like real contention for resources is at leaf nodes. Hence any kind of resource management/fair queueing should probably be done at leaf nodes and not at higher level logical nodes.
If that makes sense, then probably we don't need to control dm device and we don't need such higher level solutions.
- Any kind of 2 level scheduler solution has the potential to break the underlying IO scheduler. Higher level solution requires buffering of bios and controlled release of bios to lower layers. This control breaks the assumptions of lower layer IO scheduler which knows in what order bios should be dispatched to device to meet the semantics exported by the IO scheduler.
- 2nd level scheduler does not keep track of tasks but task groups lets every group dispatch fair share. This has got little semantic problem in the sense that tasks and groups in root cgroup will not be considered at same level. "root" will be considered one group at same level with all child group hence competing with them for resources.
This looks little odd. Considering tasks and groups same level kind of makes more sense. cpu scheduler also consideres tasks and groups at same level and deviation from that probably is not very good.
Considering tasks and groups at same level will matter only if IO scheduler maintains separate queue for the task, like CFQ. Because in that case IO scheduler tries to provide fairness among various task queues. Some schedulers like noop don't have any notion of separate task queues and fairness among them. In that case probably we don't have a choice but to assume root group competing with child groups.
Keeping above points in mind, probably two level scheduling is not a very good idea. If putting the code in a particular IO scheduler is a concern we can probably explore ways regarding how we can maximize the sharing of cgroup code among IO schedulers.
Thanks
Vivek
Quoted 113 lines · Jens Axboe
Quoted 104 lines · Divyesh Shah
Quoted 90 lines · Jens Axboe
Quoted 57 lines · Nauman Rafique
Quoted 56 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.Quoted 7 lines
Quoted 4 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
Yep, at least that is my preference.
Quoted 22 lines
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.Jens, what is your opinion everything beyond (1) in the above list?
Quoted 7 lines
Quoted 3 lines
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Sounds feasible, I'd like to see the cgroups approach get more traction. My primary concern is just that I don't want to merge it into specific IO schedulers.
Jens,
So are you saying you don't prefer cgroups based proportional IO
division solutions in the IO scheduler but at a layer above so it can be shared with all IO schedulers?Quoted 7 lines
If yes, then in that case, what do you think about Vivek Goyal's
patch or dm-ioband that achieve that. Of course, both solutions don't meet all the requirements in the list above, but we can work on that once we know which direction we should be heading in. In fact, it would help if you could express the reservations (if you have any) about these approaches. That would help in coming up with a plan that everyone agrees on.
Quoted 6 lines
The dm approach has some merrits, the major one being that it'll fit directly into existing setups that use dm and can be controlled with familiar tools. That is a bonus. The draw back is partially the same - it'll require dm. So it's still not a fit-all approach, unfortunately.
So I'd prefer an approach that doesn't force you to use dm.
Hi Jens,
My patches met the goal of not using the dm for every device one wants to control.
Having said that, few things come to mind.
- In what cases do we need to control the higher level logical devices like dm. It looks like real contention for resources is at leaf nodes. Hence any kind of resource management/fair queueing should probably be done at leaf nodes and not at higher level logical nodes.
If that makes sense, then probably we don't need to control dm device and we don't need such higher level solutions.
- Any kind of 2 level scheduler solution has the potential to break the underlying IO scheduler. Higher level solution requires buffering of bios and controlled release of bios to lower layers. This control breaks the assumptions of lower layer IO scheduler which knows in what order bios should be dispatched to device to meet the semantics exported by the IO scheduler.
- 2nd level scheduler does not keep track of tasks but task groups lets every group dispatch fair share. This has got little semantic problem in the sense that tasks and groups in root cgroup will not be considered at same level. "root" will be considered one group at same level with all child group hence competing with them for resources.
This looks little odd. Considering tasks and groups same level kind of makes more sense. cpu scheduler also consideres tasks and groups at same level and deviation from that probably is not very good.
Considering tasks and groups at same level will matter only if IO scheduler maintains separate queue for the task, like CFQ. Because in that case IO scheduler tries to provide fairness among various task queues. Some schedulers like noop don't have any notion of separate task queues and fairness among them. In that case probably we don't have a choice but to assume root group competing with child groups.
Keeping above points in mind, probably two level scheduling is not a very good idea. If putting the code in a particular IO scheduler is a concern we can probably explore ways regarding how we can maximize the sharing of cgroup code among IO schedulers.
Thanks
Vivek
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 161 lines · Vivek Goyal
Quoted 113 lines · Jens Axboe
Quoted 104 lines · Divyesh Shah
Quoted 90 lines · Jens Axboe
Quoted 57 lines · Nauman Rafique
Quoted 56 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.Quoted 7 lines
Quoted 4 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
Yep, at least that is my preference.
Quoted 22 lines
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.Jens, what is your opinion everything beyond (1) in the above list?
Quoted 7 lines
Quoted 3 lines
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Sounds feasible, I'd like to see the cgroups approach get more traction. My primary concern is just that I don't want to merge it into specific IO schedulers.
Jens,
So are you saying you don't prefer cgroups based proportional IO
division solutions in the IO scheduler but at a layer above so it can be shared with all IO schedulers?Quoted 7 lines
If yes, then in that case, what do you think about Vivek Goyal's
patch or dm-ioband that achieve that. Of course, both solutions don't meet all the requirements in the list above, but we can work on that once we know which direction we should be heading in. In fact, it would help if you could express the reservations (if you have any) about these approaches. That would help in coming up with a plan that everyone agrees on.Quoted 6 lines
The dm approach has some merrits, the major one being that it'll fit directly into existing setups that use dm and can be controlled with familiar tools. That is a bonus. The draw back is partially the same - it'll require dm. So it's still not a fit-all approach, unfortunately.
So I'd prefer an approach that doesn't force you to use dm.
Hi Jens,
My patches met the goal of not using the dm for every device one wants to control.
Having said that, few things come to mind.
- In what cases do we need to control the higher level logical devices like dm. It looks like real contention for resources is at leaf nodes. Hence any kind of resource management/fair queueing should probably be done at leaf nodes and not at higher level logical nodes.
If that makes sense, then probably we don't need to control dm device and we don't need such higher level solutions.
- Any kind of 2 level scheduler solution has the potential to break the underlying IO scheduler. Higher level solution requires buffering of bios and controlled release of bios to lower layers. This control breaks the assumptions of lower layer IO scheduler which knows in what order bios should be dispatched to device to meet the semantics exported by the IO scheduler.
- 2nd level scheduler does not keep track of tasks but task groups lets every group dispatch fair share. This has got little semantic problem in the sense that tasks and groups in root cgroup will not be considered at same level. "root" will be considered one group at same level with all child group hence competing with them for resources.
This looks little odd. Considering tasks and groups same level kind of makes more sense. cpu scheduler also consideres tasks and groups at same level and deviation from that probably is not very good.
Considering tasks and groups at same level will matter only if IO scheduler maintains separate queue for the task, like CFQ. Because in that case IO scheduler tries to provide fairness among various task queues. Some schedulers like noop don't have any notion of separate task queues and fairness among them. In that case probably we don't have a choice but to assume root group competing with child groups.
Quoted 8 lines
Keeping above points in mind, probably two level scheduling is not a very good idea. If putting the code in a particular IO scheduler is a concern we can probably explore ways regarding how we can maximize the sharing of cgroup code among IO schedulers.
Thanks
Vivek
It seems that we have a solution if we can figure out a way to share cgroup code between different schedulers. I am thinking how other schedulers (AS, Deadline, No-op) would use cgroups. Will they have proportional division between requests from different cgroups? And use their own policy (e.g deadline scheduling) within a cgroup? How about if we have both threads and cgroups at a particular level? I think putting all threads in a default cgroup seems like a reasonable choice in this case.
Here is a high level design that comes to mind.
Put proportional division code and state in common code. Each level of the hierarchy which has more than one cgroup would have some state maintained in common code. At leaf level of hiearchy, we can have a cgroup specific scheduler (created when a cgroup is created). We can choose a different scheduler for each cgroup (we can have a no-op for one cgroup while cfq for another).
The scheduler gets a callback (just like it does right now from driver) when the common code schedules a time slice (or budget) from that cgroup. No buffering/queuing is done in the common code, so it will still be a single level scheduler. When a request arrives, it is routed to its scheduler's queues based on its cgroup.
The common code proportional scheduler uses specified weights to schedule time slices. Please let me know if it makes any sense. And then we can start talking about lower level details.
Quoted 12 lines · Vivek Goyal
Quoted 6 lines
The dm approach has some merrits, the major one being that it'll fit directly into existing setups that use dm and can be controlled with familiar tools. That is a bonus. The draw back is partially the same - it'll require dm. So it's still not a fit-all approach, unfortunately.
So I'd prefer an approach that doesn't force you to use dm.
Hi Jens,
My patches met the goal of not using the dm for every device one wants to control.
Quoted 6 lines
Having said that, few things come to mind.
- In what cases do we need to control the higher level logical devices like dm. It looks like real contention for resources is at leaf nodes. Hence any kind of resource management/fair queueing should probably be done at leaf nodes and not at higher level logical nodes.
The problem with stacking devices is that we do not know how the IO going through the leaf nodes contributes to the aggregate throughput seen by the application/cgroup that generated it, which is what end users care about.
The block device could be a plain old sata device, a loop device, a stacking device, a SSD, you name it, but their topologies and the fact that some of them do not even use an elevator should be transparent to the user.
If you wanted to do resource management at the leaf nodes some kind of topology information should be passed down to the elevators controlling the underlying devices, which in turn would need to work cooperatively.
Quoted 2 lines
If that makes sense, then probably we don't need to control dm device and we don't need such higher level solutions.
For the reasons stated above the two level scheduling approach seems cleaner to me.
Quoted 6 lines
- Any kind of 2 level scheduler solution has the potential to break the underlying IO scheduler. Higher level solution requires buffering of bios and controlled release of bios to lower layers. This control breaks the assumptions of lower layer IO scheduler which knows in what order bios should be dispatched to device to meet the semantics exported by the IO scheduler.
Please notice that the such an IO controller would only get in the way of the elevator in case of contention for the device. What is more, depending on the workload it turns out that buffering at higher layers in a per-cgroup or per-task basis, like dm-band does, may actually increase the aggregate throughput (I think that the dm-band team observed this behavior too). The reason seems to be that bios buffered in such way tend to be highly correlated and thus very likely to get merged when released to the elevator.
Quoted 10 lines
- 2nd level scheduler does not keep track of tasks but task groups lets every group dispatch fair share. This has got little semantic problem in the sense that tasks and groups in root cgroup will not be considered at same level. "root" will be considered one group at same level with all child group hence competing with them for resources.
This looks little odd. Considering tasks and groups same level kind of makes more sense. cpu scheduler also consideres tasks and groups at same level and deviation from that probably is not very good.
Quoted 6 lines
Considering tasks and groups at same level will matter only if IO scheduler maintains separate queue for the task, like CFQ. Because in that case IO scheduler tries to provide fairness among various task queues. Some schedulers like noop don't have any notion of separate task queues and fairness among them. In that case probably we don't have a choice but to assume root group competing with child groups.
If deemed necessary this case could be handled too, but it does not look like a show-stopper.
Quoted 4 lines
Keeping above points in mind, probably two level scheduling is not a very good idea. If putting the code in a particular IO scheduler is a concern we can probably explore ways regarding how we can maximize the sharing of cgroup code among IO schedulers.
As discussed above, I still think that the two level scheduling approach makes more sense. Regarding the sharing of cgroup code among IO schedulers I am all for it. If we consider that elevators should only care about maximizing usage of the underlying devices, implementing other non-hardware-dependent scheduling disciplines (that prioritize according to the task or cgroup that generated the IO, for example) at higher layers so that we can reuse code makes a lot of sense.
Thanks,
Fernando
Quoted 161 lines · Vivek Goyal
Quoted 113 lines · Jens Axboe
Quoted 104 lines · Divyesh Shah
Quoted 90 lines · Jens Axboe
Quoted 57 lines · Nauman Rafique
Quoted 56 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.Quoted 7 lines
Quoted 4 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
Yep, at least that is my preference.
Quoted 22 lines
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.Jens, what is your opinion everything beyond (1) in the above list?
Quoted 7 lines
Quoted 3 lines
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Sounds feasible, I'd like to see the cgroups approach get more traction. My primary concern is just that I don't want to merge it into specific IO schedulers.
Jens,
So are you saying you don't prefer cgroups based proportional IO
division solutions in the IO scheduler but at a layer above so it can be shared with all IO schedulers?Quoted 7 lines
If yes, then in that case, what do you think about Vivek Goyal's
patch or dm-ioband that achieve that. Of course, both solutions don't meet all the requirements in the list above, but we can work on that once we know which direction we should be heading in. In fact, it would help if you could express the reservations (if you have any) about these approaches. That would help in coming up with a plan that everyone agrees on.Quoted 6 lines
The dm approach has some merrits, the major one being that it'll fit directly into existing setups that use dm and can be controlled with familiar tools. That is a bonus. The draw back is partially the same - it'll require dm. So it's still not a fit-all approach, unfortunately.
So I'd prefer an approach that doesn't force you to use dm.
Hi Jens,
My patches met the goal of not using the dm for every device one wants to control.
Having said that, few things come to mind.
- In what cases do we need to control the higher level logical devices like dm. It looks like real contention for resources is at leaf nodes. Hence any kind of resource management/fair queueing should probably be done at leaf nodes and not at higher level logical nodes.
If that makes sense, then probably we don't need to control dm device and we don't need such higher level solutions.
- Any kind of 2 level scheduler solution has the potential to break the underlying IO scheduler. Higher level solution requires buffering of bios and controlled release of bios to lower layers. This control breaks the assumptions of lower layer IO scheduler which knows in what order bios should be dispatched to device to meet the semantics exported by the IO scheduler.
- 2nd level scheduler does not keep track of tasks but task groups lets every group dispatch fair share. This has got little semantic problem in the sense that tasks and groups in root cgroup will not be considered at same level. "root" will be considered one group at same level with all child group hence competing with them for resources.
This looks little odd. Considering tasks and groups same level kind of makes more sense. cpu scheduler also consideres tasks and groups at same level and deviation from that probably is not very good.
Considering tasks and groups at same level will matter only if IO scheduler maintains separate queue for the task, like CFQ. Because in that case IO scheduler tries to provide fairness among various task queues. Some schedulers like noop don't have any notion of separate task queues and fairness among them. In that case probably we don't have a choice but to assume root group competing with child groups.
Quoted 8 lines
Keeping above points in mind, probably two level scheduling is not a very good idea. If putting the code in a particular IO scheduler is a concern we can probably explore ways regarding how we can maximize the sharing of cgroup code among IO schedulers.
Thanks
Vivek
It seems that we have a solution if we can figure out a way to share cgroup code between different schedulers. I am thinking how other schedulers (AS, Deadline, No-op) would use cgroups. Will they have proportional division between requests from different cgroups? And use their own policy (e.g deadline scheduling) within a cgroup? How about if we have both threads and cgroups at a particular level? I think putting all threads in a default cgroup seems like a reasonable choice in this case.
Here is a high level design that comes to mind.
Put proportional division code and state in common code. Each level of the hierarchy which has more than one cgroup would have some state maintained in common code. At leaf level of hiearchy, we can have a cgroup specific scheduler (created when a cgroup is created). We can choose a different scheduler for each cgroup (we can have a no-op for one cgroup while cfq for another).
The scheduler gets a callback (just like it does right now from driver) when the common code schedules a time slice (or budget) from that cgroup. No buffering/queuing is done in the common code, so it will still be a single level scheduler. When a request arrives, it is routed to its scheduler's queues based on its cgroup.
The common code proportional scheduler uses specified weights to schedule time slices. Please let me know if it makes any sense. And then we can start talking about lower level details.
Quoted 161 lines · Vivek Goyal
Quoted 113 lines · Jens Axboe
Quoted 104 lines · Divyesh Shah
Quoted 90 lines · Jens Axboe
Quoted 57 lines · Nauman Rafique
Quoted 56 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.Quoted 7 lines
Quoted 4 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
Yep, at least that is my preference.
Quoted 22 lines
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.Jens, what is your opinion everything beyond (1) in the above list?
Quoted 7 lines
Quoted 3 lines
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Sounds feasible, I'd like to see the cgroups approach get more traction. My primary concern is just that I don't want to merge it into specific IO schedulers.
Jens,
So are you saying you don't prefer cgroups based proportional IO
division solutions in the IO scheduler but at a layer above so it can be shared with all IO schedulers?Quoted 7 lines
If yes, then in that case, what do you think about Vivek Goyal's
patch or dm-ioband that achieve that. Of course, both solutions don't meet all the requirements in the list above, but we can work on that once we know which direction we should be heading in. In fact, it would help if you could express the reservations (if you have any) about these approaches. That would help in coming up with a plan that everyone agrees on.Quoted 6 lines
The dm approach has some merrits, the major one being that it'll fit directly into existing setups that use dm and can be controlled with familiar tools. That is a bonus. The draw back is partially the same - it'll require dm. So it's still not a fit-all approach, unfortunately.
So I'd prefer an approach that doesn't force you to use dm.
Hi Jens,
My patches met the goal of not using the dm for every device one wants to control.
Having said that, few things come to mind.
- In what cases do we need to control the higher level logical devices like dm. It looks like real contention for resources is at leaf nodes. Hence any kind of resource management/fair queueing should probably be done at leaf nodes and not at higher level logical nodes.
If that makes sense, then probably we don't need to control dm device and we don't need such higher level solutions.
- Any kind of 2 level scheduler solution has the potential to break the underlying IO scheduler. Higher level solution requires buffering of bios and controlled release of bios to lower layers. This control breaks the assumptions of lower layer IO scheduler which knows in what order bios should be dispatched to device to meet the semantics exported by the IO scheduler.
- 2nd level scheduler does not keep track of tasks but task groups lets every group dispatch fair share. This has got little semantic problem in the sense that tasks and groups in root cgroup will not be considered at same level. "root" will be considered one group at same level with all child group hence competing with them for resources.
This looks little odd. Considering tasks and groups same level kind of makes more sense. cpu scheduler also consideres tasks and groups at same level and deviation from that probably is not very good.
Considering tasks and groups at same level will matter only if IO scheduler maintains separate queue for the task, like CFQ. Because in that case IO scheduler tries to provide fairness among various task queues. Some schedulers like noop don't have any notion of separate task queues and fairness among them. In that case probably we don't have a choice but to assume root group competing with child groups.
Quoted 8 lines
Keeping above points in mind, probably two level scheduling is not a very good idea. If putting the code in a particular IO scheduler is a concern we can probably explore ways regarding how we can maximize the sharing of cgroup code among IO schedulers.
Thanks
Vivek
It seems that we have a solution if we can figure out a way to share cgroup code between different schedulers. I am thinking how other schedulers (AS, Deadline, No-op) would use cgroups. Will they have proportional division between requests from different cgroups? And use their own policy (e.g deadline scheduling) within a cgroup? How about if we have both threads and cgroups at a particular level? I think putting all threads in a default cgroup seems like a reasonable choice in this case.
Here is a high level design that comes to mind.
Put proportional division code and state in common code. Each level of the hierarchy which has more than one cgroup would have some state maintained in common code. At leaf level of hiearchy, we can have a cgroup specific scheduler (created when a cgroup is created). We can choose a different scheduler for each cgroup (we can have a no-op for one cgroup while cfq for another).
The scheduler gets a callback (just like it does right now from driver) when the common code schedules a time slice (or budget) from that cgroup. No buffering/queuing is done in the common code, so it will still be a single level scheduler. When a request arrives, it is routed to its scheduler's queues based on its cgroup.
The common code proportional scheduler uses specified weights to schedule time slices. Please let me know if it makes any sense. And then we can start talking about lower level details.
A message that is not in the archive (sent off-list or not yet received): e98e18940811201154l6fb0499x24da39812fb2aa7e-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 180 lines · Nauman Rafique
Quoted 161 lines · Vivek Goyal
Quoted 113 lines · Jens Axboe
Quoted 104 lines · Divyesh Shah
Quoted 90 lines · Jens Axboe
Quoted 57 lines · Nauman Rafique
Quoted 56 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.Quoted 7 lines
Quoted 4 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
Yep, at least that is my preference.
Quoted 22 lines
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.Jens, what is your opinion everything beyond (1) in the above list?
Quoted 7 lines
Quoted 3 lines
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Sounds feasible, I'd like to see the cgroups approach get more traction. My primary concern is just that I don't want to merge it into specific IO schedulers.
Jens,
So are you saying you don't prefer cgroups based proportional IO
division solutions in the IO scheduler but at a layer above so it can be shared with all IO schedulers?Quoted 7 lines
If yes, then in that case, what do you think about Vivek Goyal's
patch or dm-ioband that achieve that. Of course, both solutions don't meet all the requirements in the list above, but we can work on that once we know which direction we should be heading in. In fact, it would help if you could express the reservations (if you have any) about these approaches. That would help in coming up with a plan that everyone agrees on.Quoted 6 lines
The dm approach has some merrits, the major one being that it'll fit directly into existing setups that use dm and can be controlled with familiar tools. That is a bonus. The draw back is partially the same - it'll require dm. So it's still not a fit-all approach, unfortunately.
So I'd prefer an approach that doesn't force you to use dm.
Hi Jens,
My patches met the goal of not using the dm for every device one wants to control.
Having said that, few things come to mind.
- In what cases do we need to control the higher level logical devices like dm. It looks like real contention for resources is at leaf nodes. Hence any kind of resource management/fair queueing should probably be done at leaf nodes and not at higher level logical nodes.
If that makes sense, then probably we don't need to control dm device and we don't need such higher level solutions.
- Any kind of 2 level scheduler solution has the potential to break the underlying IO scheduler. Higher level solution requires buffering of bios and controlled release of bios to lower layers. This control breaks the assumptions of lower layer IO scheduler which knows in what order bios should be dispatched to device to meet the semantics exported by the IO scheduler.
- 2nd level scheduler does not keep track of tasks but task groups lets every group dispatch fair share. This has got little semantic problem in the sense that tasks and groups in root cgroup will not be considered at same level. "root" will be considered one group at same level with all child group hence competing with them for resources.
This looks little odd. Considering tasks and groups same level kind of makes more sense. cpu scheduler also consideres tasks and groups at same level and deviation from that probably is not very good.
Considering tasks and groups at same level will matter only if IO scheduler maintains separate queue for the task, like CFQ. Because in that case IO scheduler tries to provide fairness among various task queues. Some schedulers like noop don't have any notion of separate task queues and fairness among them. In that case probably we don't have a choice but to assume root group competing with child groups.
Quoted 8 lines
Keeping above points in mind, probably two level scheduling is not a very good idea. If putting the code in a particular IO scheduler is a concern we can probably explore ways regarding how we can maximize the sharing of cgroup code among IO schedulers.
Thanks
VivekIt seems that we have a solution if we can figure out a way to share cgroup code between different schedulers. I am thinking how other schedulers (AS, Deadline, No-op) would use cgroups. Will they have proportional division between requests from different cgroups? And use their own policy (e.g deadline scheduling) within a cgroup? How about if we have both threads and cgroups at a particular level? I think putting all threads in a default cgroup seems like a reasonable choice in this case.
Quoted 8 lines
Here is a high level design that comes to mind.
Put proportional division code and state in common code. Each level of the hierarchy which has more than one cgroup would have some state maintained in common code. At leaf level of hiearchy, we can have a cgroup specific scheduler (created when a cgroup is created). We can choose a different scheduler for each cgroup (we can have a no-op for one cgroup while cfq for another).
I am not sure that I understand the different scheduler for each cgroup aspect of it. What's the need? It makes things even more complicated I think.
But moving proportional division code out of particular scheduler and make it common makes sense.
Looking at BFQ, I was thinking that we can just keep large part of the code. This common code can think of everything as scheduling entity. This scheduling entity (SE) will be defined by underlying scheduler depending on how queue management is done by underlying scheduler. So for CFQ, at each level, an SE can be either task or group. For the schedulers which don't maintain separate queues for tasks, it will simply be group at all levels.
We probably can employ B-WFQ2+ to provide hierarchical fairness between secheduling entities of this tree. Common layer will do the scheduling of entities (without knowing what is contained inside) and underlying scheduler will take care of dispatching the requests from the scheduled entity. (It could be a task queue for CFQ or a group queue for other schedulers).
The tricky part would be how to abstract it in a clean way. It should lead to reduced code in CFQ/BFQ because B-WFQ2+ logic will be put into a common layer (for large part).
Quoted 10 lines
The scheduler gets a callback (just like it does right now from driver) when the common code schedules a time slice (or budget) from that cgroup. No buffering/queuing is done in the common code, so it will still be a single level scheduler. When a request arrives, it is routed to its scheduler's queues based on its cgroup.
The common code proportional scheduler uses specified weights to schedule time slices. Please let me know if it makes any sense. And then we can start talking about lower level details.
We can use either time slices or budgets (may be configurable) depending on which gives better results.
Thanks
Vivek
Quoted 180 lines · Nauman Rafique
Quoted 161 lines · Vivek Goyal
Quoted 113 lines · Jens Axboe
Quoted 104 lines · Divyesh Shah
Quoted 90 lines · Jens Axboe
Quoted 57 lines · Nauman Rafique
Quoted 56 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.Quoted 7 lines
Quoted 4 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
Yep, at least that is my preference.
Quoted 22 lines
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.Jens, what is your opinion everything beyond (1) in the above list?
Quoted 7 lines
Quoted 3 lines
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Sounds feasible, I'd like to see the cgroups approach get more traction. My primary concern is just that I don't want to merge it into specific IO schedulers.
Jens,
So are you saying you don't prefer cgroups based proportional IO
division solutions in the IO scheduler but at a layer above so it can be shared with all IO schedulers?Quoted 7 lines
If yes, then in that case, what do you think about Vivek Goyal's
patch or dm-ioband that achieve that. Of course, both solutions don't meet all the requirements in the list above, but we can work on that once we know which direction we should be heading in. In fact, it would help if you could express the reservations (if you have any) about these approaches. That would help in coming up with a plan that everyone agrees on.Quoted 6 lines
The dm approach has some merrits, the major one being that it'll fit directly into existing setups that use dm and can be controlled with familiar tools. That is a bonus. The draw back is partially the same - it'll require dm. So it's still not a fit-all approach, unfortunately.
So I'd prefer an approach that doesn't force you to use dm.
Hi Jens,
My patches met the goal of not using the dm for every device one wants to control.
Having said that, few things come to mind.
- In what cases do we need to control the higher level logical devices like dm. It looks like real contention for resources is at leaf nodes. Hence any kind of resource management/fair queueing should probably be done at leaf nodes and not at higher level logical nodes.
If that makes sense, then probably we don't need to control dm device and we don't need such higher level solutions.
- Any kind of 2 level scheduler solution has the potential to break the underlying IO scheduler. Higher level solution requires buffering of bios and controlled release of bios to lower layers. This control breaks the assumptions of lower layer IO scheduler which knows in what order bios should be dispatched to device to meet the semantics exported by the IO scheduler.
- 2nd level scheduler does not keep track of tasks but task groups lets every group dispatch fair share. This has got little semantic problem in the sense that tasks and groups in root cgroup will not be considered at same level. "root" will be considered one group at same level with all child group hence competing with them for resources.
This looks little odd. Considering tasks and groups same level kind of makes more sense. cpu scheduler also consideres tasks and groups at same level and deviation from that probably is not very good.
Considering tasks and groups at same level will matter only if IO scheduler maintains separate queue for the task, like CFQ. Because in that case IO scheduler tries to provide fairness among various task queues. Some schedulers like noop don't have any notion of separate task queues and fairness among them. In that case probably we don't have a choice but to assume root group competing with child groups.
Quoted 8 lines
Keeping above points in mind, probably two level scheduling is not a very good idea. If putting the code in a particular IO scheduler is a concern we can probably explore ways regarding how we can maximize the sharing of cgroup code among IO schedulers.
Thanks
VivekIt seems that we have a solution if we can figure out a way to share cgroup code between different schedulers. I am thinking how other schedulers (AS, Deadline, No-op) would use cgroups. Will they have proportional division between requests from different cgroups? And use their own policy (e.g deadline scheduling) within a cgroup? How about if we have both threads and cgroups at a particular level? I think putting all threads in a default cgroup seems like a reasonable choice in this case.
Quoted 8 lines
Here is a high level design that comes to mind.
Put proportional division code and state in common code. Each level of the hierarchy which has more than one cgroup would have some state maintained in common code. At leaf level of hiearchy, we can have a cgroup specific scheduler (created when a cgroup is created). We can choose a different scheduler for each cgroup (we can have a no-op for one cgroup while cfq for another).
I am not sure that I understand the different scheduler for each cgroup aspect of it. What's the need? It makes things even more complicated I think.
But moving proportional division code out of particular scheduler and make it common makes sense.
Looking at BFQ, I was thinking that we can just keep large part of the code. This common code can think of everything as scheduling entity. This scheduling entity (SE) will be defined by underlying scheduler depending on how queue management is done by underlying scheduler. So for CFQ, at each level, an SE can be either task or group. For the schedulers which don't maintain separate queues for tasks, it will simply be group at all levels.
We probably can employ B-WFQ2+ to provide hierarchical fairness between secheduling entities of this tree. Common layer will do the scheduling of entities (without knowing what is contained inside) and underlying scheduler will take care of dispatching the requests from the scheduled entity. (It could be a task queue for CFQ or a group queue for other schedulers).
The tricky part would be how to abstract it in a clean way. It should lead to reduced code in CFQ/BFQ because B-WFQ2+ logic will be put into a common layer (for large part).
Quoted 10 lines
The scheduler gets a callback (just like it does right now from driver) when the common code schedules a time slice (or budget) from that cgroup. No buffering/queuing is done in the common code, so it will still be a single level scheduler. When a request arrives, it is routed to its scheduler's queues based on its cgroup.
The common code proportional scheduler uses specified weights to schedule time slices. Please let me know if it makes any sense. And then we can start talking about lower level details.
We can use either time slices or budgets (may be configurable) depending on which gives better results.
Thanks
Vivek
Quoted 180 lines · Nauman Rafique
Quoted 161 lines · Vivek Goyal
Quoted 113 lines · Jens Axboe
Quoted 104 lines · Divyesh Shah
Quoted 90 lines · Jens Axboe
Quoted 57 lines · Nauman Rafique
Quoted 56 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.Quoted 7 lines
Quoted 4 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
Yep, at least that is my preference.
Quoted 22 lines
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.Jens, what is your opinion everything beyond (1) in the above list?
Quoted 7 lines
Quoted 3 lines
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Sounds feasible, I'd like to see the cgroups approach get more traction. My primary concern is just that I don't want to merge it into specific IO schedulers.
Jens,
So are you saying you don't prefer cgroups based proportional IO
division solutions in the IO scheduler but at a layer above so it can be shared with all IO schedulers?Quoted 7 lines
If yes, then in that case, what do you think about Vivek Goyal's
patch or dm-ioband that achieve that. Of course, both solutions don't meet all the requirements in the list above, but we can work on that once we know which direction we should be heading in. In fact, it would help if you could express the reservations (if you have any) about these approaches. That would help in coming up with a plan that everyone agrees on.Quoted 6 lines
The dm approach has some merrits, the major one being that it'll fit directly into existing setups that use dm and can be controlled with familiar tools. That is a bonus. The draw back is partially the same - it'll require dm. So it's still not a fit-all approach, unfortunately.
So I'd prefer an approach that doesn't force you to use dm.
Hi Jens,
My patches met the goal of not using the dm for every device one wants to control.
Having said that, few things come to mind.
- In what cases do we need to control the higher level logical devices like dm. It looks like real contention for resources is at leaf nodes. Hence any kind of resource management/fair queueing should probably be done at leaf nodes and not at higher level logical nodes.
If that makes sense, then probably we don't need to control dm device and we don't need such higher level solutions.
- Any kind of 2 level scheduler solution has the potential to break the underlying IO scheduler. Higher level solution requires buffering of bios and controlled release of bios to lower layers. This control breaks the assumptions of lower layer IO scheduler which knows in what order bios should be dispatched to device to meet the semantics exported by the IO scheduler.
- 2nd level scheduler does not keep track of tasks but task groups lets every group dispatch fair share. This has got little semantic problem in the sense that tasks and groups in root cgroup will not be considered at same level. "root" will be considered one group at same level with all child group hence competing with them for resources.
This looks little odd. Considering tasks and groups same level kind of makes more sense. cpu scheduler also consideres tasks and groups at same level and deviation from that probably is not very good.
Considering tasks and groups at same level will matter only if IO scheduler maintains separate queue for the task, like CFQ. Because in that case IO scheduler tries to provide fairness among various task queues. Some schedulers like noop don't have any notion of separate task queues and fairness among them. In that case probably we don't have a choice but to assume root group competing with child groups.
Quoted 8 lines
Keeping above points in mind, probably two level scheduling is not a very good idea. If putting the code in a particular IO scheduler is a concern we can probably explore ways regarding how we can maximize the sharing of cgroup code among IO schedulers.
Thanks
VivekIt seems that we have a solution if we can figure out a way to share cgroup code between different schedulers. I am thinking how other schedulers (AS, Deadline, No-op) would use cgroups. Will they have proportional division between requests from different cgroups? And use their own policy (e.g deadline scheduling) within a cgroup? How about if we have both threads and cgroups at a particular level? I think putting all threads in a default cgroup seems like a reasonable choice in this case.
Quoted 8 lines
Here is a high level design that comes to mind.
Put proportional division code and state in common code. Each level of the hierarchy which has more than one cgroup would have some state maintained in common code. At leaf level of hiearchy, we can have a cgroup specific scheduler (created when a cgroup is created). We can choose a different scheduler for each cgroup (we can have a no-op for one cgroup while cfq for another).
I am not sure that I understand the different scheduler for each cgroup aspect of it. What's the need? It makes things even more complicated I think.
But moving proportional division code out of particular scheduler and make it common makes sense.
Looking at BFQ, I was thinking that we can just keep large part of the code. This common code can think of everything as scheduling entity. This scheduling entity (SE) will be defined by underlying scheduler depending on how queue management is done by underlying scheduler. So for CFQ, at each level, an SE can be either task or group. For the schedulers which don't maintain separate queues for tasks, it will simply be group at all levels.
We probably can employ B-WFQ2+ to provide hierarchical fairness between secheduling entities of this tree. Common layer will do the scheduling of entities (without knowing what is contained inside) and underlying scheduler will take care of dispatching the requests from the scheduled entity. (It could be a task queue for CFQ or a group queue for other schedulers).
The tricky part would be how to abstract it in a clean way. It should lead to reduced code in CFQ/BFQ because B-WFQ2+ logic will be put into a common layer (for large part).
Quoted 10 lines
The scheduler gets a callback (just like it does right now from driver) when the common code schedules a time slice (or budget) from that cgroup. No buffering/queuing is done in the common code, so it will still be a single level scheduler. When a request arrives, it is routed to its scheduler's queues based on its cgroup.
The common code proportional scheduler uses specified weights to schedule time slices. Please let me know if it makes any sense. And then we can start talking about lower level details.
We can use either time slices or budgets (may be configurable) depending on which gives better results.
Thanks
Vivek
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 190 lines · Vivek Goyal
Quoted 180 lines · Nauman Rafique
Quoted 161 lines · Vivek Goyal
Quoted 113 lines · Jens Axboe
Quoted 104 lines · Divyesh Shah
Quoted 90 lines · Jens Axboe
Quoted 57 lines · Nauman Rafique
Quoted 56 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.Quoted 7 lines
Quoted 4 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
Yep, at least that is my preference.
Quoted 22 lines
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.Jens, what is your opinion everything beyond (1) in the above list?
Quoted 7 lines
Quoted 3 lines
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Sounds feasible, I'd like to see the cgroups approach get more traction. My primary concern is just that I don't want to merge it into specific IO schedulers.
Jens,
So are you saying you don't prefer cgroups based proportional IO
division solutions in the IO scheduler but at a layer above so it can be shared with all IO schedulers?Quoted 7 lines
If yes, then in that case, what do you think about Vivek Goyal's
patch or dm-ioband that achieve that. Of course, both solutions don't meet all the requirements in the list above, but we can work on that once we know which direction we should be heading in. In fact, it would help if you could express the reservations (if you have any) about these approaches. That would help in coming up with a plan that everyone agrees on.Quoted 6 lines
The dm approach has some merrits, the major one being that it'll fit directly into existing setups that use dm and can be controlled with familiar tools. That is a bonus. The draw back is partially the same - it'll require dm. So it's still not a fit-all approach, unfortunately.
So I'd prefer an approach that doesn't force you to use dm.
Hi Jens,
My patches met the goal of not using the dm for every device one wants to control.
Having said that, few things come to mind.
- In what cases do we need to control the higher level logical devices like dm. It looks like real contention for resources is at leaf nodes. Hence any kind of resource management/fair queueing should probably be done at leaf nodes and not at higher level logical nodes.
If that makes sense, then probably we don't need to control dm device and we don't need such higher level solutions.
- Any kind of 2 level scheduler solution has the potential to break the underlying IO scheduler. Higher level solution requires buffering of bios and controlled release of bios to lower layers. This control breaks the assumptions of lower layer IO scheduler which knows in what order bios should be dispatched to device to meet the semantics exported by the IO scheduler.
- 2nd level scheduler does not keep track of tasks but task groups lets every group dispatch fair share. This has got little semantic problem in the sense that tasks and groups in root cgroup will not be considered at same level. "root" will be considered one group at same level with all child group hence competing with them for resources.
This looks little odd. Considering tasks and groups same level kind of makes more sense. cpu scheduler also consideres tasks and groups at same level and deviation from that probably is not very good.
Considering tasks and groups at same level will matter only if IO scheduler maintains separate queue for the task, like CFQ. Because in that case IO scheduler tries to provide fairness among various task queues. Some schedulers like noop don't have any notion of separate task queues and fairness among them. In that case probably we don't have a choice but to assume root group competing with child groups.
Quoted 8 lines
Keeping above points in mind, probably two level scheduling is not a very good idea. If putting the code in a particular IO scheduler is a concern we can probably explore ways regarding how we can maximize the sharing of cgroup code among IO schedulers.
Thanks
VivekIt seems that we have a solution if we can figure out a way to share cgroup code between different schedulers. I am thinking how other schedulers (AS, Deadline, No-op) would use cgroups. Will they have proportional division between requests from different cgroups? And use their own policy (e.g deadline scheduling) within a cgroup? How about if we have both threads and cgroups at a particular level? I think putting all threads in a default cgroup seems like a reasonable choice in this case.
Quoted 8 lines
Here is a high level design that comes to mind.
Put proportional division code and state in common code. Each level of the hierarchy which has more than one cgroup would have some state maintained in common code. At leaf level of hiearchy, we can have a cgroup specific scheduler (created when a cgroup is created). We can choose a different scheduler for each cgroup (we can have a no-op for one cgroup while cfq for another).
Quoted 3 lines
I am not sure that I understand the different scheduler for each cgroup aspect of it. What's the need? It makes things even more complicated I think.
With the design I had in my mind, it seemed like that would come for free. But if it does not, I completely agree with you that its not as important.
Quoted 11 lines
But moving proportional division code out of particular scheduler and make it common makes sense.
Looking at BFQ, I was thinking that we can just keep large part of the code. This common code can think of everything as scheduling entity. This scheduling entity (SE) will be defined by underlying scheduler depending on how queue management is done by underlying scheduler. So for CFQ, at each level, an SE can be either task or group. For the schedulers which don't maintain separate queues for tasks, it will simply be group at all levels.
So the structure of hierarchy would be dependent on the underlying scheduler?
Quoted 10 lines
We probably can employ B-WFQ2+ to provide hierarchical fairness between secheduling entities of this tree. Common layer will do the scheduling of entities (without knowing what is contained inside) and underlying scheduler will take care of dispatching the requests from the scheduled entity. (It could be a task queue for CFQ or a group queue for other schedulers).
The tricky part would be how to abstract it in a clean way. It should lead to reduced code in CFQ/BFQ because B-WFQ2+ logic will be put into a common layer (for large part).
How about this plan:
1 Start with CFQ patched with some BFQ like patches (This is what we will have if Jens takes some of Fabio's patches). This will have no cgroup related logic (correct me if I am wrong).
2 Repeat proportional scheduling logic for cgroups in the common layer, without touching the code produced in step 1. That means that we will have WF2Q+ used for scheduling cgroup time slices proportional to weight in the common code. If CFQ (step 1 output) is used as scheduler, WF2Q+ would be used there too, but to schedule time slices (in proportion to priorities?) between different threads. Common code logic will be completely oblivious of the actual scheduler used (patched CFQ, Deadline, AS etc).
cgroup tracking has to be implemented as part of step 2. The good thing is that step 2 can proceed independent of step 1, as the output of step 1 will have the same interface as the existing CFQ scheduler.
Quoted 18 lines
Quoted 11 lines
The scheduler gets a callback (just like it does right now from driver) when the common code schedules a time slice (or budget) from that cgroup. No buffering/queuing is done in the common code, so it will still be a single level scheduler. When a request arrives, it is routed to its scheduler's queues based on its cgroup.
The common code proportional scheduler uses specified weights to schedule time slices. Please let me know if it makes any sense. And then we can start talking about lower level details.
We can use either time slices or budgets (may be configurable) depending on which gives better results.
Thanks
Vivek
Quoted 190 lines · Vivek Goyal
Quoted 180 lines · Nauman Rafique
Quoted 161 lines · Vivek Goyal
Quoted 113 lines · Jens Axboe
Quoted 104 lines · Divyesh Shah
Quoted 90 lines · Jens Axboe
Quoted 57 lines · Nauman Rafique
Quoted 56 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.Quoted 7 lines
Quoted 4 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
Yep, at least that is my preference.
Quoted 22 lines
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.Jens, what is your opinion everything beyond (1) in the above list?
Quoted 7 lines
Quoted 3 lines
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Sounds feasible, I'd like to see the cgroups approach get more traction. My primary concern is just that I don't want to merge it into specific IO schedulers.
Jens,
So are you saying you don't prefer cgroups based proportional IO
division solutions in the IO scheduler but at a layer above so it can be shared with all IO schedulers?Quoted 7 lines
If yes, then in that case, what do you think about Vivek Goyal's
patch or dm-ioband that achieve that. Of course, both solutions don't meet all the requirements in the list above, but we can work on that once we know which direction we should be heading in. In fact, it would help if you could express the reservations (if you have any) about these approaches. That would help in coming up with a plan that everyone agrees on.Quoted 6 lines
The dm approach has some merrits, the major one being that it'll fit directly into existing setups that use dm and can be controlled with familiar tools. That is a bonus. The draw back is partially the same - it'll require dm. So it's still not a fit-all approach, unfortunately.
So I'd prefer an approach that doesn't force you to use dm.
Hi Jens,
My patches met the goal of not using the dm for every device one wants to control.
Having said that, few things come to mind.
- In what cases do we need to control the higher level logical devices like dm. It looks like real contention for resources is at leaf nodes. Hence any kind of resource management/fair queueing should probably be done at leaf nodes and not at higher level logical nodes.
If that makes sense, then probably we don't need to control dm device and we don't need such higher level solutions.
- Any kind of 2 level scheduler solution has the potential to break the underlying IO scheduler. Higher level solution requires buffering of bios and controlled release of bios to lower layers. This control breaks the assumptions of lower layer IO scheduler which knows in what order bios should be dispatched to device to meet the semantics exported by the IO scheduler.
- 2nd level scheduler does not keep track of tasks but task groups lets every group dispatch fair share. This has got little semantic problem in the sense that tasks and groups in root cgroup will not be considered at same level. "root" will be considered one group at same level with all child group hence competing with them for resources.
This looks little odd. Considering tasks and groups same level kind of makes more sense. cpu scheduler also consideres tasks and groups at same level and deviation from that probably is not very good.
Considering tasks and groups at same level will matter only if IO scheduler maintains separate queue for the task, like CFQ. Because in that case IO scheduler tries to provide fairness among various task queues. Some schedulers like noop don't have any notion of separate task queues and fairness among them. In that case probably we don't have a choice but to assume root group competing with child groups.
Quoted 8 lines
Keeping above points in mind, probably two level scheduling is not a very good idea. If putting the code in a particular IO scheduler is a concern we can probably explore ways regarding how we can maximize the sharing of cgroup code among IO schedulers.
Thanks
VivekIt seems that we have a solution if we can figure out a way to share cgroup code between different schedulers. I am thinking how other schedulers (AS, Deadline, No-op) would use cgroups. Will they have proportional division between requests from different cgroups? And use their own policy (e.g deadline scheduling) within a cgroup? How about if we have both threads and cgroups at a particular level? I think putting all threads in a default cgroup seems like a reasonable choice in this case.
Quoted 8 lines
Here is a high level design that comes to mind.
Put proportional division code and state in common code. Each level of the hierarchy which has more than one cgroup would have some state maintained in common code. At leaf level of hiearchy, we can have a cgroup specific scheduler (created when a cgroup is created). We can choose a different scheduler for each cgroup (we can have a no-op for one cgroup while cfq for another).
Quoted 3 lines
I am not sure that I understand the different scheduler for each cgroup aspect of it. What's the need? It makes things even more complicated I think.
With the design I had in my mind, it seemed like that would come for free. But if it does not, I completely agree with you that its not as important.
Quoted 11 lines
But moving proportional division code out of particular scheduler and make it common makes sense.
Looking at BFQ, I was thinking that we can just keep large part of the code. This common code can think of everything as scheduling entity. This scheduling entity (SE) will be defined by underlying scheduler depending on how queue management is done by underlying scheduler. So for CFQ, at each level, an SE can be either task or group. For the schedulers which don't maintain separate queues for tasks, it will simply be group at all levels.
So the structure of hierarchy would be dependent on the underlying scheduler?
Quoted 10 lines
We probably can employ B-WFQ2+ to provide hierarchical fairness between secheduling entities of this tree. Common layer will do the scheduling of entities (without knowing what is contained inside) and underlying scheduler will take care of dispatching the requests from the scheduled entity. (It could be a task queue for CFQ or a group queue for other schedulers).
The tricky part would be how to abstract it in a clean way. It should lead to reduced code in CFQ/BFQ because B-WFQ2+ logic will be put into a common layer (for large part).
How about this plan:
1 Start with CFQ patched with some BFQ like patches (This is what we will have if Jens takes some of Fabio's patches). This will have no cgroup related logic (correct me if I am wrong).
2 Repeat proportional scheduling logic for cgroups in the common layer, without touching the code produced in step 1. That means that we will have WF2Q+ used for scheduling cgroup time slices proportional to weight in the common code. If CFQ (step 1 output) is used as scheduler, WF2Q+ would be used there too, but to schedule time slices (in proportion to priorities?) between different threads. Common code logic will be completely oblivious of the actual scheduler used (patched CFQ, Deadline, AS etc).
cgroup tracking has to be implemented as part of step 2. The good thing is that step 2 can proceed independent of step 1, as the output of step 1 will have the same interface as the existing CFQ scheduler.
Quoted 18 lines
Quoted 11 lines
The scheduler gets a callback (just like it does right now from driver) when the common code schedules a time slice (or budget) from that cgroup. No buffering/queuing is done in the common code, so it will still be a single level scheduler. When a request arrives, it is routed to its scheduler's queues based on its cgroup.
The common code proportional scheduler uses specified weights to schedule time slices. Please let me know if it makes any sense. And then we can start talking about lower level details.
We can use either time slices or budgets (may be configurable) depending on which gives better results.
Thanks
Vivek
Quoted 190 lines · Vivek Goyal
Quoted 180 lines · Nauman Rafique
Quoted 161 lines · Vivek Goyal
Quoted 113 lines · Jens Axboe
Quoted 104 lines · Divyesh Shah
Quoted 90 lines · Jens Axboe
Quoted 57 lines · Nauman Rafique
Quoted 56 lines · Jens Axboe
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
My preferred approach here would be, in order or TODO:
- Create and test the smallish patches for seekiness,
hw_tagchecking, and so on for CFQ.
- Create and test a WF2Q+ service dispatching patch for CFQ.Quoted 7 lines
Quoted 4 lines
and if there are leftovers after that, we could even conditionally enable some of those if appropriate. I think the WF2Q+ is quite cool and could be easily usable as the default, so it's definitely a viable alternative.
1 Merge BFQ into CFQ (Jens and Fabio). I am assuming that this would result in time slices being scheduled using WF2Q+
Yep, at least that is my preference.
Quoted 22 lines
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for scheduling bandwidth among a hierarchy of cgroups
(besides threads)
3 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which can allow tracking cgroups for asynchronous reads/writes.
7 Start an offline email thread to keep track of progress on the above goals.Jens, what is your opinion everything beyond (1) in the above list?
Quoted 7 lines
Quoted 3 lines
It would be great if work on (1) and (2)-(7) can happen in parallel so that we can see "proportional division of IO bandwidth to cgroups" in tree sooner than later.
Sounds feasible, I'd like to see the cgroups approach get more traction. My primary concern is just that I don't want to merge it into specific IO schedulers.
Jens,
So are you saying you don't prefer cgroups based proportional IO
division solutions in the IO scheduler but at a layer above so it can be shared with all IO schedulers?Quoted 7 lines
If yes, then in that case, what do you think about Vivek Goyal's
patch or dm-ioband that achieve that. Of course, both solutions don't meet all the requirements in the list above, but we can work on that once we know which direction we should be heading in. In fact, it would help if you could express the reservations (if you have any) about these approaches. That would help in coming up with a plan that everyone agrees on.Quoted 6 lines
The dm approach has some merrits, the major one being that it'll fit directly into existing setups that use dm and can be controlled with familiar tools. That is a bonus. The draw back is partially the same - it'll require dm. So it's still not a fit-all approach, unfortunately.
So I'd prefer an approach that doesn't force you to use dm.
Hi Jens,
My patches met the goal of not using the dm for every device one wants to control.
Having said that, few things come to mind.
- In what cases do we need to control the higher level logical devices like dm. It looks like real contention for resources is at leaf nodes. Hence any kind of resource management/fair queueing should probably be done at leaf nodes and not at higher level logical nodes.
If that makes sense, then probably we don't need to control dm device and we don't need such higher level solutions.
- Any kind of 2 level scheduler solution has the potential to break the underlying IO scheduler. Higher level solution requires buffering of bios and controlled release of bios to lower layers. This control breaks the assumptions of lower layer IO scheduler which knows in what order bios should be dispatched to device to meet the semantics exported by the IO scheduler.
- 2nd level scheduler does not keep track of tasks but task groups lets every group dispatch fair share. This has got little semantic problem in the sense that tasks and groups in root cgroup will not be considered at same level. "root" will be considered one group at same level with all child group hence competing with them for resources.
This looks little odd. Considering tasks and groups same level kind of makes more sense. cpu scheduler also consideres tasks and groups at same level and deviation from that probably is not very good.
Considering tasks and groups at same level will matter only if IO scheduler maintains separate queue for the task, like CFQ. Because in that case IO scheduler tries to provide fairness among various task queues. Some schedulers like noop don't have any notion of separate task queues and fairness among them. In that case probably we don't have a choice but to assume root group competing with child groups.
Quoted 8 lines
Keeping above points in mind, probably two level scheduling is not a very good idea. If putting the code in a particular IO scheduler is a concern we can probably explore ways regarding how we can maximize the sharing of cgroup code among IO schedulers.
Thanks
VivekIt seems that we have a solution if we can figure out a way to share cgroup code between different schedulers. I am thinking how other schedulers (AS, Deadline, No-op) would use cgroups. Will they have proportional division between requests from different cgroups? And use their own policy (e.g deadline scheduling) within a cgroup? How about if we have both threads and cgroups at a particular level? I think putting all threads in a default cgroup seems like a reasonable choice in this case.
Quoted 8 lines
Here is a high level design that comes to mind.
Put proportional division code and state in common code. Each level of the hierarchy which has more than one cgroup would have some state maintained in common code. At leaf level of hiearchy, we can have a cgroup specific scheduler (created when a cgroup is created). We can choose a different scheduler for each cgroup (we can have a no-op for one cgroup while cfq for another).
Quoted 3 lines
I am not sure that I understand the different scheduler for each cgroup aspect of it. What's the need? It makes things even more complicated I think.
With the design I had in my mind, it seemed like that would come for free. But if it does not, I completely agree with you that its not as important.
Quoted 11 lines
But moving proportional division code out of particular scheduler and make it common makes sense.
Looking at BFQ, I was thinking that we can just keep large part of the code. This common code can think of everything as scheduling entity. This scheduling entity (SE) will be defined by underlying scheduler depending on how queue management is done by underlying scheduler. So for CFQ, at each level, an SE can be either task or group. For the schedulers which don't maintain separate queues for tasks, it will simply be group at all levels.
So the structure of hierarchy would be dependent on the underlying scheduler?
Quoted 10 lines
We probably can employ B-WFQ2+ to provide hierarchical fairness between secheduling entities of this tree. Common layer will do the scheduling of entities (without knowing what is contained inside) and underlying scheduler will take care of dispatching the requests from the scheduled entity. (It could be a task queue for CFQ or a group queue for other schedulers).
The tricky part would be how to abstract it in a clean way. It should lead to reduced code in CFQ/BFQ because B-WFQ2+ logic will be put into a common layer (for large part).
How about this plan:
1 Start with CFQ patched with some BFQ like patches (This is what we will have if Jens takes some of Fabio's patches). This will have no cgroup related logic (correct me if I am wrong).
2 Repeat proportional scheduling logic for cgroups in the common layer, without touching the code produced in step 1. That means that we will have WF2Q+ used for scheduling cgroup time slices proportional to weight in the common code. If CFQ (step 1 output) is used as scheduler, WF2Q+ would be used there too, but to schedule time slices (in proportion to priorities?) between different threads. Common code logic will be completely oblivious of the actual scheduler used (patched CFQ, Deadline, AS etc).
cgroup tracking has to be implemented as part of step 2. The good thing is that step 2 can proceed independent of step 1, as the output of step 1 will have the same interface as the existing CFQ scheduler.
Quoted 18 lines
Quoted 11 lines
The scheduler gets a callback (just like it does right now from driver) when the common code schedules a time slice (or budget) from that cgroup. No buffering/queuing is done in the common code, so it will still be a single level scheduler. When a request arrives, it is routed to its scheduler's queues based on its cgroup.
The common code proportional scheduler uses specified weights to schedule time slices. Please let me know if it makes any sense. And then we can start talking about lower level details.
We can use either time slices or budgets (may be configurable) depending on which gives better results.
Thanks
Vivek
A message that is not in the archive (sent off-list or not yet received): e98e18940811201442s787a346em4ada30bcb1badfe6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
On Thu, Nov 20, 2008 at 02:42:38PM -0800, Nauman Rafique wrote:
[..]
Quoted 38 lines
Quoted 18 lines
Quoted 9 lines
It seems that we have a solution if we can figure out a way to share cgroup code between different schedulers. I am thinking how other schedulers (AS, Deadline, No-op) would use cgroups. Will they have proportional division between requests from different cgroups? And use their own policy (e.g deadline scheduling) within a cgroup? How about if we have both threads and cgroups at a particular level? I think putting all threads in a default cgroup seems like a reasonable choice in this case.
Quoted 8 lines
Here is a high level design that comes to mind.
Put proportional division code and state in common code. Each level of the hierarchy which has more than one cgroup would have some state maintained in common code. At leaf level of hiearchy, we can have a cgroup specific scheduler (created when a cgroup is created). We can choose a different scheduler for each cgroup (we can have a no-op for one cgroup while cfq for another).
Quoted 3 lines
I am not sure that I understand the different scheduler for each cgroup aspect of it. What's the need? It makes things even more complicated I think.
With the design I had in my mind, it seemed like that would come for free. But if it does not, I completely agree with you that its not as important.
Quoted 11 lines
But moving proportional division code out of particular scheduler and make it common makes sense.
Looking at BFQ, I was thinking that we can just keep large part of the code. This common code can think of everything as scheduling entity. This scheduling entity (SE) will be defined by underlying scheduler depending on how queue management is done by underlying scheduler. So for CFQ, at each level, an SE can be either task or group. For the schedulers which don't maintain separate queues for tasks, it will simply be group at all levels.
Quoted 2 lines
So the structure of hierarchy would be dependent on the underlying scheduler?
Kind of. In fact it will depend on cgroup hierarchy and dependent on underlying scheduler.
Quoted 11 lines
Quoted 10 lines
We probably can employ B-WFQ2+ to provide hierarchical fairness between secheduling entities of this tree. Common layer will do the scheduling of entities (without knowing what is contained inside) and underlying scheduler will take care of dispatching the requests from the scheduled entity. (It could be a task queue for CFQ or a group queue for other schedulers).
The tricky part would be how to abstract it in a clean way. It should lead to reduced code in CFQ/BFQ because B-WFQ2+ logic will be put into a common layer (for large part).
Quoted 12 lines
How about this plan:
1 Start with CFQ patched with some BFQ like patches (This is what we will have if Jens takes some of Fabio's patches). This will have no cgroup related logic (correct me if I am wrong).
2 Repeat proportional scheduling logic for cgroups in the common layer, without touching the code produced in step 1. That means that we will have WF2Q+ used for scheduling cgroup time slices proportional to weight in the common code. If CFQ (step 1 output) is used as scheduler, WF2Q+ would be used there too, but to schedule time slices (in proportion to priorities?) between different threads. Common code logic will be completely oblivious of the actual scheduler used (patched CFQ, Deadline, AS etc).
I think once you start using WF2Q+ in common layer, CFQ will have to get rid of that code. (Remember in case of CFQ, we will have a tree which has got both task and groups as Scheduling Entity). So common layer code can select the next entity to be dispatched base on WFQ2+ and then CFQ will decide which request to dispatch with-in that scheduling entity.
So may be we can start with bfq and try to break the code in two pieces. One common code and one scheduler specific code. Then try to make use of common code in deadline or anticipatory to see if things work fine. If, that works, then we can get to CFQ to make use of common code. By that time CFQ should have Fabio's changes. I think that will include WF2Q+ algorithm also (At least to provide faireness among taks, and not the hierarchical thing). Once common layer WF2Q+ works well, we can get rid of WF2Q+ from CFQ and try to complete the picture.
Quoted 4 lines
cgroup tracking has to be implemented as part of step 2. The good thing is that step 2 can proceed independent of step 1, as the output of step 1 will have the same interface as the existing CFQ scheduler.
Agreed. any kind of tracking based on bio and not the task context shall have to be done later, once we have come up with common layer code.
These are very vague high level ideas. Devil lies in details. :-) I will get started to see how feasible the common layer code idea is.
Thanks
Vivek
On Thu, Nov 20, 2008 at 02:42:38PM -0800, Nauman Rafique wrote:
[..]
Quoted 38 lines
Quoted 18 lines
Quoted 9 lines
It seems that we have a solution if we can figure out a way to share cgroup code between different schedulers. I am thinking how other schedulers (AS, Deadline, No-op) would use cgroups. Will they have proportional division between requests from different cgroups? And use their own policy (e.g deadline scheduling) within a cgroup? How about if we have both threads and cgroups at a particular level? I think putting all threads in a default cgroup seems like a reasonable choice in this case.
Quoted 8 lines
Here is a high level design that comes to mind.
Put proportional division code and state in common code. Each level of the hierarchy which has more than one cgroup would have some state maintained in common code. At leaf level of hiearchy, we can have a cgroup specific scheduler (created when a cgroup is created). We can choose a different scheduler for each cgroup (we can have a no-op for one cgroup while cfq for another).
Quoted 3 lines
I am not sure that I understand the different scheduler for each cgroup aspect of it. What's the need? It makes things even more complicated I think.
With the design I had in my mind, it seemed like that would come for free. But if it does not, I completely agree with you that its not as important.
Quoted 11 lines
But moving proportional division code out of particular scheduler and make it common makes sense.
Looking at BFQ, I was thinking that we can just keep large part of the code. This common code can think of everything as scheduling entity. This scheduling entity (SE) will be defined by underlying scheduler depending on how queue management is done by underlying scheduler. So for CFQ, at each level, an SE can be either task or group. For the schedulers which don't maintain separate queues for tasks, it will simply be group at all levels.
Quoted 2 lines
So the structure of hierarchy would be dependent on the underlying scheduler?
Kind of. In fact it will depend on cgroup hierarchy and dependent on underlying scheduler.
Quoted 11 lines
Quoted 10 lines
We probably can employ B-WFQ2+ to provide hierarchical fairness between secheduling entities of this tree. Common layer will do the scheduling of entities (without knowing what is contained inside) and underlying scheduler will take care of dispatching the requests from the scheduled entity. (It could be a task queue for CFQ or a group queue for other schedulers).
The tricky part would be how to abstract it in a clean way. It should lead to reduced code in CFQ/BFQ because B-WFQ2+ logic will be put into a common layer (for large part).
Quoted 12 lines
How about this plan:
1 Start with CFQ patched with some BFQ like patches (This is what we will have if Jens takes some of Fabio's patches). This will have no cgroup related logic (correct me if I am wrong).
2 Repeat proportional scheduling logic for cgroups in the common layer, without touching the code produced in step 1. That means that we will have WF2Q+ used for scheduling cgroup time slices proportional to weight in the common code. If CFQ (step 1 output) is used as scheduler, WF2Q+ would be used there too, but to schedule time slices (in proportion to priorities?) between different threads. Common code logic will be completely oblivious of the actual scheduler used (patched CFQ, Deadline, AS etc).
I think once you start using WF2Q+ in common layer, CFQ will have to get rid of that code. (Remember in case of CFQ, we will have a tree which has got both task and groups as Scheduling Entity). So common layer code can select the next entity to be dispatched base on WFQ2+ and then CFQ will decide which request to dispatch with-in that scheduling entity.
So may be we can start with bfq and try to break the code in two pieces. One common code and one scheduler specific code. Then try to make use of common code in deadline or anticipatory to see if things work fine. If, that works, then we can get to CFQ to make use of common code. By that time CFQ should have Fabio's changes. I think that will include WF2Q+ algorithm also (At least to provide faireness among taks, and not the hierarchical thing). Once common layer WF2Q+ works well, we can get rid of WF2Q+ from CFQ and try to complete the picture.
Quoted 4 lines
cgroup tracking has to be implemented as part of step 2. The good thing is that step 2 can proceed independent of step 1, as the output of step 1 will have the same interface as the existing CFQ scheduler.
Agreed. any kind of tracking based on bio and not the task context shall have to be done later, once we have come up with common layer code.
These are very vague high level ideas. Devil lies in details. :-) I will get started to see how feasible the common layer code idea is.
Thanks
Vivek
On Thu, Nov 20, 2008 at 02:42:38PM -0800, Nauman Rafique wrote:
[..]
Quoted 38 lines
Quoted 18 lines
Quoted 9 lines
It seems that we have a solution if we can figure out a way to share cgroup code between different schedulers. I am thinking how other schedulers (AS, Deadline, No-op) would use cgroups. Will they have proportional division between requests from different cgroups? And use their own policy (e.g deadline scheduling) within a cgroup? How about if we have both threads and cgroups at a particular level? I think putting all threads in a default cgroup seems like a reasonable choice in this case.
Quoted 8 lines
Here is a high level design that comes to mind.
Put proportional division code and state in common code. Each level of the hierarchy which has more than one cgroup would have some state maintained in common code. At leaf level of hiearchy, we can have a cgroup specific scheduler (created when a cgroup is created). We can choose a different scheduler for each cgroup (we can have a no-op for one cgroup while cfq for another).
Quoted 3 lines
I am not sure that I understand the different scheduler for each cgroup aspect of it. What's the need? It makes things even more complicated I think.
With the design I had in my mind, it seemed like that would come for free. But if it does not, I completely agree with you that its not as important.
Quoted 11 lines
But moving proportional division code out of particular scheduler and make it common makes sense.
Looking at BFQ, I was thinking that we can just keep large part of the code. This common code can think of everything as scheduling entity. This scheduling entity (SE) will be defined by underlying scheduler depending on how queue management is done by underlying scheduler. So for CFQ, at each level, an SE can be either task or group. For the schedulers which don't maintain separate queues for tasks, it will simply be group at all levels.
Quoted 2 lines
So the structure of hierarchy would be dependent on the underlying scheduler?
Kind of. In fact it will depend on cgroup hierarchy and dependent on underlying scheduler.
Quoted 11 lines
Quoted 10 lines
We probably can employ B-WFQ2+ to provide hierarchical fairness between secheduling entities of this tree. Common layer will do the scheduling of entities (without knowing what is contained inside) and underlying scheduler will take care of dispatching the requests from the scheduled entity. (It could be a task queue for CFQ or a group queue for other schedulers).
The tricky part would be how to abstract it in a clean way. It should lead to reduced code in CFQ/BFQ because B-WFQ2+ logic will be put into a common layer (for large part).
Quoted 12 lines
How about this plan:
1 Start with CFQ patched with some BFQ like patches (This is what we will have if Jens takes some of Fabio's patches). This will have no cgroup related logic (correct me if I am wrong).
2 Repeat proportional scheduling logic for cgroups in the common layer, without touching the code produced in step 1. That means that we will have WF2Q+ used for scheduling cgroup time slices proportional to weight in the common code. If CFQ (step 1 output) is used as scheduler, WF2Q+ would be used there too, but to schedule time slices (in proportion to priorities?) between different threads. Common code logic will be completely oblivious of the actual scheduler used (patched CFQ, Deadline, AS etc).
I think once you start using WF2Q+ in common layer, CFQ will have to get rid of that code. (Remember in case of CFQ, we will have a tree which has got both task and groups as Scheduling Entity). So common layer code can select the next entity to be dispatched base on WFQ2+ and then CFQ will decide which request to dispatch with-in that scheduling entity.
So may be we can start with bfq and try to break the code in two pieces. One common code and one scheduler specific code. Then try to make use of common code in deadline or anticipatory to see if things work fine. If, that works, then we can get to CFQ to make use of common code. By that time CFQ should have Fabio's changes. I think that will include WF2Q+ algorithm also (At least to provide faireness among taks, and not the hierarchical thing). Once common layer WF2Q+ works well, we can get rid of WF2Q+ from CFQ and try to complete the picture.
Quoted 4 lines
cgroup tracking has to be implemented as part of step 2. The good thing is that step 2 can proceed independent of step 1, as the output of step 1 will have the same interface as the existing CFQ scheduler.
Agreed. any kind of tracking based on bio and not the task context shall have to be done later, once we have come up with common layer code.
These are very vague high level ideas. Devil lies in details. :-) I will get started to see how feasible the common layer code idea is.
Thanks
Vivek
Quoted 12 lines · Vivek Goyal
Quoted 6 lines
The dm approach has some merrits, the major one being that it'll fit directly into existing setups that use dm and can be controlled with familiar tools. That is a bonus. The draw back is partially the same - it'll require dm. So it's still not a fit-all approach, unfortunately.
So I'd prefer an approach that doesn't force you to use dm.
Hi Jens,
My patches met the goal of not using the dm for every device one wants to control.
Quoted 6 lines
Having said that, few things come to mind.
- In what cases do we need to control the higher level logical devices like dm. It looks like real contention for resources is at leaf nodes. Hence any kind of resource management/fair queueing should probably be done at leaf nodes and not at higher level logical nodes.
The problem with stacking devices is that we do not know how the IO going through the leaf nodes contributes to the aggregate throughput seen by the application/cgroup that generated it, which is what end users care about.
The block device could be a plain old sata device, a loop device, a stacking device, a SSD, you name it, but their topologies and the fact that some of them do not even use an elevator should be transparent to the user.
If you wanted to do resource management at the leaf nodes some kind of topology information should be passed down to the elevators controlling the underlying devices, which in turn would need to work cooperatively.
Quoted 2 lines
If that makes sense, then probably we don't need to control dm device and we don't need such higher level solutions.
For the reasons stated above the two level scheduling approach seems cleaner to me.
Quoted 6 lines
- Any kind of 2 level scheduler solution has the potential to break the underlying IO scheduler. Higher level solution requires buffering of bios and controlled release of bios to lower layers. This control breaks the assumptions of lower layer IO scheduler which knows in what order bios should be dispatched to device to meet the semantics exported by the IO scheduler.
Please notice that the such an IO controller would only get in the way of the elevator in case of contention for the device. What is more, depending on the workload it turns out that buffering at higher layers in a per-cgroup or per-task basis, like dm-band does, may actually increase the aggregate throughput (I think that the dm-band team observed this behavior too). The reason seems to be that bios buffered in such way tend to be highly correlated and thus very likely to get merged when released to the elevator.
Quoted 10 lines
- 2nd level scheduler does not keep track of tasks but task groups lets every group dispatch fair share. This has got little semantic problem in the sense that tasks and groups in root cgroup will not be considered at same level. "root" will be considered one group at same level with all child group hence competing with them for resources.
This looks little odd. Considering tasks and groups same level kind of makes more sense. cpu scheduler also consideres tasks and groups at same level and deviation from that probably is not very good.
Quoted 6 lines
Considering tasks and groups at same level will matter only if IO scheduler maintains separate queue for the task, like CFQ. Because in that case IO scheduler tries to provide fairness among various task queues. Some schedulers like noop don't have any notion of separate task queues and fairness among them. In that case probably we don't have a choice but to assume root group competing with child groups.
If deemed necessary this case could be handled too, but it does not look like a show-stopper.
Quoted 4 lines
Keeping above points in mind, probably two level scheduling is not a very good idea. If putting the code in a particular IO scheduler is a concern we can probably explore ways regarding how we can maximize the sharing of cgroup code among IO schedulers.
As discussed above, I still think that the two level scheduling approach makes more sense. Regarding the sharing of cgroup code among IO schedulers I am all for it. If we consider that elevators should only care about maximizing usage of the underlying devices, implementing other non-hardware-dependent scheduling disciplines (that prioritize according to the task or cgroup that generated the IO, for example) at higher layers so that we can reuse code makes a lot of sense.
Thanks,
Fernando
Quoted 12 lines · Vivek Goyal
Quoted 6 lines
The dm approach has some merrits, the major one being that it'll fit directly into existing setups that use dm and can be controlled with familiar tools. That is a bonus. The draw back is partially the same - it'll require dm. So it's still not a fit-all approach, unfortunately.
So I'd prefer an approach that doesn't force you to use dm.
Hi Jens,
My patches met the goal of not using the dm for every device one wants to control.
Quoted 6 lines
Having said that, few things come to mind.
- In what cases do we need to control the higher level logical devices like dm. It looks like real contention for resources is at leaf nodes. Hence any kind of resource management/fair queueing should probably be done at leaf nodes and not at higher level logical nodes.
The problem with stacking devices is that we do not know how the IO going through the leaf nodes contributes to the aggregate throughput seen by the application/cgroup that generated it, which is what end users care about.
The block device could be a plain old sata device, a loop device, a stacking device, a SSD, you name it, but their topologies and the fact that some of them do not even use an elevator should be transparent to the user.
If you wanted to do resource management at the leaf nodes some kind of topology information should be passed down to the elevators controlling the underlying devices, which in turn would need to work cooperatively.
Quoted 2 lines
If that makes sense, then probably we don't need to control dm device and we don't need such higher level solutions.
For the reasons stated above the two level scheduling approach seems cleaner to me.
Quoted 6 lines
- Any kind of 2 level scheduler solution has the potential to break the underlying IO scheduler. Higher level solution requires buffering of bios and controlled release of bios to lower layers. This control breaks the assumptions of lower layer IO scheduler which knows in what order bios should be dispatched to device to meet the semantics exported by the IO scheduler.
Please notice that the such an IO controller would only get in the way of the elevator in case of contention for the device. What is more, depending on the workload it turns out that buffering at higher layers in a per-cgroup or per-task basis, like dm-band does, may actually increase the aggregate throughput (I think that the dm-band team observed this behavior too). The reason seems to be that bios buffered in such way tend to be highly correlated and thus very likely to get merged when released to the elevator.
Quoted 10 lines
- 2nd level scheduler does not keep track of tasks but task groups lets every group dispatch fair share. This has got little semantic problem in the sense that tasks and groups in root cgroup will not be considered at same level. "root" will be considered one group at same level with all child group hence competing with them for resources.
This looks little odd. Considering tasks and groups same level kind of makes more sense. cpu scheduler also consideres tasks and groups at same level and deviation from that probably is not very good.
Quoted 6 lines
Considering tasks and groups at same level will matter only if IO scheduler maintains separate queue for the task, like CFQ. Because in that case IO scheduler tries to provide fairness among various task queues. Some schedulers like noop don't have any notion of separate task queues and fairness among them. In that case probably we don't have a choice but to assume root group competing with child groups.
If deemed necessary this case could be handled too, but it does not look like a show-stopper.
Quoted 4 lines
Keeping above points in mind, probably two level scheduling is not a very good idea. If putting the code in a particular IO scheduler is a concern we can probably explore ways regarding how we can maximize the sharing of cgroup code among IO schedulers.
As discussed above, I still think that the two level scheduling approach makes more sense. Regarding the sharing of cgroup code among IO schedulers I am all for it. If we consider that elevators should only care about maximizing usage of the underlying devices, implementing other non-hardware-dependent scheduling disciplines (that prioritize according to the task or cgroup that generated the IO, for example) at higher layers so that we can reuse code makes a lot of sense.
Thanks,
Fernando
A message that is not in the archive (sent off-list or not yet received): 1227681618.12997.163.camel-xpvPi5bcW5X5OjGIXfuPlhrrLbDL3r4M6qtp775pBPw@public.gmane.org
Quoted 20 lines · Fernando Luis Vázquez Cao
Quoted 12 lines · Vivek Goyal
Quoted 6 lines
The dm approach has some merrits, the major one being that it'll fit directly into existing setups that use dm and can be controlled with familiar tools. That is a bonus. The draw back is partially the same - it'll require dm. So it's still not a fit-all approach, unfortunately.
So I'd prefer an approach that doesn't force you to use dm.
Hi Jens,
My patches met the goal of not using the dm for every device one wants to control.
Quoted 6 lines
Having said that, few things come to mind.
- In what cases do we need to control the higher level logical devices like dm. It looks like real contention for resources is at leaf nodes. Hence any kind of resource management/fair queueing should probably be done at leaf nodes and not at higher level logical nodes.
Quoted 5 lines
The problem with stacking devices is that we do not know how the IO going through the leaf nodes contributes to the aggregate throughput seen by the application/cgroup that generated it, which is what end users care about.
If we keep track of cgroup information in bio and don't loose it while bio traverses through the stack of devices, then leaf node can still do the proportional fair share allocation among contending cgroups on that device.
I think end users care about getting fair share if there is a contention anywhere along the IO path. Real contention is at leaf nodes. However complex the logical device topology is, if two applications are not contending for disk at lowest level, there is no point in doing any kind of resource management among them. Though the applications seemingly might be contending for higher level logical device, at leaf nodes, their IOs might be going to different disk altogether and practically there is no contention.
Quoted 4 lines
The block device could be a plain old sata device, a loop device, a stacking device, a SSD, you name it, but their topologies and the fact that some of them do not even use an elevator should be transparent to the user.
Are there some devices which don't use elevators at leaf nodes? If no, then its not a issue.
Quoted 5 lines
If you wanted to do resource management at the leaf nodes some kind of topology information should be passed down to the elevators controlling the underlying devices, which in turn would need to work cooperatively.
I am not able to understand why some kind of topology information needs to be passed to underlying elevators. As long as end device can map a bio correctly to the right cgroup (irrespective of complex topology) and end device step into resource management only if there is contention for resources among cgroups on that device, things are fine. We don't have to worry about intermediate complex topology.
I will take one hypothetical example. Lets assume there are two cgroups A and B with weights 2048 and 1024 respectively. To me this information means that if A, and B really conted for the resources somewhere, then make sure A gets 2/3 of resources and B gets 1/3 of resource.
Now if tasks in these two groups happen to contend for same disk at lowest level, we do resource management otherwise we don't. Why do I need to worry about intermediate logical devices in the IO path?
May be I am missing something. A detailed example will help here...
Quoted 13 lines
Quoted 2 lines
If that makes sense, then probably we don't need to control dm device and we don't need such higher level solutions.
For the reasons stated above the two level scheduling approach seems cleaner to me.
Quoted 6 lines
- Any kind of 2 level scheduler solution has the potential to break the underlying IO scheduler. Higher level solution requires buffering of bios and controlled release of bios to lower layers. This control breaks the assumptions of lower layer IO scheduler which knows in what order bios should be dispatched to device to meet the semantics exported by the IO scheduler.
Quoted 2 lines
Please notice that the such an IO controller would only get in the way of the elevator in case of contention for the device.
True. So are we saying that a user can get expected CFQ or AS behavior only if there is no contention. If there is contention, then we don't gurantee anything?
Quoted 7 lines
What is more,
depending on the workload it turns out that buffering at higher layers in a per-cgroup or per-task basis, like dm-band does, may actually increase the aggregate throughput (I think that the dm-band team observed this behavior too). The reason seems to be that bios buffered in such way tend to be highly correlated and thus very likely to get merged when released to the elevator.
The goal here is not to increase throughput by doing buffering at higher layer. This is what IO scheduler currently does. It tries to buffer bios and select these appropriately to boost throughput. If one needs to focus on increasing throughput, it should be done at IO scheduler level and not by introducing one more buffering layer in between.
Quoted 18 lines
Quoted 11 lines
- 2nd level scheduler does not keep track of tasks but task groups lets every group dispatch fair share. This has got little semantic problem in the sense that tasks and groups in root cgroup will not be considered at same level. "root" will be considered one group at same level with all child group hence competing with them for resources.
This looks little odd. Considering tasks and groups same level kind of makes more sense. cpu scheduler also consideres tasks and groups at same level and deviation from that probably is not very good.
Quoted 6 lines
Considering tasks and groups at same level will matter only if IO scheduler maintains separate queue for the task, like CFQ. Because in that case IO scheduler tries to provide fairness among various task queues. Some schedulers like noop don't have any notion of separate task queues and fairness among them. In that case probably we don't have a choice but to assume root group competing with child groups.
Quoted 3 lines
If deemed necessary this case could be handled too, but it does not look like a show-stopper.
It is not a show stopper for sure. But it can be a genuine concern in case of CFQ atleast which tries to provide fairness among tasks.
Think of following scenario. (Diagram taken from peterz's mail).
root / | \ 1 2 A / \ B 3
Assume that task 1, task 2 and group A belong to Best effort class and they all have the same priority. If we go for two level scheduling than, disk BW will be divided in the ratio of 25%, 25% and 50% between task 1, task 2 and group A.
I think it should instead be 33% each. Again coming back to the idea of treating 1, 2 and A at same level.
So this is not a show stopper but once you go for one approach, swithing to another will become really hard as it might require close interatction with underlying scheduler and fundamentally 2 level scheduler will find it very hard to communicate with IO scheduler.
Quoted 7 lines
Quoted 4 lines
Keeping above points in mind, probably two level scheduling is not a very good idea. If putting the code in a particular IO scheduler is a concern we can probably explore ways regarding how we can maximize the sharing of cgroup code among IO schedulers.
As discussed above, I still think that the two level scheduling approach makes more sense.
IMHO, two level scheduling approach makes a case only if resource management at leaf nodes does not solve the requirements. So far we have not got a concrete example where resource management at intermediate logical devices is needed and resource management at leaf nodes is not sufficient.
Thanks
Vivek
Quoted 10 lines
Regarding the sharing of cgroup code among IO
schedulers I am all for it. If we consider that elevators should only care about maximizing usage of the underlying devices, implementing other non-hardware-dependent scheduling disciplines (that prioritize according to the task or cgroup that generated the IO, for example) at higher layers so that we can reuse code makes a lot of sense.Thanks,
Fernando
Quoted 20 lines · Fernando Luis Vázquez Cao
Quoted 12 lines · Vivek Goyal
Quoted 6 lines
The dm approach has some merrits, the major one being that it'll fit directly into existing setups that use dm and can be controlled with familiar tools. That is a bonus. The draw back is partially the same - it'll require dm. So it's still not a fit-all approach, unfortunately.
So I'd prefer an approach that doesn't force you to use dm.
Hi Jens,
My patches met the goal of not using the dm for every device one wants to control.
Quoted 6 lines
Having said that, few things come to mind.
- In what cases do we need to control the higher level logical devices like dm. It looks like real contention for resources is at leaf nodes. Hence any kind of resource management/fair queueing should probably be done at leaf nodes and not at higher level logical nodes.
Quoted 5 lines
The problem with stacking devices is that we do not know how the IO going through the leaf nodes contributes to the aggregate throughput seen by the application/cgroup that generated it, which is what end users care about.
If we keep track of cgroup information in bio and don't loose it while bio traverses through the stack of devices, then leaf node can still do the proportional fair share allocation among contending cgroups on that device.
I think end users care about getting fair share if there is a contention anywhere along the IO path. Real contention is at leaf nodes. However complex the logical device topology is, if two applications are not contending for disk at lowest level, there is no point in doing any kind of resource management among them. Though the applications seemingly might be contending for higher level logical device, at leaf nodes, their IOs might be going to different disk altogether and practically there is no contention.
Quoted 4 lines
The block device could be a plain old sata device, a loop device, a stacking device, a SSD, you name it, but their topologies and the fact that some of them do not even use an elevator should be transparent to the user.
Are there some devices which don't use elevators at leaf nodes? If no, then its not a issue.
Quoted 5 lines
If you wanted to do resource management at the leaf nodes some kind of topology information should be passed down to the elevators controlling the underlying devices, which in turn would need to work cooperatively.
I am not able to understand why some kind of topology information needs to be passed to underlying elevators. As long as end device can map a bio correctly to the right cgroup (irrespective of complex topology) and end device step into resource management only if there is contention for resources among cgroups on that device, things are fine. We don't have to worry about intermediate complex topology.
I will take one hypothetical example. Lets assume there are two cgroups A and B with weights 2048 and 1024 respectively. To me this information means that if A, and B really conted for the resources somewhere, then make sure A gets 2/3 of resources and B gets 1/3 of resource.
Now if tasks in these two groups happen to contend for same disk at lowest level, we do resource management otherwise we don't. Why do I need to worry about intermediate logical devices in the IO path?
May be I am missing something. A detailed example will help here...
Quoted 13 lines
Quoted 2 lines
If that makes sense, then probably we don't need to control dm device and we don't need such higher level solutions.
For the reasons stated above the two level scheduling approach seems cleaner to me.
Quoted 6 lines
- Any kind of 2 level scheduler solution has the potential to break the underlying IO scheduler. Higher level solution requires buffering of bios and controlled release of bios to lower layers. This control breaks the assumptions of lower layer IO scheduler which knows in what order bios should be dispatched to device to meet the semantics exported by the IO scheduler.
Quoted 2 lines
Please notice that the such an IO controller would only get in the way of the elevator in case of contention for the device.
True. So are we saying that a user can get expected CFQ or AS behavior only if there is no contention. If there is contention, then we don't gurantee anything?
Quoted 7 lines
What is more,
depending on the workload it turns out that buffering at higher layers in a per-cgroup or per-task basis, like dm-band does, may actually increase the aggregate throughput (I think that the dm-band team observed this behavior too). The reason seems to be that bios buffered in such way tend to be highly correlated and thus very likely to get merged when released to the elevator.
The goal here is not to increase throughput by doing buffering at higher layer. This is what IO scheduler currently does. It tries to buffer bios and select these appropriately to boost throughput. If one needs to focus on increasing throughput, it should be done at IO scheduler level and not by introducing one more buffering layer in between.
Quoted 18 lines
Quoted 11 lines
- 2nd level scheduler does not keep track of tasks but task groups lets every group dispatch fair share. This has got little semantic problem in the sense that tasks and groups in root cgroup will not be considered at same level. "root" will be considered one group at same level with all child group hence competing with them for resources.
This looks little odd. Considering tasks and groups same level kind of makes more sense. cpu scheduler also consideres tasks and groups at same level and deviation from that probably is not very good.
Quoted 6 lines
Considering tasks and groups at same level will matter only if IO scheduler maintains separate queue for the task, like CFQ. Because in that case IO scheduler tries to provide fairness among various task queues. Some schedulers like noop don't have any notion of separate task queues and fairness among them. In that case probably we don't have a choice but to assume root group competing with child groups.
Quoted 3 lines
If deemed necessary this case could be handled too, but it does not look like a show-stopper.
It is not a show stopper for sure. But it can be a genuine concern in case of CFQ atleast which tries to provide fairness among tasks.
Think of following scenario. (Diagram taken from peterz's mail).
root / | \ 1 2 A / \ B 3
Assume that task 1, task 2 and group A belong to Best effort class and they all have the same priority. If we go for two level scheduling than, disk BW will be divided in the ratio of 25%, 25% and 50% between task 1, task 2 and group A.
I think it should instead be 33% each. Again coming back to the idea of treating 1, 2 and A at same level.
So this is not a show stopper but once you go for one approach, swithing to another will become really hard as it might require close interatction with underlying scheduler and fundamentally 2 level scheduler will find it very hard to communicate with IO scheduler.
Quoted 7 lines
Quoted 4 lines
Keeping above points in mind, probably two level scheduling is not a very good idea. If putting the code in a particular IO scheduler is a concern we can probably explore ways regarding how we can maximize the sharing of cgroup code among IO schedulers.
As discussed above, I still think that the two level scheduling approach makes more sense.
IMHO, two level scheduling approach makes a case only if resource management at leaf nodes does not solve the requirements. So far we have not got a concrete example where resource management at intermediate logical devices is needed and resource management at leaf nodes is not sufficient.
Thanks
Vivek
Quoted 10 lines
Regarding the sharing of cgroup code among IO
schedulers I am all for it. If we consider that elevators should only care about maximizing usage of the underlying devices, implementing other non-hardware-dependent scheduling disciplines (that prioritize according to the task or cgroup that generated the IO, for example) at higher layers so that we can reuse code makes a lot of sense.Thanks,
Fernando
Quoted 20 lines · Fernando Luis Vázquez Cao
Quoted 12 lines · Vivek Goyal
Quoted 6 lines
The dm approach has some merrits, the major one being that it'll fit directly into existing setups that use dm and can be controlled with familiar tools. That is a bonus. The draw back is partially the same - it'll require dm. So it's still not a fit-all approach, unfortunately.
So I'd prefer an approach that doesn't force you to use dm.
Hi Jens,
My patches met the goal of not using the dm for every device one wants to control.
Quoted 6 lines
Having said that, few things come to mind.
- In what cases do we need to control the higher level logical devices like dm. It looks like real contention for resources is at leaf nodes. Hence any kind of resource management/fair queueing should probably be done at leaf nodes and not at higher level logical nodes.
Quoted 5 lines
The problem with stacking devices is that we do not know how the IO going through the leaf nodes contributes to the aggregate throughput seen by the application/cgroup that generated it, which is what end users care about.
If we keep track of cgroup information in bio and don't loose it while bio traverses through the stack of devices, then leaf node can still do the proportional fair share allocation among contending cgroups on that device.
I think end users care about getting fair share if there is a contention anywhere along the IO path. Real contention is at leaf nodes. However complex the logical device topology is, if two applications are not contending for disk at lowest level, there is no point in doing any kind of resource management among them. Though the applications seemingly might be contending for higher level logical device, at leaf nodes, their IOs might be going to different disk altogether and practically there is no contention.
Quoted 4 lines
The block device could be a plain old sata device, a loop device, a stacking device, a SSD, you name it, but their topologies and the fact that some of them do not even use an elevator should be transparent to the user.
Are there some devices which don't use elevators at leaf nodes? If no, then its not a issue.
Quoted 5 lines
If you wanted to do resource management at the leaf nodes some kind of topology information should be passed down to the elevators controlling the underlying devices, which in turn would need to work cooperatively.
I am not able to understand why some kind of topology information needs to be passed to underlying elevators. As long as end device can map a bio correctly to the right cgroup (irrespective of complex topology) and end device step into resource management only if there is contention for resources among cgroups on that device, things are fine. We don't have to worry about intermediate complex topology.
I will take one hypothetical example. Lets assume there are two cgroups A and B with weights 2048 and 1024 respectively. To me this information means that if A, and B really conted for the resources somewhere, then make sure A gets 2/3 of resources and B gets 1/3 of resource.
Now if tasks in these two groups happen to contend for same disk at lowest level, we do resource management otherwise we don't. Why do I need to worry about intermediate logical devices in the IO path?
May be I am missing something. A detailed example will help here...
Quoted 13 lines
Quoted 2 lines
If that makes sense, then probably we don't need to control dm device and we don't need such higher level solutions.
For the reasons stated above the two level scheduling approach seems cleaner to me.
Quoted 6 lines
- Any kind of 2 level scheduler solution has the potential to break the underlying IO scheduler. Higher level solution requires buffering of bios and controlled release of bios to lower layers. This control breaks the assumptions of lower layer IO scheduler which knows in what order bios should be dispatched to device to meet the semantics exported by the IO scheduler.
Quoted 2 lines
Please notice that the such an IO controller would only get in the way of the elevator in case of contention for the device.
True. So are we saying that a user can get expected CFQ or AS behavior only if there is no contention. If there is contention, then we don't gurantee anything?
Quoted 7 lines
What is more,
depending on the workload it turns out that buffering at higher layers in a per-cgroup or per-task basis, like dm-band does, may actually increase the aggregate throughput (I think that the dm-band team observed this behavior too). The reason seems to be that bios buffered in such way tend to be highly correlated and thus very likely to get merged when released to the elevator.
The goal here is not to increase throughput by doing buffering at higher layer. This is what IO scheduler currently does. It tries to buffer bios and select these appropriately to boost throughput. If one needs to focus on increasing throughput, it should be done at IO scheduler level and not by introducing one more buffering layer in between.
Quoted 18 lines
Quoted 11 lines
- 2nd level scheduler does not keep track of tasks but task groups lets every group dispatch fair share. This has got little semantic problem in the sense that tasks and groups in root cgroup will not be considered at same level. "root" will be considered one group at same level with all child group hence competing with them for resources.
This looks little odd. Considering tasks and groups same level kind of makes more sense. cpu scheduler also consideres tasks and groups at same level and deviation from that probably is not very good.
Quoted 6 lines
Considering tasks and groups at same level will matter only if IO scheduler maintains separate queue for the task, like CFQ. Because in that case IO scheduler tries to provide fairness among various task queues. Some schedulers like noop don't have any notion of separate task queues and fairness among them. In that case probably we don't have a choice but to assume root group competing with child groups.
Quoted 3 lines
If deemed necessary this case could be handled too, but it does not look like a show-stopper.
It is not a show stopper for sure. But it can be a genuine concern in case of CFQ atleast which tries to provide fairness among tasks.
Think of following scenario. (Diagram taken from peterz's mail).
root / | \ 1 2 A / \ B 3
Assume that task 1, task 2 and group A belong to Best effort class and they all have the same priority. If we go for two level scheduling than, disk BW will be divided in the ratio of 25%, 25% and 50% between task 1, task 2 and group A.
I think it should instead be 33% each. Again coming back to the idea of treating 1, 2 and A at same level.
So this is not a show stopper but once you go for one approach, swithing to another will become really hard as it might require close interatction with underlying scheduler and fundamentally 2 level scheduler will find it very hard to communicate with IO scheduler.
Quoted 7 lines
Quoted 4 lines
Keeping above points in mind, probably two level scheduling is not a very good idea. If putting the code in a particular IO scheduler is a concern we can probably explore ways regarding how we can maximize the sharing of cgroup code among IO schedulers.
As discussed above, I still think that the two level scheduling approach makes more sense.
IMHO, two level scheduling approach makes a case only if resource management at leaf nodes does not solve the requirements. So far we have not got a concrete example where resource management at intermediate logical devices is needed and resource management at leaf nodes is not sufficient.
Thanks
Vivek
Quoted 10 lines
Regarding the sharing of cgroup code among IO
schedulers I am all for it. If we consider that elevators should only care about maximizing usage of the underlying devices, implementing other non-hardware-dependent scheduling disciplines (that prioritize according to the task or cgroup that generated the IO, for example) at higher layers so that we can reuse code makes a lot of sense.Thanks,
Fernando
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.
Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
Hi Fabio,
I though will give bfq a try. I get following when I put my current shell into a newly created cgroup and then try to do "ls".
Thanks
Vivek
[ 1246.498412] BUG: unable to handle kernel NULL pointer dereference at 000000bc [ 1246.498674] IP: [<c034210b>] __bfq_cic_change_cgroup+0x148/0x239 [ 1246.498674] *pde = 00000000 [ 1246.498674] Oops: 0002 [#1] SMP [ 1246.498674] last sysfs file: /sys/devices/pci0000:00/0000:00:01.1/host0/target0:0:1/0:0:1:0/block/sdb/queue/scheduler [ 1246.498674] Modules linked in: [ 1246.498674] [ 1246.498674] Pid: 2352, comm: dd Not tainted (2.6.28-rc4-bfq #2) [ 1246.498674] EIP: 0060:[<c034210b>] EFLAGS: 00200046 CPU: 0 [ 1246.498674] EIP is at __bfq_cic_change_cgroup+0x148/0x239 [ 1246.498674] EAX: df0e50ac EBX: df0e5000 ECX: 00200046 EDX: df32f300 [ 1246.498674] ESI: dece6ee0 EDI: df0e5000 EBP: df37fc14 ESP: df37fbdc [ 1246.498674] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 [ 1246.498674] Process dd (pid: 2352, ti=df37e000 task=dfb01e00 task.ti=df37e000) [ 1246.498674] Stack: [ 1246.498674] decc9780 dfa98948 df32f300 00000000 00000000 00200046 dece6ef0 00000000 [ 1246.498674] df0e5000 00000000 df0f8014 df32f300 dfa98948 dec0c548 df37fc54 c034351b [ 1246.498674] 00000010 dfabe6c0 dec0c548 00080000 df32f300 00000001 00200246 dfa98988 [ 1246.498674] Call Trace: [ 1246.498674] [<c034351b>] ? bfq_set_request+0x1f5/0x291 [ 1246.498674] [<c0343326>] ? bfq_set_request+0x0/0x291 [ 1246.498674] [<c0333ffe>] ? elv_set_request+0x17/0x26 [ 1246.498674] [<c03365ad>] ? get_request+0x15e/0x1e7 [ 1246.498674] [<c0336af5>] ? get_request_wait+0x22/0xd8 [ 1246.498674] [<c04943b9>] ? dm_merge_bvec+0x88/0xb5 [ 1246.498674] [<c0336f31>] ? __make_request+0x25e/0x310 [ 1246.498674] [<c0494c02>] ? dm_request+0x137/0x150 [ 1246.498674] [<c0335ecf>] ? generic_make_request+0x1e9/0x21f [ 1246.498674] [<c033708b>] ? submit_bio+0xa8/0xb1 [ 1246.498674] [<c0264e49>] ? get_page+0x8/0xe [ 1246.498674] [<c0265157>] ? __lru_cache_add+0x27/0x43 [ 1246.498674] [<c029fea2>] ? mpage_end_io_read+0x0/0x70 [ 1246.498674] [<c029f453>] ? mpage_bio_submit+0x1c/0x21 [ 1246.498674] [<c029ffc3>] ? mpage_readpages+0xb1/0xbe [ 1246.498674] [<c02c04d6>] ? ext3_readpages+0x0/0x16 [ 1246.498674] [<c02c04ea>] ? ext3_readpages+0x14/0x16 [ 1246.498674] [<c02c0f4a>] ? ext3_get_block+0x0/0xd4 [ 1246.498674] [<c02649ee>] ? __do_page_cache_readahead+0xde/0x15b [ 1246.498674] [<c0264cab>] ? ondemand_readahead+0xf9/0x107 [ 1246.498674] [<c0264d1e>] ? page_cache_sync_readahead+0x16/0x1c [ 1246.498674] [<c02600b2>] ? generic_file_aio_read+0x1ad/0x463 [ 1246.498674] [<c02811cb>] ? do_sync_read+0xab/0xe9 [ 1246.498674] [<c0235fe4>] ? autoremove_wake_function+0x0/0x33 [ 1246.498674] [<c0268f15>] ? __inc_zone_page_state+0x12/0x15 [ 1246.498674] [<c026c1a9>] ? handle_mm_fault+0x5a0/0x5b5 [ 1246.498674] [<c0314bcc>] ? security_file_permission+0xf/0x11 [ 1246.498674] [<c0281949>] ? vfs_read+0x80/0xda [ 1246.498674] [<c0281120>] ? do_sync_read+0x0/0xe9 [ 1246.498674] [<c0281bab>] ? sys_read+0x3b/0x5d [ 1246.498674] [<c0203a3d>] ? sysenter_do_call+0x12/0x21 [ 1246.498674] Code: 55 e4 8b 55 d0 89 f0 e8 72 ea ff ff 85 c0 74 04 0f 0b eb fe 8d 46 10 89 45 e0 e8 57 a5 28 00 89 45 dc 8b 55 d0 8d 83 ac 00 00 00 <89> 15 bc 00 00 00 8d 56 14 e8 18 e9 ff ff 8b 75 d0 8d 93 b4 00 [ 1246.498674] EIP: [<c034210b>] __bfq_cic_change_cgroup+0x148/0x239 SS:ESP 0068:df37fbdc [ 1246.498674] ---[ end trace 6bd1df99b7a9cb00 ]---
Quoted 45 lines · Fabio Checconi
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling,
hw_tagdetection and to theCIC_SEEKYheuristic.The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.
Quoted 3 lines
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
Hi Fabio,
I though will give bfq a try. I get following when I put my current shell into a newly created cgroup and then try to do "ls".
Thanks
Vivek
[ 1246.498412] BUG: unable to handle kernel NULL pointer dereference at 000000bc [ 1246.498674] IP: [<c034210b>] __bfq_cic_change_cgroup+0x148/0x239 [ 1246.498674] *pde = 00000000 [ 1246.498674] Oops: 0002 [#1] SMP [ 1246.498674] last sysfs file: /sys/devices/pci0000:00/0000:00:01.1/host0/target0:0:1/0:0:1:0/block/sdb/queue/scheduler [ 1246.498674] Modules linked in: [ 1246.498674] [ 1246.498674] Pid: 2352, comm: dd Not tainted (2.6.28-rc4-bfq #2) [ 1246.498674] EIP: 0060:[<c034210b>] EFLAGS: 00200046 CPU: 0 [ 1246.498674] EIP is at __bfq_cic_change_cgroup+0x148/0x239 [ 1246.498674] EAX: df0e50ac EBX: df0e5000 ECX: 00200046 EDX: df32f300 [ 1246.498674] ESI: dece6ee0 EDI: df0e5000 EBP: df37fc14 ESP: df37fbdc [ 1246.498674] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 [ 1246.498674] Process dd (pid: 2352, ti=df37e000 task=dfb01e00 task.ti=df37e000) [ 1246.498674] Stack: [ 1246.498674] decc9780 dfa98948 df32f300 00000000 00000000 00200046 dece6ef0 00000000 [ 1246.498674] df0e5000 00000000 df0f8014 df32f300 dfa98948 dec0c548 df37fc54 c034351b [ 1246.498674] 00000010 dfabe6c0 dec0c548 00080000 df32f300 00000001 00200246 dfa98988 [ 1246.498674] Call Trace: [ 1246.498674] [<c034351b>] ? bfq_set_request+0x1f5/0x291 [ 1246.498674] [<c0343326>] ? bfq_set_request+0x0/0x291 [ 1246.498674] [<c0333ffe>] ? elv_set_request+0x17/0x26 [ 1246.498674] [<c03365ad>] ? get_request+0x15e/0x1e7 [ 1246.498674] [<c0336af5>] ? get_request_wait+0x22/0xd8 [ 1246.498674] [<c04943b9>] ? dm_merge_bvec+0x88/0xb5 [ 1246.498674] [<c0336f31>] ? __make_request+0x25e/0x310 [ 1246.498674] [<c0494c02>] ? dm_request+0x137/0x150 [ 1246.498674] [<c0335ecf>] ? generic_make_request+0x1e9/0x21f [ 1246.498674] [<c033708b>] ? submit_bio+0xa8/0xb1 [ 1246.498674] [<c0264e49>] ? get_page+0x8/0xe [ 1246.498674] [<c0265157>] ? __lru_cache_add+0x27/0x43 [ 1246.498674] [<c029fea2>] ? mpage_end_io_read+0x0/0x70 [ 1246.498674] [<c029f453>] ? mpage_bio_submit+0x1c/0x21 [ 1246.498674] [<c029ffc3>] ? mpage_readpages+0xb1/0xbe [ 1246.498674] [<c02c04d6>] ? ext3_readpages+0x0/0x16 [ 1246.498674] [<c02c04ea>] ? ext3_readpages+0x14/0x16 [ 1246.498674] [<c02c0f4a>] ? ext3_get_block+0x0/0xd4 [ 1246.498674] [<c02649ee>] ? __do_page_cache_readahead+0xde/0x15b [ 1246.498674] [<c0264cab>] ? ondemand_readahead+0xf9/0x107 [ 1246.498674] [<c0264d1e>] ? page_cache_sync_readahead+0x16/0x1c [ 1246.498674] [<c02600b2>] ? generic_file_aio_read+0x1ad/0x463 [ 1246.498674] [<c02811cb>] ? do_sync_read+0xab/0xe9 [ 1246.498674] [<c0235fe4>] ? autoremove_wake_function+0x0/0x33 [ 1246.498674] [<c0268f15>] ? __inc_zone_page_state+0x12/0x15 [ 1246.498674] [<c026c1a9>] ? handle_mm_fault+0x5a0/0x5b5 [ 1246.498674] [<c0314bcc>] ? security_file_permission+0xf/0x11 [ 1246.498674] [<c0281949>] ? vfs_read+0x80/0xda [ 1246.498674] [<c0281120>] ? do_sync_read+0x0/0xe9 [ 1246.498674] [<c0281bab>] ? sys_read+0x3b/0x5d [ 1246.498674] [<c0203a3d>] ? sysenter_do_call+0x12/0x21 [ 1246.498674] Code: 55 e4 8b 55 d0 89 f0 e8 72 ea ff ff 85 c0 74 04 0f 0b eb fe 8d 46 10 89 45 e0 e8 57 a5 28 00 89 45 dc 8b 55 d0 8d 83 ac 00 00 00 <89> 15 bc 00 00 00 8d 56 14 e8 18 e9 ff ff 8b 75 d0 8d 93 b4 00 [ 1246.498674] EIP: [<c034210b>] __bfq_cic_change_cgroup+0x148/0x239 SS:ESP 0068:df37fbdc [ 1246.498674] ---[ end trace 6bd1df99b7a9cb00 ]---
Quoted 3 lines
From: Vivek Goyal <[email protected]>
Date: Thu, Nov 20, 2008 04:31:55PM -0500
...
Quoted 5 lines
Hi Fabio,
I though will give bfq a try. I get following when I put my current shell into a newly created cgroup and then try to do "ls".
The posted patch cannot work as it is, I'm sorry for that ugly bug. Do you still have problems with this one applied?
---
block/bfq-cgroup.c +1 -1
@@ -168,7 +168,7 @@ static void bfq_group_chain_link(struct bfq_data *bfqd, struct cgroup *cgroup,spin_lock_irqsave (&bgrp->lock, flags); -rcu_assign_pointer (bfqg->bfqd, bfqd); +rcu_assign_pointer (leaf->bfqd, bfqd);hlist_add_head_rcu (&leaf->group_node, &bgrp->group_data);hlist_add_head (&leaf->bfqd_node, &bfqd->group_list);
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 19 lines · Fabio Checconi
Quoted 3 lines
From: Vivek Goyal <[email protected]>
Date: Thu, Nov 20, 2008 04:31:55PM -0500...
Quoted 5 lines
Hi Fabio,
I though will give bfq a try. I get following when I put my current shell into a newly created cgroup and then try to do "ls".
The posted patch cannot work as it is, I'm sorry for that ugly bug. Do you still have problems with this one applied?
---
block/bfq-cgroup.c +0
-0
block/bfq-cgroup.c static void bfq_group_chain_link(struct bfq_data *bfqd, struct cgroup *cgroup, · line 173
Quoted 7 lines
block/bfq-cgroup.c +1
-1@@ -168,7 +168,7 @@ static void bfq_group_chain_link(struct bfq_data *bfqd, struct cgroup *cgroup,spin_lock_irqsave (&bgrp->lock, flags); -rcu_assign_pointer (bfqg->bfqd, bfqd); +rcu_assign_pointer (leaf->bfqd, bfqd);hlist_add_head_rcu (&leaf->group_node, &bgrp->group_data);hlist_add_head (&leaf->bfqd_node, &bfqd->group_list);
Thanks Fabio. This fix solves the issue for me.
I did a quick testing and I can see the differential service if I create two cgroups of different priority. How do I map ioprio to shares? I mean lets say one cgroup has ioprio 4 and other has got ioprio 7, then what's the respective share(%) of each cgroup?
Thanks
Vivek
Quoted 19 lines · Fabio Checconi
Quoted 3 lines
From: Vivek Goyal <[email protected]>
Date: Thu, Nov 20, 2008 04:31:55PM -0500...
Quoted 5 lines
Hi Fabio,
I though will give bfq a try. I get following when I put my current shell into a newly created cgroup and then try to do "ls".
The posted patch cannot work as it is, I'm sorry for that ugly bug. Do you still have problems with this one applied?
---
block/bfq-cgroup.c +0
-0
block/bfq-cgroup.c static void bfq_group_chain_link(struct bfq_data *bfqd, struct cgroup *cgroup, · line 173
Quoted 7 lines
block/bfq-cgroup.c +1
-1@@ -168,7 +168,7 @@ static void bfq_group_chain_link(struct bfq_data *bfqd, struct cgroup *cgroup,spin_lock_irqsave (&bgrp->lock, flags); -rcu_assign_pointer (bfqg->bfqd, bfqd); +rcu_assign_pointer (leaf->bfqd, bfqd);hlist_add_head_rcu (&leaf->group_node, &bgrp->group_data);hlist_add_head (&leaf->bfqd_node, &bfqd->group_list);
Thanks Fabio. This fix solves the issue for me.
I did a quick testing and I can see the differential service if I create two cgroups of different priority. How do I map ioprio to shares? I mean lets say one cgroup has ioprio 4 and other has got ioprio 7, then what's the respective share(%) of each cgroup?
Thanks
Vivek
Quoted 19 lines · Fabio Checconi
Quoted 3 lines
From: Vivek Goyal <[email protected]>
Date: Thu, Nov 20, 2008 04:31:55PM -0500...
Quoted 5 lines
Hi Fabio,
I though will give bfq a try. I get following when I put my current shell into a newly created cgroup and then try to do "ls".
The posted patch cannot work as it is, I'm sorry for that ugly bug. Do you still have problems with this one applied?
---
block/bfq-cgroup.c +0
-0
block/bfq-cgroup.c static void bfq_group_chain_link(struct bfq_data *bfqd, struct cgroup *cgroup, · line 173
Quoted 7 lines
block/bfq-cgroup.c +1
-1@@ -168,7 +168,7 @@ static void bfq_group_chain_link(struct bfq_data *bfqd, struct cgroup *cgroup,spin_lock_irqsave (&bgrp->lock, flags); -rcu_assign_pointer (bfqg->bfqd, bfqd); +rcu_assign_pointer (leaf->bfqd, bfqd);hlist_add_head_rcu (&leaf->group_node, &bgrp->group_data);hlist_add_head (&leaf->bfqd_node, &bfqd->group_list);
Thanks Fabio. This fix solves the issue for me.
I did a quick testing and I can see the differential service if I create two cgroups of different priority. How do I map ioprio to shares? I mean lets say one cgroup has ioprio 4 and other has got ioprio 7, then what's the respective share(%) of each cgroup?
Thanks
Vivek
Quoted 24 lines
From: Vivek Goyal <[email protected]>
Date: Fri, Nov 21, 2008 09:58:23AM -0500Quoted 20 lines · Fabio Checconi
Quoted 3 lines
From: Vivek Goyal <[email protected]>
Date: Thu, Nov 20, 2008 04:31:55PM -0500...
Quoted 5 lines
Hi Fabio,
I though will give bfq a try. I get following when I put my current shell into a newly created cgroup and then try to do "ls".
The posted patch cannot work as it is, I'm sorry for that ugly bug. Do you still have problems with this one applied?
---
block/bfq-cgroup.c +0
-0@@ -168,7 +168,7 @@ static void bfq_group_chain_link(struct bfq_data *bfqd, struct cgroup *cgroup,
Quoted 9 lines
block/bfq-cgroup.c static void bfq_group_chain_link(struct bfq_data *bfqd, struct cgroup *cgroup, · line 173
Quoted 6 lines
block/bfq-cgroup.c +1
-1spin_lock_irqsave (&bgrp->lock, flags); -rcu_assign_pointer (bfqg->bfqd, bfqd); +rcu_assign_pointer (leaf->bfqd, bfqd);hlist_add_head_rcu (&leaf->group_node, &bgrp->group_data);hlist_add_head (&leaf->bfqd_node, &bfqd->group_list);Thanks Fabio. This fix solves the issue for me.
Ok thank you.
Quoted 5 lines
I did a quick testing and I can see the differential service if I create two cgroups of different priority. How do I map ioprio to shares? I mean lets say one cgroup has ioprio 4 and other has got ioprio 7, then what's the respective share(%) of each cgroup?
I thought I wrote it somewhere, but maybe I missed that; weights are mapped linearly, in decreasing order of priority:
weight = 8 - ioprio
[ the calculation is done in bfq_weight_t bfq_ioprio_to_weight() ]
So, with ioprio 4 you have weight 4, and with ioprio 7 you have weight 1. The shares, as long as the two tasks/groups are active on the disk, are 4/5 and 1/5 respectively.
This interface is really ugly, but it allows compatible uses of ioprios with the two schedulers.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 24 lines
From: Vivek Goyal <[email protected]>
Date: Fri, Nov 21, 2008 09:58:23AM -0500Quoted 20 lines · Fabio Checconi
Quoted 3 lines
From: Vivek Goyal <[email protected]>
Date: Thu, Nov 20, 2008 04:31:55PM -0500...
Quoted 5 lines
Hi Fabio,
I though will give bfq a try. I get following when I put my current shell into a newly created cgroup and then try to do "ls".
The posted patch cannot work as it is, I'm sorry for that ugly bug. Do you still have problems with this one applied?
---
block/bfq-cgroup.c +0
-0@@ -168,7 +168,7 @@ static void bfq_group_chain_link(struct bfq_data *bfqd, struct cgroup *cgroup,
Quoted 9 lines
block/bfq-cgroup.c static void bfq_group_chain_link(struct bfq_data *bfqd, struct cgroup *cgroup, · line 173
Quoted 6 lines
block/bfq-cgroup.c +1
-1spin_lock_irqsave (&bgrp->lock, flags); -rcu_assign_pointer (bfqg->bfqd, bfqd); +rcu_assign_pointer (leaf->bfqd, bfqd);hlist_add_head_rcu (&leaf->group_node, &bgrp->group_data);hlist_add_head (&leaf->bfqd_node, &bfqd->group_list);Thanks Fabio. This fix solves the issue for me.
Ok thank you.
Quoted 5 lines
I did a quick testing and I can see the differential service if I create two cgroups of different priority. How do I map ioprio to shares? I mean lets say one cgroup has ioprio 4 and other has got ioprio 7, then what's the respective share(%) of each cgroup?
I thought I wrote it somewhere, but maybe I missed that; weights are mapped linearly, in decreasing order of priority:
weight = 8 - ioprio
[ the calculation is done in bfq_weight_t bfq_ioprio_to_weight() ]
So, with ioprio 4 you have weight 4, and with ioprio 7 you have weight 1. The shares, as long as the two tasks/groups are active on the disk, are 4/5 and 1/5 respectively.
This interface is really ugly, but it allows compatible uses of ioprios with the two schedulers.
Quoted 24 lines
From: Vivek Goyal <[email protected]>
Date: Fri, Nov 21, 2008 09:58:23AM -0500Quoted 20 lines · Fabio Checconi
Quoted 3 lines
From: Vivek Goyal <[email protected]>
Date: Thu, Nov 20, 2008 04:31:55PM -0500...
Quoted 5 lines
Hi Fabio,
I though will give bfq a try. I get following when I put my current shell into a newly created cgroup and then try to do "ls".
The posted patch cannot work as it is, I'm sorry for that ugly bug. Do you still have problems with this one applied?
---
block/bfq-cgroup.c +0
-0@@ -168,7 +168,7 @@ static void bfq_group_chain_link(struct bfq_data *bfqd, struct cgroup *cgroup,
Quoted 9 lines
block/bfq-cgroup.c static void bfq_group_chain_link(struct bfq_data *bfqd, struct cgroup *cgroup, · line 173
Quoted 6 lines
block/bfq-cgroup.c +1
-1spin_lock_irqsave (&bgrp->lock, flags); -rcu_assign_pointer (bfqg->bfqd, bfqd); +rcu_assign_pointer (leaf->bfqd, bfqd);hlist_add_head_rcu (&leaf->group_node, &bgrp->group_data);hlist_add_head (&leaf->bfqd_node, &bfqd->group_list);Thanks Fabio. This fix solves the issue for me.
Ok thank you.
Quoted 5 lines
I did a quick testing and I can see the differential service if I create two cgroups of different priority. How do I map ioprio to shares? I mean lets say one cgroup has ioprio 4 and other has got ioprio 7, then what's the respective share(%) of each cgroup?
I thought I wrote it somewhere, but maybe I missed that; weights are mapped linearly, in decreasing order of priority:
weight = 8 - ioprio
[ the calculation is done in bfq_weight_t bfq_ioprio_to_weight() ]
So, with ioprio 4 you have weight 4, and with ioprio 7 you have weight 1. The shares, as long as the two tasks/groups are active on the disk, are 4/5 and 1/5 respectively.
This interface is really ugly, but it allows compatible uses of ioprios with the two schedulers.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 3 lines
From: Vivek Goyal <[email protected]>
Date: Thu, Nov 20, 2008 04:31:55PM -0500
...
Quoted 5 lines
Hi Fabio,
I though will give bfq a try. I get following when I put my current shell into a newly created cgroup and then try to do "ls".
The posted patch cannot work as it is, I'm sorry for that ugly bug. Do you still have problems with this one applied?
---
block/bfq-cgroup.c +1 -1
@@ -168,7 +168,7 @@ static void bfq_group_chain_link(struct bfq_data *bfqd, struct cgroup *cgroup,spin_lock_irqsave (&bgrp->lock, flags); -rcu_assign_pointer (bfqg->bfqd, bfqd); +rcu_assign_pointer (leaf->bfqd, bfqd);hlist_add_head_rcu (&leaf->group_node, &bgrp->group_data);hlist_add_head (&leaf->bfqd_node, &bfqd->group_list);
Quoted 3 lines
From: Vivek Goyal <[email protected]>
Date: Thu, Nov 20, 2008 04:31:55PM -0500
...
Quoted 5 lines
Hi Fabio,
I though will give bfq a try. I get following when I put my current shell into a newly created cgroup and then try to do "ls".
The posted patch cannot work as it is, I'm sorry for that ugly bug. Do you still have problems with this one applied?
---
block/bfq-cgroup.c +1 -1
@@ -168,7 +168,7 @@ static void bfq_group_chain_link(struct bfq_data *bfqd, struct cgroup *cgroup,spin_lock_irqsave (&bgrp->lock, flags); -rcu_assign_pointer (bfqg->bfqd, bfqd); +rcu_assign_pointer (leaf->bfqd, bfqd);hlist_add_head_rcu (&leaf->group_node, &bgrp->group_data);hlist_add_head (&leaf->bfqd_node, &bfqd->group_list);
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling, hw_tag detection and to the CIC_SEEKY heuristic.
The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;
- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
Quoted 4 lines
From: Vivek Goyal <[email protected]>
Date: Tue, Nov 18, 2008 09:07:51AM -0500On Tue, Nov 18, 2008 at 01:05:08PM +0100, Fabio Checconi wrote:
...
Quoted 17 lines
Quoted 4 lines
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
IIUC, bfq and cfq are different in following manner.
a. BFQ employs WF2Q+ for fairness and CFQ employes weighted round robin. b. BFQ uses the budget (sector count) as notion of service and CFQ uses
time slices.
c. BFQ supports hierarchical fair queuing and CFQ does not.We are looking forward for implementation of point C. Fabio seems to thinking of supporting time slice as a service (B). It seems like convergence of CFQ and BFQ except the point A (WF2Q+ vs weighted round robin).
Quoted 5 lines
It looks like WF2Q+ provides tighter service bound and bfq guys mention that they have been able to ensure throughput while ensuring tighter bounds. If that's the case, does that mean BFQ is a replacement for CFQ down the line?
BFQ started from CFQ, extending it in the way you correctly describe, so it is indeed very similar. There are also some minor changes to locking, cic handling, hw_tag detection and to the CIC_SEEKY heuristic.
The two schedulers share similar goals, and in my opinion BFQ can be considered, in the long term, a CFQ replacement; *but* before talking about replacing CFQ we have to consider that:
- it *needs* review and testing; we've done our best, but for sure
it's not enough; review and testing are never enough;
- the service domain fairness, which was one of our objectives, requires some extra complexity; the mechanisms we used and the design choices we've made may not fit all the needs, or may not be as generic as the simpler CFQ's ones;
- CFQ has years of history behind and has been tuned for a wider variety of environments than the ones we've been able to test.
If time-based fairness is considered more robust and the loss of service-domain fairness is not a problem, then the two schedulers can be made even more similar.
Quoted 36 lines · Fabio Checconi
Hi,
Quoted 5 lines
From: Nauman Rafique <[email protected]>
Date: Mon, Nov 17, 2008 09:01:48PM -0800If we start with bfq patches, this is how plan would look like:
Quoted 8 lines
1 Start with BFQ take 2.
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for disk time budgets, besides sector budget that is currently available (configurable option). (Fabio: Do you think we can just emulate
that using the existing code?). Another approach would be to give time slices just like CFQ (discussing?)it should be possible without altering the code. The slices can be
assigned in the time domain using big values formax_budget. The logic
is: each process is assigned a budget (in the range [max_budget/2,max_budget], choosen from the feedback mechanism, driven in__bfq_bfqq_recalc_budget()), and if it does not complete it intimeout_syncmilliseconds, it is charged a fixed amount of sectors of service.Using big values for
max_budget(where big means greater than two times the number of sectors the hard drive can transfer intimeout_syncmilliseconds) makes the budgets always to time out, so the disk time is scheduled in slices oftimeout_sync.However this is just a temporary workaround to do some basic testing.
Modifying the scheduler to support time slices instead of sector budgets would indeed simplify the code; I think that the drawback would be being too unfair in the service domain. Of course we have to consider how much is important to be fair in the service domain, and how much added complexity/new code can we accept for it.
Quoted 7 lines
[ Better service domain fairness is one of the main reasons why
we started working on bfq, so, talking for me and Paolo it _is_ important :) ]I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
I think "time only budget" vs "sector budget" is dependent on the definition of fairness: do you want to be fair in the time that is given to each cgroup or fair in total number of sectors transferred. And the appropriate definition of fairness depends on how/where the IO scheduler is used. Do you think the work-around that you mentioned would have a significant performance difference compared to direct built-in support?
Quoted 33 lines
Quoted 18 lines
4 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which re-uses memory resource controller code but is not dependent on it (may be biocgroup patches from dm-ioband can be used here directly)
7 Start an offline email thread to keep track of progress on the above goals.Quoted 3 lines
BFQ's support for hierarchy of cgroups means that its close to where we want to get. Any comments on what approach looks better?
The main problems with this approach (as with the cfq-based ones) in my opinion are:
- the request descriptor allocation problem Divyesh talked about,
- the impossibility of respecting different weights, resulting from the interlock problem with synchronous requests Vivek talked about [ in cfq/bfq this can happen when idling is disabled, e.g., for SSDs, or when using NCQ ],but I think that correctly addressing your points 4.a) and 4.b) should solve them.
Quoted 36 lines · Fabio Checconi
Hi,
Quoted 5 lines
From: Nauman Rafique <[email protected]>
Date: Mon, Nov 17, 2008 09:01:48PM -0800If we start with bfq patches, this is how plan would look like:
Quoted 8 lines
1 Start with BFQ take 2.
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for disk time budgets, besides sector budget that is currently available (configurable option). (Fabio: Do you think we can just emulate
that using the existing code?). Another approach would be to give time slices just like CFQ (discussing?)it should be possible without altering the code. The slices can be
assigned in the time domain using big values formax_budget. The logic
is: each process is assigned a budget (in the range [max_budget/2,max_budget], choosen from the feedback mechanism, driven in__bfq_bfqq_recalc_budget()), and if it does not complete it intimeout_syncmilliseconds, it is charged a fixed amount of sectors of service.Using big values for
max_budget(where big means greater than two times the number of sectors the hard drive can transfer intimeout_syncmilliseconds) makes the budgets always to time out, so the disk time is scheduled in slices oftimeout_sync.However this is just a temporary workaround to do some basic testing.
Modifying the scheduler to support time slices instead of sector budgets would indeed simplify the code; I think that the drawback would be being too unfair in the service domain. Of course we have to consider how much is important to be fair in the service domain, and how much added complexity/new code can we accept for it.
Quoted 7 lines
[ Better service domain fairness is one of the main reasons why
we started working on bfq, so, talking for me and Paolo it _is_ important :) ]I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
I think "time only budget" vs "sector budget" is dependent on the definition of fairness: do you want to be fair in the time that is given to each cgroup or fair in total number of sectors transferred. And the appropriate definition of fairness depends on how/where the IO scheduler is used. Do you think the work-around that you mentioned would have a significant performance difference compared to direct built-in support?
Quoted 33 lines
Quoted 18 lines
4 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which re-uses memory resource controller code but is not dependent on it (may be biocgroup patches from dm-ioband can be used here directly)
7 Start an offline email thread to keep track of progress on the above goals.Quoted 3 lines
BFQ's support for hierarchy of cgroups means that its close to where we want to get. Any comments on what approach looks better?
The main problems with this approach (as with the cfq-based ones) in my opinion are:
- the request descriptor allocation problem Divyesh talked about,
- the impossibility of respecting different weights, resulting from the interlock problem with synchronous requests Vivek talked about [ in cfq/bfq this can happen when idling is disabled, e.g., for SSDs, or when using NCQ ],but I think that correctly addressing your points 4.a) and 4.b) should solve them.
Quoted 4 lines
From: Nauman Rafique <[email protected]>
Date: Tue, Nov 18, 2008 02:33:19PM -0800On Tue, Nov 18, 2008 at 4:05 AM, Fabio Checconi <[email protected]> wrote:
...
Quoted 28 lines
Quoted 20 lines
it should be possible without altering the code. The slices can be
assigned in the time domain using big values formax_budget. The logic
is: each process is assigned a budget (in the range [max_budget/2,max_budget], choosen from the feedback mechanism, driven in__bfq_bfqq_recalc_budget()), and if it does not complete it intimeout_syncmilliseconds, it is charged a fixed amount of sectors of service.Using big values for
max_budget(where big means greater than two times the number of sectors the hard drive can transfer intimeout_syncmilliseconds) makes the budgets always to time out, so the disk time is scheduled in slices oftimeout_sync.However this is just a temporary workaround to do some basic testing.
Modifying the scheduler to support time slices instead of sector budgets would indeed simplify the code; I think that the drawback would be being too unfair in the service domain. Of course we have to consider how much is important to be fair in the service domain, and how much added complexity/new code can we accept for it.
Quoted 7 lines
[ Better service domain fairness is one of the main reasons why
we started working on bfq, so, talking for me and Paolo it _is_ important :) ]I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
Quoted 8 lines
I think "time only budget" vs "sector budget" is dependent on the definition of fairness: do you want to be fair in the time that is given to each cgroup or fair in total number of sectors transferred. And the appropriate definition of fairness depends on how/where the IO scheduler is used. Do you think the work-around that you mentioned would have a significant performance difference compared to direct built-in support?
In terms of throughput, it should not have any influence, since tasks would always receive a full timeslice. In terms of latency it would bypass completely the feedback mechanism, and that would have a negative impact (basically the scheduler would not be able to differentiate between tasks with the same weight but with different interactivity needs).
In terms of service fairness it is a little bit hard to say, but I would not expect anything near to what can be done with a service domain approach, independently from the scheduler used.
A message that is not in the archive (sent off-list or not yet received): e98e18940811181433o4bb5a147i1e0b9c1baf495ae2-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 4 lines
From: Nauman Rafique <[email protected]>
Date: Tue, Nov 18, 2008 02:33:19PM -0800On Tue, Nov 18, 2008 at 4:05 AM, Fabio Checconi <[email protected]> wrote:
...
Quoted 28 lines
Quoted 20 lines
it should be possible without altering the code. The slices can be
assigned in the time domain using big values formax_budget. The logic
is: each process is assigned a budget (in the range [max_budget/2,max_budget], choosen from the feedback mechanism, driven in__bfq_bfqq_recalc_budget()), and if it does not complete it intimeout_syncmilliseconds, it is charged a fixed amount of sectors of service.Using big values for
max_budget(where big means greater than two times the number of sectors the hard drive can transfer intimeout_syncmilliseconds) makes the budgets always to time out, so the disk time is scheduled in slices oftimeout_sync.However this is just a temporary workaround to do some basic testing.
Modifying the scheduler to support time slices instead of sector budgets would indeed simplify the code; I think that the drawback would be being too unfair in the service domain. Of course we have to consider how much is important to be fair in the service domain, and how much added complexity/new code can we accept for it.
Quoted 7 lines
[ Better service domain fairness is one of the main reasons why
we started working on bfq, so, talking for me and Paolo it _is_ important :) ]I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
Quoted 8 lines
I think "time only budget" vs "sector budget" is dependent on the definition of fairness: do you want to be fair in the time that is given to each cgroup or fair in total number of sectors transferred. And the appropriate definition of fairness depends on how/where the IO scheduler is used. Do you think the work-around that you mentioned would have a significant performance difference compared to direct built-in support?
In terms of throughput, it should not have any influence, since tasks would always receive a full timeslice. In terms of latency it would bypass completely the feedback mechanism, and that would have a negative impact (basically the scheduler would not be able to differentiate between tasks with the same weight but with different interactivity needs).
In terms of service fairness it is a little bit hard to say, but I would not expect anything near to what can be done with a service domain approach, independently from the scheduler used.
Quoted 4 lines
From: Nauman Rafique <[email protected]>
Date: Tue, Nov 18, 2008 02:33:19PM -0800On Tue, Nov 18, 2008 at 4:05 AM, Fabio Checconi <[email protected]> wrote:
...
Quoted 28 lines
Quoted 20 lines
it should be possible without altering the code. The slices can be
assigned in the time domain using big values formax_budget. The logic
is: each process is assigned a budget (in the range [max_budget/2,max_budget], choosen from the feedback mechanism, driven in__bfq_bfqq_recalc_budget()), and if it does not complete it intimeout_syncmilliseconds, it is charged a fixed amount of sectors of service.Using big values for
max_budget(where big means greater than two times the number of sectors the hard drive can transfer intimeout_syncmilliseconds) makes the budgets always to time out, so the disk time is scheduled in slices oftimeout_sync.However this is just a temporary workaround to do some basic testing.
Modifying the scheduler to support time slices instead of sector budgets would indeed simplify the code; I think that the drawback would be being too unfair in the service domain. Of course we have to consider how much is important to be fair in the service domain, and how much added complexity/new code can we accept for it.
Quoted 7 lines
[ Better service domain fairness is one of the main reasons why
we started working on bfq, so, talking for me and Paolo it _is_ important :) ]I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
Quoted 8 lines
I think "time only budget" vs "sector budget" is dependent on the definition of fairness: do you want to be fair in the time that is given to each cgroup or fair in total number of sectors transferred. And the appropriate definition of fairness depends on how/where the IO scheduler is used. Do you think the work-around that you mentioned would have a significant performance difference compared to direct built-in support?
In terms of throughput, it should not have any influence, since tasks would always receive a full timeslice. In terms of latency it would bypass completely the feedback mechanism, and that would have a negative impact (basically the scheduler would not be able to differentiate between tasks with the same weight but with different interactivity needs).
In terms of service fairness it is a little bit hard to say, but I would not expect anything near to what can be done with a service domain approach, independently from the scheduler used.
Nauman Rafique ha scritto:
Quoted 9 lines
I think "time only budget" vs "sector budget" is dependent on the definition of fairness: do you want to be fair in the time that is given to each cgroup or fair in total number of sectors transferred. And the appropriate definition of fairness depends on how/where the IO scheduler is used. ...
Just a general note: as Fabio already said, switching back to time budgets in BFQ would be (conceptually) straightforward. However, we will never get fairness in bandwidth distribution if we work (only) in the time domain.
Signature · 8 lines
----------------------------------------------------------- | Paolo Valente | | | Algogroup | | | Dip. Ing. Informazione | tel: +39 059 2056318 | | Via Vignolese 905/b | fax: +39 059 2056199 | | 41100 Modena | | | home: http://algo.ing.unimo.it/people/paolo/ | -----------------------------------------------------------
Nauman Rafique ha scritto:
Quoted 9 lines
I think "time only budget" vs "sector budget" is dependent on the definition of fairness: do you want to be fair in the time that is given to each cgroup or fair in total number of sectors transferred. And the appropriate definition of fairness depends on how/where the IO scheduler is used. ...
Just a general note: as Fabio already said, switching back to time budgets in BFQ would be (conceptually) straightforward. However, we will never get fairness in bandwidth distribution if we work (only) in the time domain.
Signature · 8 lines
----------------------------------------------------------- | Paolo Valente | | | Algogroup | | | Dip. Ing. Informazione | tel: +39 059 2056318 | | Via Vignolese 905/b | fax: +39 059 2056199 | | 41100 Modena | | | home: http://algo.ing.unimo.it/people/paolo/ | -----------------------------------------------------------
Hi,
Quoted 5 lines
From: Nauman Rafique <[email protected]>
Date: Mon, Nov 17, 2008 09:01:48PM -0800If we start with bfq patches, this is how plan would look like:
Quoted 8 lines
1 Start with BFQ take 2.
2 Do the following to support proportional division:
a) Expose the per device weight interface to user, instead of calculating from priority.
b) Add support for disk time budgets, besides sector budget that is currently available (configurable option). (Fabio: Do you think we can just emulate
that using the existing code?). Another approach would be to give time slices just like CFQ (discussing?)
it should be possible without altering the code. The slices can be
assigned in the time domain using big values for max_budget. The logic
is: each process is assigned a budget (in the range [max_budget/2, max_budget], choosen from the feedback mechanism, driven in __bfq_bfqq_recalc_budget()), and if it does not complete it in timeout_sync milliseconds, it is charged a fixed amount of sectors of service.
Using big values for max_budget (where big means greater than two times the number of sectors the hard drive can transfer in timeout_sync milliseconds) makes the budgets always to time out, so the disk time is scheduled in slices of timeout_sync.
However this is just a temporary workaround to do some basic testing.
Modifying the scheduler to support time slices instead of sector budgets would indeed simplify the code; I think that the drawback would be being too unfair in the service domain. Of course we have to consider how much is important to be fair in the service domain, and how much added complexity/new code can we accept for it.
[ Better service domain fairness is one of the main reasons why
we started working on bfq, so, talking for me and Paolo it _is_ important :) ]
I have to think a little bit on how it would be possible to support an option for time-only budgets, coexisting with the current behavior, but I think it can be done.
Quoted 16 lines
4 Do the following to support the goals of 2 level schedulers:
a) Limit the request descriptors allocated to each cgroup by adding functionality toelv_may_queue()
b) Add support for putting an absolute limit on IO consumed by a cgroup. Such support is provided by Andrea
Righi's patches too.
c) Add support (configurable option) to keep track of total disk
time/sectors/count
consumed at each device, and factor that into scheduling decision (more discussion needed here)
6 Incorporate an IO tracking approach which re-uses memory resource controller code but is not dependent on it (may be biocgroup patches from dm-ioband can be used here directly)
7 Start an offline email thread to keep track of progress on the above goals.
Quoted 3 lines
BFQ's support for hierarchy of cgroups means that its close to where we want to get. Any comments on what approach looks better?
The main problems with this approach (as with the cfq-based ones) in my opinion are:
- the request descriptor allocation problem Divyesh talked about,
- the impossibility of respecting different weights, resulting from the interlock problem with synchronous requests Vivek talked about [ in cfq/bfq this can happen when idling is disabled, e.g., for SSDs, or when using NCQ ],
but I think that correctly addressing your points 4.a) and 4.b) should solve them.
Quoted 32 lines · Vivek Goyal
Quoted 31 lines · Ryo Tsuruta
Hi,
From: [email protected]
Subject: [patch 0/4] [RFC] Another proportional weight IO controller
Date: Thu, 06 Nov 2008 10:30:22 -0500Quoted 24 lines
Hi,
If you are not already tired of so many io controller implementations, here is another one.
This is a very eary very crude implementation to get early feedback to see if this approach makes any sense or not.
This controller is a proportional weight IO controller primarily based on/inspired by dm-ioband. One of the things I personally found little odd about dm-ioband was need of a dm-ioband device for every device we want to control. I thought that probably we can make this control per request queue and get rid of device mapper driver. This should make configuration aspect easy.
I have picked up quite some amount of code from dm-ioband especially for biocgroup implementation.
I have done very basic testing and that is running 2-3 dd commands in different cgroups on
x86_64. Wanted to throw out the code early to get some feedback.More details about the design and how to are in documentation patch.
Your comments are welcome.
Quoted 8 lines
Quoted 3 lines
Do you have any benchmark results?
I'm especially interested in the followings:
- Comparison of disk performance with and without the I/O controller patch.If I dynamically disable the bio control, then I did not observe any impact on performance. Because in that case practically it boils down to just an additional variable check in
__make_request().
Oh.., I understood your question wrong. You are looking for what's the performance penalty if I enable the IO controller on a device.
I have not done any extensive benchmarking. If I run two dd commands without controller, I get 80MB/s from disk (roughly 40 MB for each task). With bio group enabled (default token=2000), I was getting total BW of roughly 68 MB/s.
I have not done any performance analysis or optimizations at this point of time. I plan to do that once we have some sort of common understanding about a particular approach. There are so many IO controllers floating, right now I am more concerned if we can all come to a common platform.
Thanks
Vivek
Quoted 30 lines
Quoted 4 lines
- Put uneven I/O loads. Processes, which belong to a cgroup which is given a smaller weight than another cgroup, put heavier I/O load like the following.
Quoted 13 lines
echo 1024 > /cgroup/bio/test1/bio.shares echo 8192 > /cgroup/bio/test2/bio.shares echo $$ > /cgroup/bio/test1/tasks dd if=/somefile1-1 of=/dev/null & dd if=/somefile1-2 of=/dev/null & ... dd if=/somefile1-100 of=/dev/null echo $$ > /cgroup/bio/test2/tasks dd if=/somefile2-1 of=/dev/null & dd if=/somefile2-2 of=/dev/null & ... dd if=/somefile2-10 of=/dev/null &I have not tried this case.
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I have had a very brief look at BFQ's hierarchical proportional weight/priority IO control and it looks good. May be we can adopt it for other IO schedulers also.
Thanks
Vivek
Hi Vivek,
Sorry for late reply.
Quoted 11 lines
Quoted 8 lines
Quoted 3 lines
Do you have any benchmark results?
I'm especially interested in the followings:
- Comparison of disk performance with and without the I/O controller patch.If I dynamically disable the bio control, then I did not observe any impact on performance. Because in that case practically it boils down to just an additional variable check in
__make_request().Oh.., I understood your question wrong. You are looking for what's the performance penalty if I enable the IO controller on a device.
Yes, that is what I want to know.
Quoted 9 lines
I have not done any extensive benchmarking. If I run two dd commands without controller, I get 80MB/s from disk (roughly 40 MB for each task). With bio group enabled (default token=2000), I was getting total BW of roughly 68 MB/s.
I have not done any performance analysis or optimizations at this point of time. I plan to do that once we have some sort of common understanding about a particular approach. There are so many IO controllers floating, right now I am more concerned if we can all come to a common platform.
I understood the reason of posting the patch well.
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Thanks,
Ryo Tsuruta
A message that is not in the archive (sent off-list or not yet received): 20081120.182053.220301508585579959.ryov-jCdQPDEk3idL9jVzuh4AOg@public.gmane.org
Quoted 28 lines · Ryo Tsuruta
Hi Vivek,
Sorry for late reply.
Quoted 11 lines
Quoted 8 lines
Quoted 3 lines
Do you have any benchmark results?
I'm especially interested in the followings:
- Comparison of disk performance with and without the I/O controller patch.If I dynamically disable the bio control, then I did not observe any impact on performance. Because in that case practically it boils down to just an additional variable check in
__make_request().Oh.., I understood your question wrong. You are looking for what's the performance penalty if I enable the IO controller on a device.
Yes, that is what I want to know.
Quoted 9 lines
I have not done any extensive benchmarking. If I run two dd commands without controller, I get 80MB/s from disk (roughly 40 MB for each task). With bio group enabled (default token=2000), I was getting total BW of roughly 68 MB/s.
I have not done any performance analysis or optimizations at this point of time. I plan to do that once we have some sort of common understanding about a particular approach. There are so many IO controllers floating, right now I am more concerned if we can all come to a common platform.
Quoted 8 lines
I understood the reason of posting the patch well.
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Thanks Ryo. Implementing a control at block layer sounds like another 2 level scheduling. We will still have the issue of breaking underlying CFQ and other schedulers. How to plan to resolve that conflict.
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
Thanks
Vivek
Quoted 28 lines · Ryo Tsuruta
Hi Vivek,
Sorry for late reply.
Quoted 11 lines
Quoted 8 lines
Quoted 3 lines
Do you have any benchmark results?
I'm especially interested in the followings:
- Comparison of disk performance with and without the I/O controller patch.If I dynamically disable the bio control, then I did not observe any impact on performance. Because in that case practically it boils down to just an additional variable check in
__make_request().Oh.., I understood your question wrong. You are looking for what's the performance penalty if I enable the IO controller on a device.
Yes, that is what I want to know.
Quoted 9 lines
I have not done any extensive benchmarking. If I run two dd commands without controller, I get 80MB/s from disk (roughly 40 MB for each task). With bio group enabled (default token=2000), I was getting total BW of roughly 68 MB/s.
I have not done any performance analysis or optimizations at this point of time. I plan to do that once we have some sort of common understanding about a particular approach. There are so many IO controllers floating, right now I am more concerned if we can all come to a common platform.
Quoted 8 lines
I understood the reason of posting the patch well.
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Thanks Ryo. Implementing a control at block layer sounds like another 2 level scheduling. We will still have the issue of breaking underlying CFQ and other schedulers. How to plan to resolve that conflict.
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
Thanks
Vivek
Quoted 28 lines · Ryo Tsuruta
Hi Vivek,
Sorry for late reply.
Quoted 11 lines
Quoted 8 lines
Quoted 3 lines
Do you have any benchmark results?
I'm especially interested in the followings:
- Comparison of disk performance with and without the I/O controller patch.If I dynamically disable the bio control, then I did not observe any impact on performance. Because in that case practically it boils down to just an additional variable check in
__make_request().Oh.., I understood your question wrong. You are looking for what's the performance penalty if I enable the IO controller on a device.
Yes, that is what I want to know.
Quoted 9 lines
I have not done any extensive benchmarking. If I run two dd commands without controller, I get 80MB/s from disk (roughly 40 MB for each task). With bio group enabled (default token=2000), I was getting total BW of roughly 68 MB/s.
I have not done any performance analysis or optimizations at this point of time. I plan to do that once we have some sort of common understanding about a particular approach. There are so many IO controllers floating, right now I am more concerned if we can all come to a common platform.
Quoted 8 lines
I understood the reason of posting the patch well.
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Thanks Ryo. Implementing a control at block layer sounds like another 2 level scheduling. We will still have the issue of breaking underlying CFQ and other schedulers. How to plan to resolve that conflict.
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
Thanks
Vivek
Hi Vivek,
Quoted 10 lines
Quoted 6 lines
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Thanks Ryo. Implementing a control at block layer sounds like another 2 level scheduling. We will still have the issue of breaking underlying CFQ and other schedulers. How to plan to resolve that conflict.
I think there is no conflict against I/O schedulers. Could you expain to me about the conflict?
Quoted 3 lines
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
I would like to support any type of block device even if I/Os issued to the underlying device doesn't go through IO scheduler. Dm-ioband can be made use of for the devices such as loop device.
Thanks,
Ryo Tsuruta
A message that is not in the archive (sent off-list or not yet received): 20081125.113359.623571555980951312.ryov-jCdQPDEk3idL9jVzuh4AOg@public.gmane.org
Quoted 9 lines · Ryo Tsuruta
Hi Vivek,
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Quoted 6 lines
Quoted 3 lines
Thanks Ryo. Implementing a control at block layer sounds like another 2 level scheduling. We will still have the issue of breaking underlying CFQ and other schedulers. How to plan to resolve that conflict.
I think there is no conflict against I/O schedulers. Could you expain to me about the conflict?
Because we do the buffering at higher level scheduler and mostly release the buffered bios in the FIFO order, it might break the underlying IO schedulers. Generally it is the decision of IO scheduler to determine in what order to release buffered bios.
For example, If there is one task of io priority 0 in a cgroup and rest of the tasks are of io prio 7. All the tasks belong to best effort class. If tasks of lower priority (7) do lot of IO, then due to buffering there is a chance that IO from lower prio tasks is seen by CFQ first and io from higher prio task is not seen by cfq for quite some time hence that task not getting it fair share with in the cgroup. Similiar situations can arise with RT tasks also.
Quoted 9 lines
Quoted 4 lines
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
I would like to support any type of block device even if I/Os issued to the underlying device doesn't go through IO scheduler. Dm-ioband can be made use of for the devices such as loop device.
What do you mean by that IO issued to underlying device does not go through IO scheduler? loop device will be associated with a file and IO will ultimately go to the IO scheduler which is serving those file blocks?
What's the use case scenario of doing IO control at loop device? Ultimately the resource contention will take place on actual underlying physical device where the file blocks are. Will doing the resource control there not solve the issue for you?
Thanks
Vivek
Quoted 9 lines · Ryo Tsuruta
Hi Vivek,
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Quoted 6 lines
Quoted 3 lines
Thanks Ryo. Implementing a control at block layer sounds like another 2 level scheduling. We will still have the issue of breaking underlying CFQ and other schedulers. How to plan to resolve that conflict.
I think there is no conflict against I/O schedulers. Could you expain to me about the conflict?
Because we do the buffering at higher level scheduler and mostly release the buffered bios in the FIFO order, it might break the underlying IO schedulers. Generally it is the decision of IO scheduler to determine in what order to release buffered bios.
For example, If there is one task of io priority 0 in a cgroup and rest of the tasks are of io prio 7. All the tasks belong to best effort class. If tasks of lower priority (7) do lot of IO, then due to buffering there is a chance that IO from lower prio tasks is seen by CFQ first and io from higher prio task is not seen by cfq for quite some time hence that task not getting it fair share with in the cgroup. Similiar situations can arise with RT tasks also.
Quoted 9 lines
Quoted 4 lines
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
I would like to support any type of block device even if I/Os issued to the underlying device doesn't go through IO scheduler. Dm-ioband can be made use of for the devices such as loop device.
What do you mean by that IO issued to underlying device does not go through IO scheduler? loop device will be associated with a file and IO will ultimately go to the IO scheduler which is serving those file blocks?
What's the use case scenario of doing IO control at loop device? Ultimately the resource contention will take place on actual underlying physical device where the file blocks are. Will doing the resource control there not solve the issue for you?
Thanks
Vivek
Quoted 9 lines · Ryo Tsuruta
Hi Vivek,
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Quoted 6 lines
Quoted 3 lines
Thanks Ryo. Implementing a control at block layer sounds like another 2 level scheduling. We will still have the issue of breaking underlying CFQ and other schedulers. How to plan to resolve that conflict.
I think there is no conflict against I/O schedulers. Could you expain to me about the conflict?
Because we do the buffering at higher level scheduler and mostly release the buffered bios in the FIFO order, it might break the underlying IO schedulers. Generally it is the decision of IO scheduler to determine in what order to release buffered bios.
For example, If there is one task of io priority 0 in a cgroup and rest of the tasks are of io prio 7. All the tasks belong to best effort class. If tasks of lower priority (7) do lot of IO, then due to buffering there is a chance that IO from lower prio tasks is seen by CFQ first and io from higher prio task is not seen by cfq for quite some time hence that task not getting it fair share with in the cgroup. Similiar situations can arise with RT tasks also.
Quoted 9 lines
Quoted 4 lines
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
I would like to support any type of block device even if I/Os issued to the underlying device doesn't go through IO scheduler. Dm-ioband can be made use of for the devices such as loop device.
What do you mean by that IO issued to underlying device does not go through IO scheduler? loop device will be associated with a file and IO will ultimately go to the IO scheduler which is serving those file blocks?
What's the use case scenario of doing IO control at loop device? Ultimately the resource contention will take place on actual underlying physical device where the file blocks are. Will doing the resource control there not solve the issue for you?
Thanks
Vivek
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 22 lines · Vivek Goyal
Quoted 9 lines · Ryo Tsuruta
Hi Vivek,
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Quoted 6 lines
Quoted 3 lines
Thanks Ryo. Implementing a control at block layer sounds like another 2 level scheduling. We will still have the issue of breaking underlying CFQ and other schedulers. How to plan to resolve that conflict.
I think there is no conflict against I/O schedulers. Could you expain to me about the conflict?
Because we do the buffering at higher level scheduler and mostly release the buffered bios in the FIFO order, it might break the underlying IO schedulers. Generally it is the decision of IO scheduler to determine in what order to release buffered bios.
Quoted 7 lines
For example, If there is one task of io priority 0 in a cgroup and rest of the tasks are of io prio 7. All the tasks belong to best effort class. If tasks of lower priority (7) do lot of IO, then due to buffering there is a chance that IO from lower prio tasks is seen by CFQ first and io from higher prio task is not seen by cfq for quite some time hence that task not getting it fair share with in the cgroup. Similiar situations can arise with RT tasks also.
Wouldn't even anticipation algorithms break if buffering is done at higher level? Our anticipation algorithms are tuned to model task's behavior. If IOs get buffer at a higher layer, all bets are off about anticipation.
Quoted 29 lines
Quoted 10 lines
Quoted 5 lines
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
I would like to support any type of block device even if I/Os issued to the underlying device doesn't go through IO scheduler. Dm-ioband can be made use of for the devices such as loop device.
What do you mean by that IO issued to underlying device does not go through IO scheduler? loop device will be associated with a file and IO will ultimately go to the IO scheduler which is serving those file blocks?
What's the use case scenario of doing IO control at loop device? Ultimately the resource contention will take place on actual underlying physical device where the file blocks are. Will doing the resource control there not solve the issue for you?
Thanks
Vivek
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Quoted 14 lines · Vivek Goyal
Quoted 13 lines · Ryo Tsuruta
Hi Vivek,
Quoted 10 lines
Quoted 6 lines
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Thanks Ryo. Implementing a control at block layer sounds like another 2 level scheduling. We will still have the issue of breaking underlying CFQ and other schedulers. How to plan to resolve that conflict.
Quoted 7 lines
Quoted 2 lines
I think there is no conflict against I/O schedulers. Could you expain to me about the conflict?
Because we do the buffering at higher level scheduler and mostly release the buffered bios in the FIFO order, it might break the underlying IO schedulers. Generally it is the decision of IO scheduler to determine in what order to release buffered bios.
It could be argued that the IO scheduler's primary goal is to maximize usage of the underlying device according to its physical characteristics. For hard disks this may imply minimizing time wasted by seeks; other types of devices, such as SSDs, may impose different requirements. This is something that clearly belongs in the elevator. On the other hand, it could be argued that other non-hardware-related scheduling disciplines would fit better in higher layers.
That said, as you pointed out such separation could impact performance, so we will probably need to implement a feedback mechanism between the elevator, which could collect statistics and provide hints, and the upper layers. The elevator API looks like a good candidate for this, though new functions might be needed.
Quoted 7 lines
For example, If there is one task of io priority 0 in a cgroup and rest of the tasks are of io prio 7. All the tasks belong to best effort class. If tasks of lower priority (7) do lot of IO, then due to buffering there is a chance that IO from lower prio tasks is seen by CFQ first and io from higher prio task is not seen by cfq for quite some time hence that task not getting it fair share with in the cgroup. Similiar situations can arise with RT tasks also.
Well, this issue is not intrinsic to dm-band and similar solutions. In the scenario you point out the problem is that the elevator and the IO controller are not cooperating. The same could happen even if we implemented everything at the elevator layer (or a little above): get hierarchical scheduling wrong and you are likely to have a rough ride.
BFQ deals with hierarchical scheduling at just one layer which makes things easier. BFQ chose the elevator layer, but a similar scheduling discipline could be implemented higher in the block layer too. The HW specific-bits we cannot take out the elevator, but when it comes to task/cgroup based scheduling there are more possibilities, which includes the middle-way approach we are discussing: two level scheduling.
The two level model is not bad per se, we just need to get the two levels to work in unison and for that we will certainly need to make changes to the existing elevators.
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
Quoted 8 lines
Quoted 3 lines
I would like to support any type of block device even if I/Os issued to the underlying device doesn't go through IO scheduler. Dm-ioband can be made use of for the devices such as loop device.
What do you mean by that IO issued to underlying device does not go through IO scheduler? loop device will be associated with a file and IO will ultimately go to the IO scheduler which is serving those file blocks?
I think that Tsuruta-san's point is that the loop device driver uses its own make_request_fn which means that bios entering a loop device do not necessarily go through a IO scheduler after that.
We will always find ourselves in this situation when trying to manage devices that provide their own make_request_fn, the reason being that its behavior is driver and configuration dependent: in the loop device case whether we go through a IO scheduler or not depends on what has been attached to it; in stacking device configurations the effect that the IO scheduling at one of the devices that constitute the multi-device will have in the aggregate throughput depends on the topology.
The only way I can think of to address all cases in a sane way is controlling the entry point to the block layer, which is precisely what dm-band does.
The problem with dm-band is that it relies on the dm infrastructure. In my opinion, if we could remove that dependency it would be a huge step in the right direction.
Quoted 1 line
What's the use case scenario of doing IO control at loop device?
My guess is virtualized machines using images exported as loop devices à la Xen's blktap (blktap's implementation is quite different from Linux' loop device, though).
Thanks,
Fernando
_______________________________________________
Containers mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/containers
Hi Vivek,
From: Vivek Goyal <[email protected]>
Subject: Re: [patch 0/4] [RFC] Another proportional weight IO controller
Date: Tue, 25 Nov 2008 11:27:20 -0500
Quoted 22 lines · Ryo Tsuruta
Quoted 9 lines
Hi Vivek,
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Quoted 6 lines
Quoted 3 lines
Thanks Ryo. Implementing a control at block layer sounds like another 2 level scheduling. We will still have the issue of breaking underlying CFQ and other schedulers. How to plan to resolve that conflict.
I think there is no conflict against I/O schedulers. Could you expain to me about the conflict?
Because we do the buffering at higher level scheduler and mostly release the buffered bios in the FIFO order, it might break the underlying IO schedulers. Generally it is the decision of IO scheduler to determine in what order to release buffered bios.
Quoted 7 lines
For example, If there is one task of io priority 0 in a cgroup and rest of the tasks are of io prio 7. All the tasks belong to best effort class. If tasks of lower priority (7) do lot of IO, then due to buffering there is a chance that IO from lower prio tasks is seen by CFQ first and io from higher prio task is not seen by cfq for quite some time hence that task not getting it fair share with in the cgroup. Similiar situations can arise with RT tasks also.
Thanks for your explanation.
I think that the same thing occurs without the higher level scheduler, because all the tasks issuing I/Os are blocked while the underlying device's request queue is full before those I/Os are sent to the I/O scheduler.
Quoted 9 lines
Quoted 8 lines
Quoted 3 lines
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
I would like to support any type of block device even if I/Os issued to the underlying device doesn't go through IO scheduler. Dm-ioband can be made use of for the devices such as loop device.
Quoted 4 lines
What do you mean by that IO issued to underlying device does not go through IO scheduler? loop device will be associated with a file and IO will ultimately go to the IO scheduler which is serving those file blocks?
How about if the files is on an NFS-mounted file system?
Quoted 4 lines
What's the use case scenario of doing IO control at loop device? Ultimately the resource contention will take place on actual underlying physical device where the file blocks are. Will doing the resource control there not solve the issue for you?
I don't come up with any use case, but I would like to make the resource controller more flexible. Actually, a certain block device that I'm using does not use the I/O scheduler.
Thanks,
Ryo Tsuruta
Quoted 22 lines · Vivek Goyal
Quoted 9 lines · Ryo Tsuruta
Hi Vivek,
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Quoted 6 lines
Quoted 3 lines
Thanks Ryo. Implementing a control at block layer sounds like another 2 level scheduling. We will still have the issue of breaking underlying CFQ and other schedulers. How to plan to resolve that conflict.
I think there is no conflict against I/O schedulers. Could you expain to me about the conflict?
Because we do the buffering at higher level scheduler and mostly release the buffered bios in the FIFO order, it might break the underlying IO schedulers. Generally it is the decision of IO scheduler to determine in what order to release buffered bios.
Quoted 7 lines
For example, If there is one task of io priority 0 in a cgroup and rest of the tasks are of io prio 7. All the tasks belong to best effort class. If tasks of lower priority (7) do lot of IO, then due to buffering there is a chance that IO from lower prio tasks is seen by CFQ first and io from higher prio task is not seen by cfq for quite some time hence that task not getting it fair share with in the cgroup. Similiar situations can arise with RT tasks also.
Wouldn't even anticipation algorithms break if buffering is done at higher level? Our anticipation algorithms are tuned to model task's behavior. If IOs get buffer at a higher layer, all bets are off about anticipation.
Quoted 29 lines
Quoted 10 lines
Quoted 5 lines
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
I would like to support any type of block device even if I/Os issued to the underlying device doesn't go through IO scheduler. Dm-ioband can be made use of for the devices such as loop device.
What do you mean by that IO issued to underlying device does not go through IO scheduler? loop device will be associated with a file and IO will ultimately go to the IO scheduler which is serving those file blocks?
What's the use case scenario of doing IO control at loop device? Ultimately the resource contention will take place on actual underlying physical device where the file blocks are. Will doing the resource control there not solve the issue for you?
Thanks
Vivek
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Quoted 22 lines · Vivek Goyal
Quoted 9 lines · Ryo Tsuruta
Hi Vivek,
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Quoted 6 lines
Quoted 3 lines
Thanks Ryo. Implementing a control at block layer sounds like another 2 level scheduling. We will still have the issue of breaking underlying CFQ and other schedulers. How to plan to resolve that conflict.
I think there is no conflict against I/O schedulers. Could you expain to me about the conflict?
Because we do the buffering at higher level scheduler and mostly release the buffered bios in the FIFO order, it might break the underlying IO schedulers. Generally it is the decision of IO scheduler to determine in what order to release buffered bios.
Quoted 7 lines
For example, If there is one task of io priority 0 in a cgroup and rest of the tasks are of io prio 7. All the tasks belong to best effort class. If tasks of lower priority (7) do lot of IO, then due to buffering there is a chance that IO from lower prio tasks is seen by CFQ first and io from higher prio task is not seen by cfq for quite some time hence that task not getting it fair share with in the cgroup. Similiar situations can arise with RT tasks also.
Wouldn't even anticipation algorithms break if buffering is done at higher level? Our anticipation algorithms are tuned to model task's behavior. If IOs get buffer at a higher layer, all bets are off about anticipation.
Quoted 29 lines
Quoted 10 lines
Quoted 5 lines
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
I would like to support any type of block device even if I/Os issued to the underlying device doesn't go through IO scheduler. Dm-ioband can be made use of for the devices such as loop device.
What do you mean by that IO issued to underlying device does not go through IO scheduler? loop device will be associated with a file and IO will ultimately go to the IO scheduler which is serving those file blocks?
What's the use case scenario of doing IO control at loop device? Ultimately the resource contention will take place on actual underlying physical device where the file blocks are. Will doing the resource control there not solve the issue for you?
Thanks
Vivek
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
A message that is not in the archive (sent off-list or not yet received): e98e18940811251438v245f79aegfdc92bee737af64c-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Fabio and I are a little bit worried about the fact that the problem of working in the time domain instead of the service domain is not being properly dealt with. Probably we did not express ourselves very clearly, so we will try to put in more practical terms. Using B-WF2Q+ in the time domain instead of using CFQ (Round-Robin) means introducing higher complexity than CFQ to get almost the same service properties of CFQ. With regard to fairness (long term) B-WF2Q+ in the time domain has exactly the same (un)fairness problems of CFQ. As far as bandwidth differentiation is concerned, it can be obtained with CFQ by just increasing the time slice (e.g., double weight => double slice). This has no impact on long term guarantees and certainly does not decrease the throughput.
With regard to short term guarantees (request completion time), one of the properties of the reference ideal system of Wf2Q+ is that, assuming for simplicity that all the queues have the same weight, as the ideal system serves each queue at the same speed, shorter budgets are completed in a shorter time intervals than longer budgets. B-WF2Q+ guarantees O(1) deviation from this ideal service. Hence, the tight delay/jitter measured in our experiments with BFQ is a consequence of the simple (and probably still improvable) budget assignment mechanism of (the overall) BFQ. In contrast, if all the budgets are equal, as it happens if we use time slices, the resulting scheduler is exactly a Round-Robin, again as in CFQ (see [1]).
Finally, with regard to completion time delay differentiation through weight differentiation, this is probably the only case in which B-WF2Q+ would perform better than CFQ, because, in case of CFQ, reducing the time slices may reduce the throughput, whereas increasing the time slice would increase the worst-case delay/jitter.
In the end, BFQ succeeds in guaranteeing fairness (or in general the desired bandwidth distribution) because it works in the service domain (and this is probably the only way to achieve this goal), not because it uses WF2Q+ instead of Round-Robin. Similarly, it provides tight delay/jitter only because B-WF2Q+ is used in combination with a simple budget assignment (differentiation) mechanism (again in the service domain).
[1] http://feanor.sssup.it/~fabio/linux/bfq/results.php
Signature · 8 lines
----------------------------------------------------------- | Paolo Valente | | | Algogroup | | | Dip. Ing. Informazione | tel: +39 059 2056318 | | Via Vignolese 905/b | fax: +39 059 2056199 | | 41100 Modena | | | home: http://algo.ing.unimo.it/people/paolo/ | -----------------------------------------------------------
Fabio and I are a little bit worried about the fact that the problem of working in the time domain instead of the service domain is not being properly dealt with. Probably we did not express ourselves very clearly, so we will try to put in more practical terms. Using B-WF2Q+ in the time domain instead of using CFQ (Round-Robin) means introducing higher complexity than CFQ to get almost the same service properties of CFQ. With regard to fairness (long term) B-WF2Q+ in the time domain has exactly the same (un)fairness problems of CFQ. As far as bandwidth differentiation is concerned, it can be obtained with CFQ by just increasing the time slice (e.g., double weight => double slice). This has no impact on long term guarantees and certainly does not decrease the throughput.
With regard to short term guarantees (request completion time), one of the properties of the reference ideal system of Wf2Q+ is that, assuming for simplicity that all the queues have the same weight, as the ideal system serves each queue at the same speed, shorter budgets are completed in a shorter time intervals than longer budgets. B-WF2Q+ guarantees O(1) deviation from this ideal service. Hence, the tight delay/jitter measured in our experiments with BFQ is a consequence of the simple (and probably still improvable) budget assignment mechanism of (the overall) BFQ. In contrast, if all the budgets are equal, as it happens if we use time slices, the resulting scheduler is exactly a Round-Robin, again as in CFQ (see [1]).
Finally, with regard to completion time delay differentiation through weight differentiation, this is probably the only case in which B-WF2Q+ would perform better than CFQ, because, in case of CFQ, reducing the time slices may reduce the throughput, whereas increasing the time slice would increase the worst-case delay/jitter.
In the end, BFQ succeeds in guaranteeing fairness (or in general the desired bandwidth distribution) because it works in the service domain (and this is probably the only way to achieve this goal), not because it uses WF2Q+ instead of Round-Robin. Similarly, it provides tight delay/jitter only because B-WF2Q+ is used in combination with a simple budget assignment (differentiation) mechanism (again in the service domain).
[1] http://feanor.sssup.it/~fabio/linux/bfq/results.php
Signature · 8 lines
----------------------------------------------------------- | Paolo Valente | | | Algogroup | | | Dip. Ing. Informazione | tel: +39 059 2056318 | | Via Vignolese 905/b | fax: +39 059 2056199 | | 41100 Modena | | | home: http://algo.ing.unimo.it/people/paolo/ | -----------------------------------------------------------
Fabio and I are a little bit worried about the fact that the problem of working in the time domain instead of the service domain is not being properly dealt with. Probably we did not express ourselves very clearly, so we will try to put in more practical terms. Using B-WF2Q+ in the time domain instead of using CFQ (Round-Robin) means introducing higher complexity than CFQ to get almost the same service properties of CFQ. With regard to fairness (long term) B-WF2Q+ in the time domain has exactly the same (un)fairness problems of CFQ. As far as bandwidth differentiation is concerned, it can be obtained with CFQ by just increasing the time slice (e.g., double weight => double slice). This has no impact on long term guarantees and certainly does not decrease the throughput.
With regard to short term guarantees (request completion time), one of the properties of the reference ideal system of Wf2Q+ is that, assuming for simplicity that all the queues have the same weight, as the ideal system serves each queue at the same speed, shorter budgets are completed in a shorter time intervals than longer budgets. B-WF2Q+ guarantees O(1) deviation from this ideal service. Hence, the tight delay/jitter measured in our experiments with BFQ is a consequence of the simple (and probably still improvable) budget assignment mechanism of (the overall) BFQ. In contrast, if all the budgets are equal, as it happens if we use time slices, the resulting scheduler is exactly a Round-Robin, again as in CFQ (see [1]).
Finally, with regard to completion time delay differentiation through weight differentiation, this is probably the only case in which B-WF2Q+ would perform better than CFQ, because, in case of CFQ, reducing the time slices may reduce the throughput, whereas increasing the time slice would increase the worst-case delay/jitter.
In the end, BFQ succeeds in guaranteeing fairness (or in general the desired bandwidth distribution) because it works in the service domain (and this is probably the only way to achieve this goal), not because it uses WF2Q+ instead of Round-Robin. Similarly, it provides tight delay/jitter only because B-WF2Q+ is used in combination with a simple budget assignment (differentiation) mechanism (again in the service domain).
[1] http://feanor.sssup.it/~fabio/linux/bfq/results.php
Signature · 8 lines
----------------------------------------------------------- | Paolo Valente | | | Algogroup | | | Dip. Ing. Informazione | tel: +39 059 2056318 | | Via Vignolese 905/b | fax: +39 059 2056199 | | 41100 Modena | | | home: http://algo.ing.unimo.it/people/paolo/ | -----------------------------------------------------------
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 7 lines · Paolo Valente
Fabio and I are a little bit worried about the fact that the problem of working in the time domain instead of the service domain is not being properly dealt with. Probably we did not express ourselves very clearly, so we will try to put in more practical terms. Using B-WF2Q+ in the time domain instead of using CFQ (Round-Robin) means introducing higher complexity than CFQ to get almost the same service properties of CFQ. With regard to fairness (long term) B-WF2Q+ in the time domain
Are we talking about a case where all the contenders have equal weights and are continuously backlogged? That seems to be the only case when B-WF2Q+ would behave like Round-Robin. Am I missing something here?
I can see that the only direct advantage of using WF2Q+ scheduling is reduced jitter or latency in certain cases. But under heavy loads, that might result in request latencies seen by RT threads to be reduced from a few seconds to a few msec.
Quoted 6 lines
has exactly the same (un)fairness problems of CFQ. As far as bandwidth differentiation is concerned, it can be obtained with CFQ by just increasing the time slice (e.g., double weight => double slice). This has no impact on long term guarantees and certainly does not decrease the throughput.
Quoted 11 lines
With regard to short term guarantees (request completion time), one of the properties of the reference ideal system of Wf2Q+ is that, assuming for simplicity that all the queues have the same weight, as the ideal system serves each queue at the same speed, shorter budgets are completed in a shorter time intervals than longer budgets. B-WF2Q+ guarantees O(1) deviation from this ideal service. Hence, the tight delay/jitter measured in our experiments with BFQ is a consequence of the simple (and probably still improvable) budget assignment mechanism of (the overall) BFQ. In contrast, if all the budgets are equal, as it happens if we use time slices, the resulting scheduler is exactly a Round-Robin, again as in CFQ (see [1]).
Can the budget assignment mechanism of BFQ be converted to time slice assignment mechanism? What I am trying to say here is that we can have variable time slices, just like we have variable budgets.
Quoted 28 lines
Finally, with regard to completion time delay differentiation through weight differentiation, this is probably the only case in which B-WF2Q+ would perform better than CFQ, because, in case of CFQ, reducing the time slices may reduce the throughput, whereas increasing the time slice would increase the worst-case delay/jitter.
In the end, BFQ succeeds in guaranteeing fairness (or in general the desired bandwidth distribution) because it works in the service domain (and this is probably the only way to achieve this goal), not because it uses WF2Q+ instead of Round-Robin. Similarly, it provides tight delay/jitter only because B-WF2Q+ is used in combination with a simple budget assignment (differentiation) mechanism (again in the service domain).
[1] http://feanor.sssup.it/~fabio/linux/bfq/results.php
--
-----------------------------------------------------------| Paolo Valente | | | Algogroup | | | Dip. Ing. Informazione | tel: +39 059 2056318 | | Via Vignolese 905/b | fax: +39 059 2056199 | | 41100 Modena | | | home: http://algo.ing.unimo.it/people/paolo/ |-----------------------------------------------------------
Quoted 7 lines · Paolo Valente
Fabio and I are a little bit worried about the fact that the problem of working in the time domain instead of the service domain is not being properly dealt with. Probably we did not express ourselves very clearly, so we will try to put in more practical terms. Using B-WF2Q+ in the time domain instead of using CFQ (Round-Robin) means introducing higher complexity than CFQ to get almost the same service properties of CFQ. With regard to fairness (long term) B-WF2Q+ in the time domain
Are we talking about a case where all the contenders have equal weights and are continuously backlogged? That seems to be the only case when B-WF2Q+ would behave like Round-Robin. Am I missing something here?
I can see that the only direct advantage of using WF2Q+ scheduling is reduced jitter or latency in certain cases. But under heavy loads, that might result in request latencies seen by RT threads to be reduced from a few seconds to a few msec.
Quoted 6 lines
has exactly the same (un)fairness problems of CFQ. As far as bandwidth differentiation is concerned, it can be obtained with CFQ by just increasing the time slice (e.g., double weight => double slice). This has no impact on long term guarantees and certainly does not decrease the throughput.
Quoted 11 lines
With regard to short term guarantees (request completion time), one of the properties of the reference ideal system of Wf2Q+ is that, assuming for simplicity that all the queues have the same weight, as the ideal system serves each queue at the same speed, shorter budgets are completed in a shorter time intervals than longer budgets. B-WF2Q+ guarantees O(1) deviation from this ideal service. Hence, the tight delay/jitter measured in our experiments with BFQ is a consequence of the simple (and probably still improvable) budget assignment mechanism of (the overall) BFQ. In contrast, if all the budgets are equal, as it happens if we use time slices, the resulting scheduler is exactly a Round-Robin, again as in CFQ (see [1]).
Can the budget assignment mechanism of BFQ be converted to time slice assignment mechanism? What I am trying to say here is that we can have variable time slices, just like we have variable budgets.
Quoted 28 lines
Finally, with regard to completion time delay differentiation through weight differentiation, this is probably the only case in which B-WF2Q+ would perform better than CFQ, because, in case of CFQ, reducing the time slices may reduce the throughput, whereas increasing the time slice would increase the worst-case delay/jitter.
In the end, BFQ succeeds in guaranteeing fairness (or in general the desired bandwidth distribution) because it works in the service domain (and this is probably the only way to achieve this goal), not because it uses WF2Q+ instead of Round-Robin. Similarly, it provides tight delay/jitter only because B-WF2Q+ is used in combination with a simple budget assignment (differentiation) mechanism (again in the service domain).
[1] http://feanor.sssup.it/~fabio/linux/bfq/results.php
--
-----------------------------------------------------------| Paolo Valente | | | Algogroup | | | Dip. Ing. Informazione | tel: +39 059 2056318 | | Via Vignolese 905/b | fax: +39 059 2056199 | | 41100 Modena | | | home: http://algo.ing.unimo.it/people/paolo/ |-----------------------------------------------------------
Quoted 7 lines · Paolo Valente
Fabio and I are a little bit worried about the fact that the problem of working in the time domain instead of the service domain is not being properly dealt with. Probably we did not express ourselves very clearly, so we will try to put in more practical terms. Using B-WF2Q+ in the time domain instead of using CFQ (Round-Robin) means introducing higher complexity than CFQ to get almost the same service properties of CFQ. With regard to fairness (long term) B-WF2Q+ in the time domain
Are we talking about a case where all the contenders have equal weights and are continuously backlogged? That seems to be the only case when B-WF2Q+ would behave like Round-Robin. Am I missing something here?
I can see that the only direct advantage of using WF2Q+ scheduling is reduced jitter or latency in certain cases. But under heavy loads, that might result in request latencies seen by RT threads to be reduced from a few seconds to a few msec.
Quoted 6 lines
has exactly the same (un)fairness problems of CFQ. As far as bandwidth differentiation is concerned, it can be obtained with CFQ by just increasing the time slice (e.g., double weight => double slice). This has no impact on long term guarantees and certainly does not decrease the throughput.
Quoted 11 lines
With regard to short term guarantees (request completion time), one of the properties of the reference ideal system of Wf2Q+ is that, assuming for simplicity that all the queues have the same weight, as the ideal system serves each queue at the same speed, shorter budgets are completed in a shorter time intervals than longer budgets. B-WF2Q+ guarantees O(1) deviation from this ideal service. Hence, the tight delay/jitter measured in our experiments with BFQ is a consequence of the simple (and probably still improvable) budget assignment mechanism of (the overall) BFQ. In contrast, if all the budgets are equal, as it happens if we use time slices, the resulting scheduler is exactly a Round-Robin, again as in CFQ (see [1]).
Can the budget assignment mechanism of BFQ be converted to time slice assignment mechanism? What I am trying to say here is that we can have variable time slices, just like we have variable budgets.
Quoted 28 lines
Finally, with regard to completion time delay differentiation through weight differentiation, this is probably the only case in which B-WF2Q+ would perform better than CFQ, because, in case of CFQ, reducing the time slices may reduce the throughput, whereas increasing the time slice would increase the worst-case delay/jitter.
In the end, BFQ succeeds in guaranteeing fairness (or in general the desired bandwidth distribution) because it works in the service domain (and this is probably the only way to achieve this goal), not because it uses WF2Q+ instead of Round-Robin. Similarly, it provides tight delay/jitter only because B-WF2Q+ is used in combination with a simple budget assignment (differentiation) mechanism (again in the service domain).
[1] http://feanor.sssup.it/~fabio/linux/bfq/results.php
--
-----------------------------------------------------------| Paolo Valente | | | Algogroup | | | Dip. Ing. Informazione | tel: +39 059 2056318 | | Via Vignolese 905/b | fax: +39 059 2056199 | | 41100 Modena | | | home: http://algo.ing.unimo.it/people/paolo/ |-----------------------------------------------------------
Quoted 12 lines
From: Nauman Rafique <[email protected]>
Date: Wed, Nov 26, 2008 11:41:46AM -0800Quoted 7 lines · Paolo Valente
Fabio and I are a little bit worried about the fact that the problem of working in the time domain instead of the service domain is not being properly dealt with. Probably we did not express ourselves very clearly, so we will try to put in more practical terms. Using B-WF2Q+ in the time domain instead of using CFQ (Round-Robin) means introducing higher complexity than CFQ to get almost the same service properties of CFQ. With regard to fairness (long term) B-WF2Q+ in the time domain
Quoted 5 lines
Are we talking about a case where all the contenders have equal weights and are continuously backlogged? That seems to be the only case when B-WF2Q+ would behave like Round-Robin. Am I missing something here?
It is the case with equal weights, but it is really a common one.
Quoted 23 lines
I can see that the only direct advantage of using WF2Q+ scheduling is reduced jitter or latency in certain cases. But under heavy loads, that might result in request latencies seen by RT threads to be reduced from a few seconds to a few msec.
Quoted 6 lines
has exactly the same (un)fairness problems of CFQ. As far as bandwidth differentiation is concerned, it can be obtained with CFQ by just increasing the time slice (e.g., double weight => double slice). This has no impact on long term guarantees and certainly does not decrease the throughput.
Quoted 11 lines
With regard to short term guarantees (request completion time), one of the properties of the reference ideal system of Wf2Q+ is that, assuming for simplicity that all the queues have the same weight, as the ideal system serves each queue at the same speed, shorter budgets are completed in a shorter time intervals than longer budgets. B-WF2Q+ guarantees O(1) deviation from this ideal service. Hence, the tight delay/jitter measured in our experiments with BFQ is a consequence of the simple (and probably still improvable) budget assignment mechanism of (the overall) BFQ. In contrast, if all the budgets are equal, as it happens if we use time slices, the resulting scheduler is exactly a Round-Robin, again as in CFQ (see [1]).
Quoted 4 lines
Can the budget assignment mechanism of BFQ be converted to time slice assignment mechanism? What I am trying to say here is that we can have variable time slices, just like we have variable budgets.
Yes, it could be converted, and it would do in the time domain the same differentiation it does now in the service domain. What we would lose in the process is the fairness in the service domain. The service properties/guarantees of the resulting scheduler would _not_ be the same as the BFQ ones. Both long term and short term guarantees would be affected by the unfairness given by the different service rate experienced by the scheduled entities.
Quoted 28 lines
Quoted 28 lines
Finally, with regard to completion time delay differentiation through weight differentiation, this is probably the only case in which B-WF2Q+ would perform better than CFQ, because, in case of CFQ, reducing the time slices may reduce the throughput, whereas increasing the time slice would increase the worst-case delay/jitter.
In the end, BFQ succeeds in guaranteeing fairness (or in general the desired bandwidth distribution) because it works in the service domain (and this is probably the only way to achieve this goal), not because it uses WF2Q+ instead of Round-Robin. Similarly, it provides tight delay/jitter only because B-WF2Q+ is used in combination with a simple budget assignment (differentiation) mechanism (again in the service domain).
[1] http://feanor.sssup.it/~fabio/linux/bfq/results.php
--
-----------------------------------------------------------| Paolo Valente | | | Algogroup | | | Dip. Ing. Informazione | tel: +39 059 2056318 | | Via Vignolese 905/b | fax: +39 059 2056199 | | 41100 Modena | | | home: http://algo.ing.unimo.it/people/paolo/ |-----------------------------------------------------------
A message that is not in the archive (sent off-list or not yet received): e98e18940811261141x307cf06fldd5e481e85da5c2d-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 12 lines
From: Nauman Rafique <[email protected]>
Date: Wed, Nov 26, 2008 11:41:46AM -0800Quoted 7 lines · Paolo Valente
Fabio and I are a little bit worried about the fact that the problem of working in the time domain instead of the service domain is not being properly dealt with. Probably we did not express ourselves very clearly, so we will try to put in more practical terms. Using B-WF2Q+ in the time domain instead of using CFQ (Round-Robin) means introducing higher complexity than CFQ to get almost the same service properties of CFQ. With regard to fairness (long term) B-WF2Q+ in the time domain
Quoted 5 lines
Are we talking about a case where all the contenders have equal weights and are continuously backlogged? That seems to be the only case when B-WF2Q+ would behave like Round-Robin. Am I missing something here?
It is the case with equal weights, but it is really a common one.
Quoted 23 lines
I can see that the only direct advantage of using WF2Q+ scheduling is reduced jitter or latency in certain cases. But under heavy loads, that might result in request latencies seen by RT threads to be reduced from a few seconds to a few msec.
Quoted 6 lines
has exactly the same (un)fairness problems of CFQ. As far as bandwidth differentiation is concerned, it can be obtained with CFQ by just increasing the time slice (e.g., double weight => double slice). This has no impact on long term guarantees and certainly does not decrease the throughput.
Quoted 11 lines
With regard to short term guarantees (request completion time), one of the properties of the reference ideal system of Wf2Q+ is that, assuming for simplicity that all the queues have the same weight, as the ideal system serves each queue at the same speed, shorter budgets are completed in a shorter time intervals than longer budgets. B-WF2Q+ guarantees O(1) deviation from this ideal service. Hence, the tight delay/jitter measured in our experiments with BFQ is a consequence of the simple (and probably still improvable) budget assignment mechanism of (the overall) BFQ. In contrast, if all the budgets are equal, as it happens if we use time slices, the resulting scheduler is exactly a Round-Robin, again as in CFQ (see [1]).
Quoted 4 lines
Can the budget assignment mechanism of BFQ be converted to time slice assignment mechanism? What I am trying to say here is that we can have variable time slices, just like we have variable budgets.
Yes, it could be converted, and it would do in the time domain the same differentiation it does now in the service domain. What we would lose in the process is the fairness in the service domain. The service properties/guarantees of the resulting scheduler would _not_ be the same as the BFQ ones. Both long term and short term guarantees would be affected by the unfairness given by the different service rate experienced by the scheduled entities.
Quoted 28 lines
Quoted 28 lines
Finally, with regard to completion time delay differentiation through weight differentiation, this is probably the only case in which B-WF2Q+ would perform better than CFQ, because, in case of CFQ, reducing the time slices may reduce the throughput, whereas increasing the time slice would increase the worst-case delay/jitter.
In the end, BFQ succeeds in guaranteeing fairness (or in general the desired bandwidth distribution) because it works in the service domain (and this is probably the only way to achieve this goal), not because it uses WF2Q+ instead of Round-Robin. Similarly, it provides tight delay/jitter only because B-WF2Q+ is used in combination with a simple budget assignment (differentiation) mechanism (again in the service domain).
[1] http://feanor.sssup.it/~fabio/linux/bfq/results.php
--
-----------------------------------------------------------| Paolo Valente | | | Algogroup | | | Dip. Ing. Informazione | tel: +39 059 2056318 | | Via Vignolese 905/b | fax: +39 059 2056199 | | 41100 Modena | | | home: http://algo.ing.unimo.it/people/paolo/ |-----------------------------------------------------------
Quoted 12 lines
From: Nauman Rafique <[email protected]>
Date: Wed, Nov 26, 2008 11:41:46AM -0800Quoted 7 lines · Paolo Valente
Fabio and I are a little bit worried about the fact that the problem of working in the time domain instead of the service domain is not being properly dealt with. Probably we did not express ourselves very clearly, so we will try to put in more practical terms. Using B-WF2Q+ in the time domain instead of using CFQ (Round-Robin) means introducing higher complexity than CFQ to get almost the same service properties of CFQ. With regard to fairness (long term) B-WF2Q+ in the time domain
Quoted 5 lines
Are we talking about a case where all the contenders have equal weights and are continuously backlogged? That seems to be the only case when B-WF2Q+ would behave like Round-Robin. Am I missing something here?
It is the case with equal weights, but it is really a common one.
Quoted 23 lines
I can see that the only direct advantage of using WF2Q+ scheduling is reduced jitter or latency in certain cases. But under heavy loads, that might result in request latencies seen by RT threads to be reduced from a few seconds to a few msec.
Quoted 6 lines
has exactly the same (un)fairness problems of CFQ. As far as bandwidth differentiation is concerned, it can be obtained with CFQ by just increasing the time slice (e.g., double weight => double slice). This has no impact on long term guarantees and certainly does not decrease the throughput.
Quoted 11 lines
With regard to short term guarantees (request completion time), one of the properties of the reference ideal system of Wf2Q+ is that, assuming for simplicity that all the queues have the same weight, as the ideal system serves each queue at the same speed, shorter budgets are completed in a shorter time intervals than longer budgets. B-WF2Q+ guarantees O(1) deviation from this ideal service. Hence, the tight delay/jitter measured in our experiments with BFQ is a consequence of the simple (and probably still improvable) budget assignment mechanism of (the overall) BFQ. In contrast, if all the budgets are equal, as it happens if we use time slices, the resulting scheduler is exactly a Round-Robin, again as in CFQ (see [1]).
Quoted 4 lines
Can the budget assignment mechanism of BFQ be converted to time slice assignment mechanism? What I am trying to say here is that we can have variable time slices, just like we have variable budgets.
Yes, it could be converted, and it would do in the time domain the same differentiation it does now in the service domain. What we would lose in the process is the fairness in the service domain. The service properties/guarantees of the resulting scheduler would _not_ be the same as the BFQ ones. Both long term and short term guarantees would be affected by the unfairness given by the different service rate experienced by the scheduled entities.
Quoted 28 lines
Quoted 28 lines
Finally, with regard to completion time delay differentiation through weight differentiation, this is probably the only case in which B-WF2Q+ would perform better than CFQ, because, in case of CFQ, reducing the time slices may reduce the throughput, whereas increasing the time slice would increase the worst-case delay/jitter.
In the end, BFQ succeeds in guaranteeing fairness (or in general the desired bandwidth distribution) because it works in the service domain (and this is probably the only way to achieve this goal), not because it uses WF2Q+ instead of Round-Robin. Similarly, it provides tight delay/jitter only because B-WF2Q+ is used in combination with a simple budget assignment (differentiation) mechanism (again in the service domain).
[1] http://feanor.sssup.it/~fabio/linux/bfq/results.php
--
-----------------------------------------------------------| Paolo Valente | | | Algogroup | | | Dip. Ing. Informazione | tel: +39 059 2056318 | | Via Vignolese 905/b | fax: +39 059 2056199 | | 41100 Modena | | | home: http://algo.ing.unimo.it/people/paolo/ |-----------------------------------------------------------
Quoted 14 lines · Vivek Goyal
Quoted 13 lines · Ryo Tsuruta
Hi Vivek,
Quoted 10 lines
Quoted 6 lines
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Thanks Ryo. Implementing a control at block layer sounds like another 2 level scheduling. We will still have the issue of breaking underlying CFQ and other schedulers. How to plan to resolve that conflict.
Quoted 7 lines
Quoted 2 lines
I think there is no conflict against I/O schedulers. Could you expain to me about the conflict?
Because we do the buffering at higher level scheduler and mostly release the buffered bios in the FIFO order, it might break the underlying IO schedulers. Generally it is the decision of IO scheduler to determine in what order to release buffered bios.
It could be argued that the IO scheduler's primary goal is to maximize usage of the underlying device according to its physical characteristics. For hard disks this may imply minimizing time wasted by seeks; other types of devices, such as SSDs, may impose different requirements. This is something that clearly belongs in the elevator. On the other hand, it could be argued that other non-hardware-related scheduling disciplines would fit better in higher layers.
That said, as you pointed out such separation could impact performance, so we will probably need to implement a feedback mechanism between the elevator, which could collect statistics and provide hints, and the upper layers. The elevator API looks like a good candidate for this, though new functions might be needed.
Quoted 7 lines
For example, If there is one task of io priority 0 in a cgroup and rest of the tasks are of io prio 7. All the tasks belong to best effort class. If tasks of lower priority (7) do lot of IO, then due to buffering there is a chance that IO from lower prio tasks is seen by CFQ first and io from higher prio task is not seen by cfq for quite some time hence that task not getting it fair share with in the cgroup. Similiar situations can arise with RT tasks also.
Well, this issue is not intrinsic to dm-band and similar solutions. In the scenario you point out the problem is that the elevator and the IO controller are not cooperating. The same could happen even if we implemented everything at the elevator layer (or a little above): get hierarchical scheduling wrong and you are likely to have a rough ride.
BFQ deals with hierarchical scheduling at just one layer which makes things easier. BFQ chose the elevator layer, but a similar scheduling discipline could be implemented higher in the block layer too. The HW specific-bits we cannot take out the elevator, but when it comes to task/cgroup based scheduling there are more possibilities, which includes the middle-way approach we are discussing: two level scheduling.
The two level model is not bad per se, we just need to get the two levels to work in unison and for that we will certainly need to make changes to the existing elevators.
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
Quoted 8 lines
Quoted 3 lines
I would like to support any type of block device even if I/Os issued to the underlying device doesn't go through IO scheduler. Dm-ioband can be made use of for the devices such as loop device.
What do you mean by that IO issued to underlying device does not go through IO scheduler? loop device will be associated with a file and IO will ultimately go to the IO scheduler which is serving those file blocks?
I think that Tsuruta-san's point is that the loop device driver uses its own make_request_fn which means that bios entering a loop device do not necessarily go through a IO scheduler after that.
We will always find ourselves in this situation when trying to manage devices that provide their own make_request_fn, the reason being that its behavior is driver and configuration dependent: in the loop device case whether we go through a IO scheduler or not depends on what has been attached to it; in stacking device configurations the effect that the IO scheduling at one of the devices that constitute the multi-device will have in the aggregate throughput depends on the topology.
The only way I can think of to address all cases in a sane way is controlling the entry point to the block layer, which is precisely what dm-band does.
The problem with dm-band is that it relies on the dm infrastructure. In my opinion, if we could remove that dependency it would be a huge step in the right direction.
Quoted 1 line
What's the use case scenario of doing IO control at loop device?
My guess is virtualized machines using images exported as loop devices à la Xen's blktap (blktap's implementation is quite different from Linux' loop device, though).
Thanks,
Fernando
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/virtualization
Quoted 14 lines · Vivek Goyal
Quoted 13 lines · Ryo Tsuruta
Hi Vivek,
Quoted 10 lines
Quoted 6 lines
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Thanks Ryo. Implementing a control at block layer sounds like another 2 level scheduling. We will still have the issue of breaking underlying CFQ and other schedulers. How to plan to resolve that conflict.
Quoted 7 lines
Quoted 2 lines
I think there is no conflict against I/O schedulers. Could you expain to me about the conflict?
Because we do the buffering at higher level scheduler and mostly release the buffered bios in the FIFO order, it might break the underlying IO schedulers. Generally it is the decision of IO scheduler to determine in what order to release buffered bios.
It could be argued that the IO scheduler's primary goal is to maximize usage of the underlying device according to its physical characteristics. For hard disks this may imply minimizing time wasted by seeks; other types of devices, such as SSDs, may impose different requirements. This is something that clearly belongs in the elevator. On the other hand, it could be argued that other non-hardware-related scheduling disciplines would fit better in higher layers.
That said, as you pointed out such separation could impact performance, so we will probably need to implement a feedback mechanism between the elevator, which could collect statistics and provide hints, and the upper layers. The elevator API looks like a good candidate for this, though new functions might be needed.
Quoted 7 lines
For example, If there is one task of io priority 0 in a cgroup and rest of the tasks are of io prio 7. All the tasks belong to best effort class. If tasks of lower priority (7) do lot of IO, then due to buffering there is a chance that IO from lower prio tasks is seen by CFQ first and io from higher prio task is not seen by cfq for quite some time hence that task not getting it fair share with in the cgroup. Similiar situations can arise with RT tasks also.
Well, this issue is not intrinsic to dm-band and similar solutions. In the scenario you point out the problem is that the elevator and the IO controller are not cooperating. The same could happen even if we implemented everything at the elevator layer (or a little above): get hierarchical scheduling wrong and you are likely to have a rough ride.
BFQ deals with hierarchical scheduling at just one layer which makes things easier. BFQ chose the elevator layer, but a similar scheduling discipline could be implemented higher in the block layer too. The HW specific-bits we cannot take out the elevator, but when it comes to task/cgroup based scheduling there are more possibilities, which includes the middle-way approach we are discussing: two level scheduling.
The two level model is not bad per se, we just need to get the two levels to work in unison and for that we will certainly need to make changes to the existing elevators.
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
Quoted 8 lines
Quoted 3 lines
I would like to support any type of block device even if I/Os issued to the underlying device doesn't go through IO scheduler. Dm-ioband can be made use of for the devices such as loop device.
What do you mean by that IO issued to underlying device does not go through IO scheduler? loop device will be associated with a file and IO will ultimately go to the IO scheduler which is serving those file blocks?
I think that Tsuruta-san's point is that the loop device driver uses its own make_request_fn which means that bios entering a loop device do not necessarily go through a IO scheduler after that.
We will always find ourselves in this situation when trying to manage devices that provide their own make_request_fn, the reason being that its behavior is driver and configuration dependent: in the loop device case whether we go through a IO scheduler or not depends on what has been attached to it; in stacking device configurations the effect that the IO scheduling at one of the devices that constitute the multi-device will have in the aggregate throughput depends on the topology.
The only way I can think of to address all cases in a sane way is controlling the entry point to the block layer, which is precisely what dm-band does.
The problem with dm-band is that it relies on the dm infrastructure. In my opinion, if we could remove that dependency it would be a huge step in the right direction.
Quoted 1 line
What's the use case scenario of doing IO control at loop device?
My guess is virtualized machines using images exported as loop devices à la Xen's blktap (blktap's implementation is quite different from Linux' loop device, though).
Thanks,
Fernando
Hi Vivek,
From: Vivek Goyal <[email protected]>
Subject: Re: [patch 0/4] [RFC] Another proportional weight IO controller
Date: Tue, 25 Nov 2008 11:27:20 -0500
Quoted 22 lines · Ryo Tsuruta
Quoted 9 lines
Hi Vivek,
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Quoted 6 lines
Quoted 3 lines
Thanks Ryo. Implementing a control at block layer sounds like another 2 level scheduling. We will still have the issue of breaking underlying CFQ and other schedulers. How to plan to resolve that conflict.
I think there is no conflict against I/O schedulers. Could you expain to me about the conflict?
Because we do the buffering at higher level scheduler and mostly release the buffered bios in the FIFO order, it might break the underlying IO schedulers. Generally it is the decision of IO scheduler to determine in what order to release buffered bios.
Quoted 7 lines
For example, If there is one task of io priority 0 in a cgroup and rest of the tasks are of io prio 7. All the tasks belong to best effort class. If tasks of lower priority (7) do lot of IO, then due to buffering there is a chance that IO from lower prio tasks is seen by CFQ first and io from higher prio task is not seen by cfq for quite some time hence that task not getting it fair share with in the cgroup. Similiar situations can arise with RT tasks also.
Thanks for your explanation.
I think that the same thing occurs without the higher level scheduler, because all the tasks issuing I/Os are blocked while the underlying device's request queue is full before those I/Os are sent to the I/O scheduler.
Quoted 9 lines
Quoted 8 lines
Quoted 3 lines
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
I would like to support any type of block device even if I/Os issued to the underlying device doesn't go through IO scheduler. Dm-ioband can be made use of for the devices such as loop device.
Quoted 4 lines
What do you mean by that IO issued to underlying device does not go through IO scheduler? loop device will be associated with a file and IO will ultimately go to the IO scheduler which is serving those file blocks?
How about if the files is on an NFS-mounted file system?
Quoted 4 lines
What's the use case scenario of doing IO control at loop device? Ultimately the resource contention will take place on actual underlying physical device where the file blocks are. Will doing the resource control there not solve the issue for you?
I don't come up with any use case, but I would like to make the resource controller more flexible. Actually, a certain block device that I'm using does not use the I/O scheduler.
Thanks,
Ryo Tsuruta
A message that is not in the archive (sent off-list or not yet received): 20081126.214707.653026525707335397.ryov-jCdQPDEk3idL9jVzuh4AOg@public.gmane.org
Quoted 36 lines · Ryo Tsuruta
Hi Vivek,
From: Vivek Goyal <[email protected]>
Subject: Re: [patch 0/4] [RFC] Another proportional weight IO controller
Date: Tue, 25 Nov 2008 11:27:20 -0500Quoted 22 lines · Ryo Tsuruta
Quoted 9 lines
Hi Vivek,
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Quoted 6 lines
Quoted 3 lines
Thanks Ryo. Implementing a control at block layer sounds like another 2 level scheduling. We will still have the issue of breaking underlying CFQ and other schedulers. How to plan to resolve that conflict.
I think there is no conflict against I/O schedulers. Could you expain to me about the conflict?
Because we do the buffering at higher level scheduler and mostly release the buffered bios in the FIFO order, it might break the underlying IO schedulers. Generally it is the decision of IO scheduler to determine in what order to release buffered bios.
Quoted 7 lines
For example, If there is one task of io priority 0 in a cgroup and rest of the tasks are of io prio 7. All the tasks belong to best effort class. If tasks of lower priority (7) do lot of IO, then due to buffering there is a chance that IO from lower prio tasks is seen by CFQ first and io from higher prio task is not seen by cfq for quite some time hence that task not getting it fair share with in the cgroup. Similiar situations can arise with RT tasks also.
Quoted 6 lines
Thanks for your explanation.
I think that the same thing occurs without the higher level scheduler, because all the tasks issuing I/Os are blocked while the underlying device's request queue is full before those I/Os are sent to the I/O scheduler.
True and this issue was pointed out by Divyesh. I think we shall have to fix this by allocating the request descriptors in proportion to their share. One possible way is to make use of elv_may_queue() to determine if we can allocate furhter request descriptors or not.
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Quoted 3 lines
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
I would like to support any type of block device even if I/Os issued to the underlying device doesn't go through IO scheduler. Dm-ioband can be made use of for the devices such as loop device.
Quoted 7 lines
Quoted 4 lines
What do you mean by that IO issued to underlying device does not go through IO scheduler? loop device will be associated with a file and IO will ultimately go to the IO scheduler which is serving those file blocks?
How about if the files is on an NFS-mounted file system?
Interesting. So on the surface it looks like contention for disk but it is more the contention for network and contention for disk on NFS server.
True that leaf node IO control will not help here as IO is not going to leaf node at all. We can make the situation better by doing resource control on network IO though.
Quoted 8 lines
Quoted 4 lines
What's the use case scenario of doing IO control at loop device? Ultimately the resource contention will take place on actual underlying physical device where the file blocks are. Will doing the resource control there not solve the issue for you?
I don't come up with any use case, but I would like to make the resource controller more flexible. Actually, a certain block device that I'm using does not use the I/O scheduler.
Isn't it equivalent to using No-op? If yes, then it should not be an issue?
Thanks
Vivek
Quoted 36 lines · Ryo Tsuruta
Hi Vivek,
From: Vivek Goyal <[email protected]>
Subject: Re: [patch 0/4] [RFC] Another proportional weight IO controller
Date: Tue, 25 Nov 2008 11:27:20 -0500Quoted 22 lines · Ryo Tsuruta
Quoted 9 lines
Hi Vivek,
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Quoted 6 lines
Quoted 3 lines
Thanks Ryo. Implementing a control at block layer sounds like another 2 level scheduling. We will still have the issue of breaking underlying CFQ and other schedulers. How to plan to resolve that conflict.
I think there is no conflict against I/O schedulers. Could you expain to me about the conflict?
Because we do the buffering at higher level scheduler and mostly release the buffered bios in the FIFO order, it might break the underlying IO schedulers. Generally it is the decision of IO scheduler to determine in what order to release buffered bios.
Quoted 7 lines
For example, If there is one task of io priority 0 in a cgroup and rest of the tasks are of io prio 7. All the tasks belong to best effort class. If tasks of lower priority (7) do lot of IO, then due to buffering there is a chance that IO from lower prio tasks is seen by CFQ first and io from higher prio task is not seen by cfq for quite some time hence that task not getting it fair share with in the cgroup. Similiar situations can arise with RT tasks also.
Quoted 6 lines
Thanks for your explanation.
I think that the same thing occurs without the higher level scheduler, because all the tasks issuing I/Os are blocked while the underlying device's request queue is full before those I/Os are sent to the I/O scheduler.
True and this issue was pointed out by Divyesh. I think we shall have to fix this by allocating the request descriptors in proportion to their share. One possible way is to make use of elv_may_queue() to determine if we can allocate furhter request descriptors or not.
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Quoted 3 lines
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
I would like to support any type of block device even if I/Os issued to the underlying device doesn't go through IO scheduler. Dm-ioband can be made use of for the devices such as loop device.
Quoted 7 lines
Quoted 4 lines
What do you mean by that IO issued to underlying device does not go through IO scheduler? loop device will be associated with a file and IO will ultimately go to the IO scheduler which is serving those file blocks?
How about if the files is on an NFS-mounted file system?
Interesting. So on the surface it looks like contention for disk but it is more the contention for network and contention for disk on NFS server.
True that leaf node IO control will not help here as IO is not going to leaf node at all. We can make the situation better by doing resource control on network IO though.
Quoted 8 lines
Quoted 4 lines
What's the use case scenario of doing IO control at loop device? Ultimately the resource contention will take place on actual underlying physical device where the file blocks are. Will doing the resource control there not solve the issue for you?
I don't come up with any use case, but I would like to make the resource controller more flexible. Actually, a certain block device that I'm using does not use the I/O scheduler.
Isn't it equivalent to using No-op? If yes, then it should not be an issue?
Thanks
Vivek
Quoted 36 lines · Ryo Tsuruta
Hi Vivek,
From: Vivek Goyal <[email protected]>
Subject: Re: [patch 0/4] [RFC] Another proportional weight IO controller
Date: Tue, 25 Nov 2008 11:27:20 -0500Quoted 22 lines · Ryo Tsuruta
Quoted 9 lines
Hi Vivek,
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Quoted 6 lines
Quoted 3 lines
Thanks Ryo. Implementing a control at block layer sounds like another 2 level scheduling. We will still have the issue of breaking underlying CFQ and other schedulers. How to plan to resolve that conflict.
I think there is no conflict against I/O schedulers. Could you expain to me about the conflict?
Because we do the buffering at higher level scheduler and mostly release the buffered bios in the FIFO order, it might break the underlying IO schedulers. Generally it is the decision of IO scheduler to determine in what order to release buffered bios.
Quoted 7 lines
For example, If there is one task of io priority 0 in a cgroup and rest of the tasks are of io prio 7. All the tasks belong to best effort class. If tasks of lower priority (7) do lot of IO, then due to buffering there is a chance that IO from lower prio tasks is seen by CFQ first and io from higher prio task is not seen by cfq for quite some time hence that task not getting it fair share with in the cgroup. Similiar situations can arise with RT tasks also.
Quoted 6 lines
Thanks for your explanation.
I think that the same thing occurs without the higher level scheduler, because all the tasks issuing I/Os are blocked while the underlying device's request queue is full before those I/Os are sent to the I/O scheduler.
True and this issue was pointed out by Divyesh. I think we shall have to fix this by allocating the request descriptors in proportion to their share. One possible way is to make use of elv_may_queue() to determine if we can allocate furhter request descriptors or not.
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Quoted 3 lines
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
I would like to support any type of block device even if I/Os issued to the underlying device doesn't go through IO scheduler. Dm-ioband can be made use of for the devices such as loop device.
Quoted 7 lines
Quoted 4 lines
What do you mean by that IO issued to underlying device does not go through IO scheduler? loop device will be associated with a file and IO will ultimately go to the IO scheduler which is serving those file blocks?
How about if the files is on an NFS-mounted file system?
Interesting. So on the surface it looks like contention for disk but it is more the contention for network and contention for disk on NFS server.
True that leaf node IO control will not help here as IO is not going to leaf node at all. We can make the situation better by doing resource control on network IO though.
Quoted 8 lines
Quoted 4 lines
What's the use case scenario of doing IO control at loop device? Ultimately the resource contention will take place on actual underlying physical device where the file blocks are. Will doing the resource control there not solve the issue for you?
I don't come up with any use case, but I would like to make the resource controller more flexible. Actually, a certain block device that I'm using does not use the I/O scheduler.
Isn't it equivalent to using No-op? If yes, then it should not be an issue?
Thanks
Vivek
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 17 lines · Vivek Goyal
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Quoted 3 lines
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
I would like to support any type of block device even if I/Os issued to the underlying device doesn't go through IO scheduler. Dm-ioband can be made use of for the devices such as loop device.
Quoted 7 lines
Quoted 4 lines
What do you mean by that IO issued to underlying device does not go through IO scheduler? loop device will be associated with a file and IO will ultimately go to the IO scheduler which is serving those file blocks?
How about if the files is on an NFS-mounted file system?
Quoted 6 lines
Interesting. So on the surface it looks like contention for disk but it is more the contention for network and contention for disk on NFS server.
True that leaf node IO control will not help here as IO is not going to leaf node at all. We can make the situation better by doing resource control on network IO though.
On the client side NFS does not go through the block layer so no control is possible there. As Vivek pointed out this could be tackled at the network layer. Though I guess we could make do with a solution that controls just the number of dirty pages (this would work for NFS writes since the NFS superblock has a backing_device_info structure associated with it).
Quoted 11 lines
Quoted 8 lines
Quoted 4 lines
What's the use case scenario of doing IO control at loop device? Ultimately the resource contention will take place on actual underlying physical device where the file blocks are. Will doing the resource control there not solve the issue for you?
I don't come up with any use case, but I would like to make the resource controller more flexible. Actually, a certain block device that I'm using does not use the I/O scheduler.
Isn't it equivalent to using No-op? If yes, then it should not be an issue?
No, it is not equivalent. When using devices drivers that provide their own make_request_fn() (check for devices that invoke blk_queue_make_request() at initialization time) bios entering the block layer can go directly to the device driver and from there to the device.
Regards,
Fernando
Hi Vivek,
Quoted 11 lines
Quoted 6 lines
Thanks for your explanation.
I think that the same thing occurs without the higher level scheduler, because all the tasks issuing I/Os are blocked while the underlying device's request queue is full before those I/Os are sent to the I/O scheduler.True and this issue was pointed out by Divyesh. I think we shall have to fix this by allocating the request descriptors in proportion to their share. One possible way is to make use of
elv_may_queue()to determine if we can allocate furhter request descriptors or not.
At the fist glance, elv_may_queue() seemed to be useful for the purpose as you mentioned. But I've noticed there are some problems after I investigated the code more.
1. Every I/O controller must have its own decision algorithm that which I/O requests should be block or not, whose algorithm will be similar to that of dm-ioband. It would be a hassle to implement it in all the I/O controllers.
2. When an I/O is completed, one of the slots in the request queue become available, then one of the processes being blocked get awakened in fifo manner. This won't be the best one in most cases and you have to make this process sleep again and you may want to wake up another one. It's inefficient.
3. In elv_may_queue(), we can't determine which process issues an I/O. You have no choice but to make any kind of process sleep even if it's a kernel thread such as kswapd or pdflush. What do you think is going to happen after that?
It may be possible to modify the code not to block kernel threads, but I don't think you can control delayed-write I/Os.
If you want to solve these problems, I think you are going to implement the algorithm there whose code is very similar to that of dm-ioband.
Thanks,
Ryo Tsuruta
Quoted 17 lines · Vivek Goyal
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Quoted 3 lines
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
I would like to support any type of block device even if I/Os issued to the underlying device doesn't go through IO scheduler. Dm-ioband can be made use of for the devices such as loop device.
Quoted 7 lines
Quoted 4 lines
What do you mean by that IO issued to underlying device does not go through IO scheduler? loop device will be associated with a file and IO will ultimately go to the IO scheduler which is serving those file blocks?
How about if the files is on an NFS-mounted file system?
Quoted 6 lines
Interesting. So on the surface it looks like contention for disk but it is more the contention for network and contention for disk on NFS server.
True that leaf node IO control will not help here as IO is not going to leaf node at all. We can make the situation better by doing resource control on network IO though.
On the client side NFS does not go through the block layer so no control is possible there. As Vivek pointed out this could be tackled at the network layer. Though I guess we could make do with a solution that controls just the number of dirty pages (this would work for NFS writes since the NFS superblock has a backing_device_info structure associated with it).
Quoted 11 lines
Quoted 8 lines
Quoted 4 lines
What's the use case scenario of doing IO control at loop device? Ultimately the resource contention will take place on actual underlying physical device where the file blocks are. Will doing the resource control there not solve the issue for you?
I don't come up with any use case, but I would like to make the resource controller more flexible. Actually, a certain block device that I'm using does not use the I/O scheduler.
Isn't it equivalent to using No-op? If yes, then it should not be an issue?
No, it is not equivalent. When using devices drivers that provide their own make_request_fn() (check for devices that invoke blk_queue_make_request() at initialization time) bios entering the block layer can go directly to the device driver and from there to the device.
Regards,
Fernando
Quoted 17 lines · Vivek Goyal
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Quoted 3 lines
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
I would like to support any type of block device even if I/Os issued to the underlying device doesn't go through IO scheduler. Dm-ioband can be made use of for the devices such as loop device.
Quoted 7 lines
Quoted 4 lines
What do you mean by that IO issued to underlying device does not go through IO scheduler? loop device will be associated with a file and IO will ultimately go to the IO scheduler which is serving those file blocks?
How about if the files is on an NFS-mounted file system?
Quoted 6 lines
Interesting. So on the surface it looks like contention for disk but it is more the contention for network and contention for disk on NFS server.
True that leaf node IO control will not help here as IO is not going to leaf node at all. We can make the situation better by doing resource control on network IO though.
On the client side NFS does not go through the block layer so no control is possible there. As Vivek pointed out this could be tackled at the network layer. Though I guess we could make do with a solution that controls just the number of dirty pages (this would work for NFS writes since the NFS superblock has a backing_device_info structure associated with it).
Quoted 11 lines
Quoted 8 lines
Quoted 4 lines
What's the use case scenario of doing IO control at loop device? Ultimately the resource contention will take place on actual underlying physical device where the file blocks are. Will doing the resource control there not solve the issue for you?
I don't come up with any use case, but I would like to make the resource controller more flexible. Actually, a certain block device that I'm using does not use the I/O scheduler.
Isn't it equivalent to using No-op? If yes, then it should not be an issue?
No, it is not equivalent. When using devices drivers that provide their own make_request_fn() (check for devices that invoke blk_queue_make_request() at initialization time) bios entering the block layer can go directly to the device driver and from there to the device.
Regards,
Fernando
A message that is not in the archive (sent off-list or not yet received): 1227775382.7443.43.camel-xpvPi5bcW5X5OjGIXfuPlhrrLbDL3r4M6qtp775pBPw@public.gmane.org
Hi,
Quoted 11 lines
Quoted 6 lines
Quoted 3 lines
I don't come up with any use case, but I would like to make the resource controller more flexible. Actually, a certain block device that I'm using does not use the I/O scheduler.
Isn't it equivalent to using No-op? If yes, then it should not be an issue?
No, it is not equivalent. When using devices drivers that provide their own
make_request_fn()(check for devices that invokeblk_queue_make_request()at initialization time) bios entering the block layer can go directly to the device driver and from there to the device.
As Fernando said, that device driver invokes blk_queue_make_request(),
Thanks,
Ryo Tsuruta
Hi,
Quoted 11 lines
Quoted 6 lines
Quoted 3 lines
I don't come up with any use case, but I would like to make the resource controller more flexible. Actually, a certain block device that I'm using does not use the I/O scheduler.
Isn't it equivalent to using No-op? If yes, then it should not be an issue?
No, it is not equivalent. When using devices drivers that provide their own
make_request_fn()(check for devices that invokeblk_queue_make_request()at initialization time) bios entering the block layer can go directly to the device driver and from there to the device.
As Fernando said, that device driver invokes blk_queue_make_request(),
Thanks,
Ryo Tsuruta
Hi,
Quoted 11 lines
Quoted 6 lines
Quoted 3 lines
I don't come up with any use case, but I would like to make the resource controller more flexible. Actually, a certain block device that I'm using does not use the I/O scheduler.
Isn't it equivalent to using No-op? If yes, then it should not be an issue?
No, it is not equivalent. When using devices drivers that provide their own
make_request_fn()(check for devices that invokeblk_queue_make_request()at initialization time) bios entering the block layer can go directly to the device driver and from there to the device.
As Fernando said, that device driver invokes blk_queue_make_request(),
Thanks,
Ryo Tsuruta
Hi Vivek,
Quoted 11 lines
Quoted 6 lines
Thanks for your explanation.
I think that the same thing occurs without the higher level scheduler, because all the tasks issuing I/Os are blocked while the underlying device's request queue is full before those I/Os are sent to the I/O scheduler.True and this issue was pointed out by Divyesh. I think we shall have to fix this by allocating the request descriptors in proportion to their share. One possible way is to make use of
elv_may_queue()to determine if we can allocate furhter request descriptors or not.
At the fist glance, elv_may_queue() seemed to be useful for the purpose as you mentioned. But I've noticed there are some problems after I investigated the code more.
1. Every I/O controller must have its own decision algorithm that which I/O requests should be block or not, whose algorithm will be similar to that of dm-ioband. It would be a hassle to implement it in all the I/O controllers.
2. When an I/O is completed, one of the slots in the request queue become available, then one of the processes being blocked get awakened in fifo manner. This won't be the best one in most cases and you have to make this process sleep again and you may want to wake up another one. It's inefficient.
3. In elv_may_queue(), we can't determine which process issues an I/O. You have no choice but to make any kind of process sleep even if it's a kernel thread such as kswapd or pdflush. What do you think is going to happen after that?
It may be possible to modify the code not to block kernel threads, but I don't think you can control delayed-write I/Os.
If you want to solve these problems, I think you are going to implement the algorithm there whose code is very similar to that of dm-ioband.
Thanks,
Ryo Tsuruta
Hi Vivek,
Quoted 11 lines
Quoted 6 lines
Thanks for your explanation.
I think that the same thing occurs without the higher level scheduler, because all the tasks issuing I/Os are blocked while the underlying device's request queue is full before those I/Os are sent to the I/O scheduler.True and this issue was pointed out by Divyesh. I think we shall have to fix this by allocating the request descriptors in proportion to their share. One possible way is to make use of
elv_may_queue()to determine if we can allocate furhter request descriptors or not.
At the fist glance, elv_may_queue() seemed to be useful for the purpose as you mentioned. But I've noticed there are some problems after I investigated the code more.
1. Every I/O controller must have its own decision algorithm that which I/O requests should be block or not, whose algorithm will be similar to that of dm-ioband. It would be a hassle to implement it in all the I/O controllers.
2. When an I/O is completed, one of the slots in the request queue become available, then one of the processes being blocked get awakened in fifo manner. This won't be the best one in most cases and you have to make this process sleep again and you may want to wake up another one. It's inefficient.
3. In elv_may_queue(), we can't determine which process issues an I/O. You have no choice but to make any kind of process sleep even if it's a kernel thread such as kswapd or pdflush. What do you think is going to happen after that?
It may be possible to modify the code not to block kernel threads, but I don't think you can control delayed-write I/Os.
If you want to solve these problems, I think you are going to implement the algorithm there whose code is very similar to that of dm-ioband.
Thanks,
Ryo Tsuruta
Hi Vivek,
From: Vivek Goyal <[email protected]>
Subject: Re: [patch 0/4] [RFC] Another proportional weight IO controller
Date: Tue, 25 Nov 2008 11:27:20 -0500
Quoted 22 lines · Ryo Tsuruta
Quoted 9 lines
Hi Vivek,
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Quoted 6 lines
Quoted 3 lines
Thanks Ryo. Implementing a control at block layer sounds like another 2 level scheduling. We will still have the issue of breaking underlying CFQ and other schedulers. How to plan to resolve that conflict.
I think there is no conflict against I/O schedulers. Could you expain to me about the conflict?
Because we do the buffering at higher level scheduler and mostly release the buffered bios in the FIFO order, it might break the underlying IO schedulers. Generally it is the decision of IO scheduler to determine in what order to release buffered bios.
Quoted 7 lines
For example, If there is one task of io priority 0 in a cgroup and rest of the tasks are of io prio 7. All the tasks belong to best effort class. If tasks of lower priority (7) do lot of IO, then due to buffering there is a chance that IO from lower prio tasks is seen by CFQ first and io from higher prio task is not seen by cfq for quite some time hence that task not getting it fair share with in the cgroup. Similiar situations can arise with RT tasks also.
Thanks for your explanation.
I think that the same thing occurs without the higher level scheduler, because all the tasks issuing I/Os are blocked while the underlying device's request queue is full before those I/Os are sent to the I/O scheduler.
Quoted 9 lines
Quoted 8 lines
Quoted 3 lines
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
I would like to support any type of block device even if I/Os issued to the underlying device doesn't go through IO scheduler. Dm-ioband can be made use of for the devices such as loop device.
Quoted 4 lines
What do you mean by that IO issued to underlying device does not go through IO scheduler? loop device will be associated with a file and IO will ultimately go to the IO scheduler which is serving those file blocks?
How about if the files is on an NFS-mounted file system?
Quoted 4 lines
What's the use case scenario of doing IO control at loop device? Ultimately the resource contention will take place on actual underlying physical device where the file blocks are. Will doing the resource control there not solve the issue for you?
I don't come up with any use case, but I would like to make the resource controller more flexible. Actually, a certain block device that I'm using does not use the I/O scheduler.
Thanks,
Ryo Tsuruta
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi Vivek,
Quoted 10 lines
Quoted 6 lines
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Thanks Ryo. Implementing a control at block layer sounds like another 2 level scheduling. We will still have the issue of breaking underlying CFQ and other schedulers. How to plan to resolve that conflict.
I think there is no conflict against I/O schedulers. Could you expain to me about the conflict?
Quoted 3 lines
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
I would like to support any type of block device even if I/Os issued to the underlying device doesn't go through IO scheduler. Dm-ioband can be made use of for the devices such as loop device.
Thanks,
Ryo Tsuruta
Hi Vivek,
Quoted 10 lines
Quoted 6 lines
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Thanks Ryo. Implementing a control at block layer sounds like another 2 level scheduling. We will still have the issue of breaking underlying CFQ and other schedulers. How to plan to resolve that conflict.
I think there is no conflict against I/O schedulers. Could you expain to me about the conflict?
Quoted 3 lines
What do you think about the solution at IO scheduler level (like BFQ) or may be little above that where one can try some code sharing among IO schedulers?
I would like to support any type of block device even if I/Os issued to the underlying device doesn't go through IO scheduler. Dm-ioband can be made use of for the devices such as loop device.
Thanks,
Ryo Tsuruta
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi Vivek,
Sorry for late reply.
Quoted 11 lines
Quoted 8 lines
Quoted 3 lines
Do you have any benchmark results?
I'm especially interested in the followings:
- Comparison of disk performance with and without the I/O controller patch.If I dynamically disable the bio control, then I did not observe any impact on performance. Because in that case practically it boils down to just an additional variable check in
__make_request().Oh.., I understood your question wrong. You are looking for what's the performance penalty if I enable the IO controller on a device.
Yes, that is what I want to know.
Quoted 9 lines
I have not done any extensive benchmarking. If I run two dd commands without controller, I get 80MB/s from disk (roughly 40 MB for each task). With bio group enabled (default token=2000), I was getting total BW of roughly 68 MB/s.
I have not done any performance analysis or optimizations at this point of time. I plan to do that once we have some sort of common understanding about a particular approach. There are so many IO controllers floating, right now I am more concerned if we can all come to a common platform.
I understood the reason of posting the patch well.
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Thanks,
Ryo Tsuruta
Hi Vivek,
Sorry for late reply.
Quoted 11 lines
Quoted 8 lines
Quoted 3 lines
Do you have any benchmark results?
I'm especially interested in the followings:
- Comparison of disk performance with and without the I/O controller patch.If I dynamically disable the bio control, then I did not observe any impact on performance. Because in that case practically it boils down to just an additional variable check in
__make_request().Oh.., I understood your question wrong. You are looking for what's the performance penalty if I enable the IO controller on a device.
Yes, that is what I want to know.
Quoted 9 lines
I have not done any extensive benchmarking. If I run two dd commands without controller, I get 80MB/s from disk (roughly 40 MB for each task). With bio group enabled (default token=2000), I was getting total BW of roughly 68 MB/s.
I have not done any performance analysis or optimizations at this point of time. I plan to do that once we have some sort of common understanding about a particular approach. There are so many IO controllers floating, right now I am more concerned if we can all come to a common platform.
I understood the reason of posting the patch well.
Quoted 3 lines
Ryo, do you still want to stick to two level scheduling? Given the problem of it breaking down underlying scheduler's assumptions, probably it makes more sense to the IO control at each individual IO scheduler.
I don't want to stick to it. I'm considering implementing dm-ioband's algorithm into the block I/O layer experimentally.
Thanks,
Ryo Tsuruta
Hi,
From: [email protected]
Subject: [patch 0/4] [RFC] Another proportional weight IO controller
Date: Thu, 06 Nov 2008 10:30:22 -0500
Quoted 18 lines
Hi,
If you are not already tired of so many io controller implementations, here is another one.
This is a very eary very crude implementation to get early feedback to see if this approach makes any sense or not.
This controller is a proportional weight IO controller primarily based on/inspired by dm-ioband. One of the things I personally found little odd about dm-ioband was need of a dm-ioband device for every device we want to control. I thought that probably we can make this control per request queue and get rid of device mapper driver. This should make configuration aspect easy.
I have picked up quite some amount of code from dm-ioband especially for biocgroup implementation.
Quoted 6 lines
I have done very basic testing and that is running 2-3 dd commands in different cgroups on
x86_64. Wanted to throw out the code early to get some feedback.More details about the design and how to are in documentation patch.
Your comments are welcome.
Do you have any benchmark results?
I'm especially interested in the followings:
- Comparison of disk performance with and without the I/O controller patch.
- Put uneven I/O loads. Processes, which belong to a cgroup which is given a smaller weight than another cgroup, put heavier I/O load like the following.
echo 1024 > /cgroup/bio/test1/bio.shares
echo 8192 > /cgroup/bio/test2/bio.shares
echo $$ > /cgroup/bio/test1/tasks
dd if=/somefile1-1 of=/dev/null &
dd if=/somefile1-2 of=/dev/null &
...
dd if=/somefile1-100 of=/dev/null
echo $$ > /cgroup/bio/test2/tasks
dd if=/somefile2-1 of=/dev/null &
dd if=/somefile2-2 of=/dev/null &
...
dd if=/somefile2-10 of=/dev/null &Thanks,
Ryo Tsuruta