iosched: Add i10 I/O Scheduler
Subsystems (3)
PATCH 1/1 iosched: Add i10 I/O Scheduler
From: Rachit Agarwal <[email protected]>>
Hi All,
I/O batching is beneficial for optimizing IOPS and throughput for various applications. For instance, several kernel block drivers would benefit from batching, including mmc [1] and tcp-based storage drivers like nvme-tcp [2,3]. While we have support for batching dispatch [4], we need an I/O scheduler to efficiently enable batching. Such a scheduler is particularly interesting for disaggregated storage, where the access latency of remote disaggregated storage may be higher than local storage access; thus, batching can significantly help in amortizing the remote access latency while increasing the throughput.
This patch introduces the i10 I/O scheduler, which performs batching per hctx in terms of #requests, #bytes, and timeouts (at microseconds granularity). i10 starts dispatching only when #requests or #bytes is larger than a default threshold or when a timer expires. After that, batching dispatch [3] would happen, allowing batching at device drivers along with "bd->last" and ".commit_rqs".
The i10 I/O scheduler builds upon recent work on [6]. We have tested the i10 I/O scheduler with nvme-tcp optimizaitons [2,3] and batching dispatch [4], varying number of cores, varying read/write ratios, and varying request sizes, and with NVMe SSD and RAM block device. For NVMe SSDs, the i10 I/O scheduler achieves ~60% improvements in terms of IOPS per core over "noop" I/O scheduler. These results are available at [5], and many additional results are presented in [6].
While other schedulers may also batch I/O (e.g., mq-deadline), the optimization target in the i10 I/O scheduler is throughput maximization. Hence there is no latency target nor a need for a global tracking context, so a new scheduler is needed rather than to build this functionality to an existing scheduler.
We currently use fixed default values as batching thresholds (e.g., 16 for #requests, 64KB for #bytes, and 50us for timeout). These default values are based on sensitivity tests in [6]. For our future work, we plan to support adaptive batching according to system load and to extend the scheduler to support isolation in multi-tenant deployments (to simultaneously achieve low tail latency for latency-sensitive applications and high throughput for throughput-bound applications).
References
[1] https://lore.kernel.org/linux-block/[email protected]/T/#mc48a8fb6069843827458f5fea722e1179d32af2a
[2] https://git.infradead.org/nvme.git/commit/122e5b9f3d370ae11e1502d14ff5c7ea9b144a76
[3] https://git.infradead.org/nvme.git/commit/86f0348ace1510d7ac25124b096fb88a6ab45270
[4] https://lore.kernel.org/linux-block/[email protected]/
[5] https://github.com/i10-kernel/upstream-linux/blob/master/dss-evaluation.pdf
[6] https://www.usenix.org/conference/nsdi20/presentation/hwang
--- Documentation/block/i10-iosched.rst | 69 +++++ block/Kconfig.iosched | 8 + block/Makefile | 1 + block/i10-iosched.c | 421 ++++++++++++++++++++++++++++ 4 files changed, 499 insertions(+) create mode 100644 Documentation/block/i10-iosched.rst create mode 100644 block/i10-iosched.c
Documentation/block/i10-iosched.rst new file +69 -0
@@ -0,0 +1,69 @@ +========================== +i10 I/O scheduler overview +========================== + +I/O batching is beneficial for optimizing IOPS and throughput for various +applications. For instance, several kernel block drivers would +benefit from batching, including mmc [1] and tcp-based storage drivers like +nvme-tcp [2,3]. While we have support for batching dispatch [4], we need an +I/O scheduler to efficiently enable batching. Such a scheduler is particularly +interesting for disaggregated storage, where the access latency of remote +disaggregated storage may be higher than local storage access; thus, batching +can significantly help in amortizing the remote access latency while increasing +the throughput. + +This patch introduces the i10 I/O scheduler, which performs batching per hctx in terms +of #requests, #bytes, and timeouts (at microseconds granularity). i10 starts +dispatching only when #requests or #bytes is larger than a default threshold or when +a timer expires. After that, batching dispatch [3] would happen, allowing batching +at device drivers along with "bd->last" and ".commit_rqs". + +The i10 I/O scheduler builds upon recent work on [6]. We have tested the i10 I/O +scheduler with nvme-tcp optimizaitons [2,3] and batching dispatch [4], varying number +of cores, varying read/write ratios, and varying request sizes, and with NVMe SSD and +RAM block device. For NVMe SSDs, the i10 I/O scheduler achieves ~60% improvements in +terms of IOPS per core over "noop" I/O scheduler. These results are available at [5], +and many additional results are presented in [6]. + +While other schedulers may also batch I/O (e.g., mq-deadline), the optimization target +in the i10 I/O scheduler is throughput maximization. Hence there is no latency target +nor a need for a global tracking context, so a new scheduler is needed rather than +to build this functionality to an existing scheduler. + +We currently use fixed default values as batching thresholds (e.g., 16 for #requests, +64KB for #bytes, and 50us for timeout). These default values are based on sensitivity +tests in [6]. For our future work, we plan to support adaptive batching according to +system load and to extend the scheduler to support isolation in multi-tenant deployments +(to simultaneously achieve low tail latency for latency-sensitive applications and high +throughput for throughput-bound applications). + +References +[1] https://lore.kernel.org/linux-block/[email protected]/T/#mc48a8fb6069843827458f5fea722e1179d32af2a +[2] https://git.infradead.org/nvme.git/commit/122e5b9f3d370ae11e1502d14ff5c7ea9b144a76 +[3] https://git.infradead.org/nvme.git/commit/86f0348ace1510d7ac25124b096fb88a6ab45270 +[4] https://lore.kernel.org/linux-block/[email protected]/ +[5] https://github.com/i10-kernel/upstream-linux/blob/master/dss-evaluation.pdf +[6] https://www.usenix.org/conference/nsdi20/presentation/hwang + +========================== +i10 I/O scheduler tunables +========================== + +The three tunables for the i10 scheduler are the number of requests for +reads/writes, the number of bytes for writes, and a timeout value. +i10 will use these values for batching requests. + +batch_nr +-------- +Number of requests for batching read/write requests +Default: 16 + +batch_bytes +----------- +Number of bytes for batching write requests +Default: 65536 (bytes) + +batch_timeout +------------- +Timeout value for batching (in microseconds) +Default: 50 (us)
block/Kconfig.iosched +8 -0
@@ -44,6 +44,14 @@ config BFQ_CGROUP_DEBUG Enable some debugging help. Currently it exports additional stat files in a cgroup which can be useful for debugging. +config MQ_IOSCHED_I10 + tristate "i10 I/O scheduler" + default y + help + The i10 I/O Scheduler supports batching at BLK-MQ. + Any device driver that benefits from batching + (e.g., NVMe-over-TCP) can use this scheduler. + endmenu endif
block/Makefile +1 -0
@@ -21,6 +21,7 @@ obj-$(CONFIG_BLK_CGROUP_IOLATENCY) += blk-iolatency.o obj-$(CONFIG_BLK_CGROUP_IOCOST) += blk-iocost.o obj-$(CONFIG_MQ_IOSCHED_DEADLINE) += mq-deadline.o obj-$(CONFIG_MQ_IOSCHED_KYBER) += kyber-iosched.o +obj-$(CONFIG_MQ_IOSCHED_I10) += i10-iosched.o bfq-y := bfq-iosched.o bfq-wf2q.o bfq-cgroup.o obj-$(CONFIG_IOSCHED_BFQ) += bfq.o
block/i10-iosched.c new file +421 -0
421 lines not on this page · raw message
Signature · 1 line
2.22.0
Jens Axboe
maintainerQuoted 35 lines · Rachit Agarwal
From: Rachit Agarwal <[email protected]>>
Hi All,
I/O batching is beneficial for optimizing IOPS and throughput for various applications. For instance, several kernel block drivers would benefit from batching, including mmc [1] and tcp-based storage drivers like nvme-tcp [2,3]. While we have support for batching dispatch [4], we need an I/O scheduler to efficiently enable batching. Such a scheduler is particularly interesting for disaggregated storage, where the access latency of remote disaggregated storage may be higher than local storage access; thus, batching can significantly help in amortizing the remote access latency while increasing the throughput.
This patch introduces the i10 I/O scheduler, which performs batching per hctx in terms of #requests, #bytes, and timeouts (at microseconds granularity). i10 starts dispatching only when #requests or #bytes is larger than a default threshold or when a timer expires. After that, batching dispatch [3] would happen, allowing batching at device drivers along with "
bd->last" and ".commit_rqs".The i10 I/O scheduler builds upon recent work on [6]. We have tested the i10 I/O scheduler with nvme-tcp optimizaitons [2,3] and batching dispatch [4], varying number of cores, varying read/write ratios, and varying request sizes, and with NVMe SSD and RAM block device. For NVMe SSDs, the i10 I/O scheduler achieves ~60% improvements in terms of IOPS per core over "noop" I/O scheduler. These results are available at [5], and many additional results are presented in [6].
While other schedulers may also batch I/O (e.g., mq-deadline), the optimization target in the i10 I/O scheduler is throughput maximization. Hence there is no latency target nor a need for a global tracking context, so a new scheduler is needed rather than to build this functionality to an existing scheduler.
Quoted 7 lines
We currently use fixed default values as batching thresholds (e.g., 16 for #requests, 64KB for #bytes, and 50us for timeout). These default values are based on sensitivity tests in [6]. For our future work, we plan to support adaptive batching according to system load and to extend the scheduler to support isolation in multi-tenant deployments (to simultaneously achieve low tail latency for latency-sensitive applications and high throughput for throughput-bound applications).
I haven't taken a close look at the code yet so far, but one quick note that patches like this should be against the branches for 5.11. In fact, this one doesn't even compile against current -git, as blk_mq_bio_list_merge is now called blk_bio_list_merge.
In any case, I did run this through some quick peak testing as I was curious, and I'm seeing about 20% drop in peak IOPS over none running this. Perf diff:
10.71% -2.44% [kernel.vmlinux] [k] read_tsc
2.33% -1.99% [kernel.vmlinux] [k] _raw_spin_lockAlso:
Was curious and wanted to look it up, but it doesn't exist.
Signature · 1 line
Jens Axboe
Sagi Grimberg
maintainerQuoted 5 lines
I haven't taken a close look at the code yet so far, but one quick note that patches like this should be against the branches for 5.11. In fact, this one doesn't even compile against current -git, as
blk_mq_bio_list_mergeis now calledblk_bio_list_merge.
Ugh, I guess that Jaehyun had this patch bottled up and didn't rebase before submitting.. Sorry about that.
Quoted 6 lines
In any case, I did run this through some quick peak testing as I was curious, and I'm seeing about 20% drop in peak IOPS over none running this. Perf diff:
10.71% -2.44% [kernel.vmlinux] [k] read_tsc 2.33% -1.99% [kernel.vmlinux] [k] _raw_spin_lock
You ran this with nvme? or null_blk? I guess neither would benefit from this because if the underlying device will not benefit from batching (at least enough for the extra cost of accounting for it) it will be counter productive to use this scheduler.
Quoted 5 lines
Also:
Was curious and wanted to look it up, but it doesn't exist.
I think this is the right one:
https://github.com/i10-kernel/upstream-linux/blob/master/i10-evaluation.pdf
We had some back and forth around the naming, hence this was probably omitted.
Jens Axboe
maintainerQuoted 13 lines · Sagi Grimberg
Quoted 5 lines
I haven't taken a close look at the code yet so far, but one quick note that patches like this should be against the branches for 5.11. In fact, this one doesn't even compile against current -git, as
blk_mq_bio_list_mergeis now calledblk_bio_list_merge.Ugh, I guess that Jaehyun had this patch bottled up and didn't rebase before submitting.. Sorry about that.
Quoted 4 lines
In any case, I did run this through some quick peak testing as I was curious, and I'm seeing about 20% drop in peak IOPS over none running this. Perf diff:
Quoted 7 lines
Quoted 2 lines
10.71% -2.44% [kernel.vmlinux] [k] read_tsc 2.33% -1.99% [kernel.vmlinux] [k] _raw_spin_lockYou ran this with nvme? or
null_blk? I guess neither would benefit from this because if the underlying device will not benefit from batching (at least enough for the extra cost of accounting for it) it will be counter productive to use this scheduler.
This is nvme, actual device. The initial posting could be a bit more explicit on the use case, it says:
"For NVMe SSDs, the i10 I/O scheduler achieves ~60% improvements in terms of IOPS per core over "noop" I/O scheduler."
which made me very skeptical, as it sounds like it's raw device claims.
Does beg the question of why this is a new scheduler then. It's pretty basic stuff, something that could trivially just be added a side effect of the core (and in fact we have much of it already). Doesn't really seem to warrant a new scheduler at all. There isn't really much in there.
Quoted 9 lines
Quoted 3 lines
Was curious and wanted to look it up, but it doesn't exist.
I think this is the right one:
https://github.com/i10-kernel/upstream-linux/blob/master/i10-evaluation.pdfWe had some back and forth around the naming, hence this was probably omitted.
That works, my local results were a bit worse than listed in there though. And what does this mean:
"We note that Linux I/O scheduler introduces an additional kernel worker thread at the I/O dispatching stage"
It most certainly does not for the common/hot case.
Signature · 1 line
Jens Axboe
Sagi Grimberg
maintainerQuoted 21 lines
Quoted 13 lines
Quoted 5 lines
I haven't taken a close look at the code yet so far, but one quick note that patches like this should be against the branches for 5.11. In fact, this one doesn't even compile against current -git, as
blk_mq_bio_list_mergeis now calledblk_bio_list_merge.Ugh, I guess that Jaehyun had this patch bottled up and didn't rebase before submitting.. Sorry about that.
Quoted 4 lines
In any case, I did run this through some quick peak testing as I was curious, and I'm seeing about 20% drop in peak IOPS over none running this. Perf diff:
Quoted 7 lines
Quoted 2 lines
10.71% -2.44% [kernel.vmlinux] [k] read_tsc 2.33% -1.99% [kernel.vmlinux] [k] _raw_spin_lockYou ran this with nvme? or
null_blk? I guess neither would benefit from this because if the underlying device will not benefit from batching (at least enough for the extra cost of accounting for it) it will be counter productive to use this scheduler.
Quoted 7 lines
This is nvme, actual device. The initial posting could be a bit more explicit on the use case, it says:
"For NVMe SSDs, the i10 I/O scheduler achieves ~60% improvements in terms of IOPS per core over "noop" I/O scheduler."
which made me very skeptical, as it sounds like it's raw device claims.
You are absolutely right, that needs to be fixed.
Quoted 4 lines
Does beg the question of why this is a new scheduler then. It's pretty basic stuff, something that could trivially just be added a side effect of the core (and in fact we have much of it already). Doesn't really seem to warrant a new scheduler at all. There isn't really much in there.
Not saying it absolutely warrants a new one, and it could I guess sit in the core, but this attempts to optimize for a specific metric while trading-off others, which is exactly what I/O schedulers are for, optimizing for a specific metric.
Not sure we want to build something biases towards throughput on the expense of latency into the block core. And, as mentioned this is not well suited to all device types...
But if you think this has a better home, I'm assuming that the guys will be open to that.
Quoted 8 lines
Quoted 7 lines
Quoted 1 line
Was curious and wanted to look it up, but it doesn't exist.
I think this is the right one:
https://github.com/i10-kernel/upstream-linux/blob/master/i10-evaluation.pdfWe had some back and forth around the naming, hence this was probably omitted.
Quoted 7 lines
That works, my local results were a bit worse than listed in there though. And what does this mean:
"We note that Linux I/O scheduler introduces an additional kernel worker thread at the I/O dispatching stage"
It most certainly does not for the common/hot case.
Yes I agree, didn't see the local results. Probably some misunderstanding or a typo, I'll let them reply on this.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Jens Axboe
maintainerQuoted 41 lines · Sagi Grimberg
Quoted 21 lines
Quoted 13 lines
Quoted 5 lines
I haven't taken a close look at the code yet so far, but one quick note that patches like this should be against the branches for 5.11. In fact, this one doesn't even compile against current -git, as
blk_mq_bio_list_mergeis now calledblk_bio_list_merge.Ugh, I guess that Jaehyun had this patch bottled up and didn't rebase before submitting.. Sorry about that.
Quoted 4 lines
In any case, I did run this through some quick peak testing as I was curious, and I'm seeing about 20% drop in peak IOPS over none running this. Perf diff:
Quoted 7 lines
Quoted 2 lines
10.71% -2.44% [kernel.vmlinux] [k] read_tsc 2.33% -1.99% [kernel.vmlinux] [k] _raw_spin_lockYou ran this with nvme? or
null_blk? I guess neither would benefit from this because if the underlying device will not benefit from batching (at least enough for the extra cost of accounting for it) it will be counter productive to use this scheduler.Quoted 7 lines
This is nvme, actual device. The initial posting could be a bit more explicit on the use case, it says:
"For NVMe SSDs, the i10 I/O scheduler achieves ~60% improvements in terms of IOPS per core over "noop" I/O scheduler."
which made me very skeptical, as it sounds like it's raw device claims.
You are absolutely right, that needs to be fixed.
Quoted 4 lines
Does beg the question of why this is a new scheduler then. It's pretty basic stuff, something that could trivially just be added a side effect of the core (and in fact we have much of it already). Doesn't really seem to warrant a new scheduler at all. There isn't really much in there.
Not saying it absolutely warrants a new one, and it could I guess sit in the core, but this attempts to optimize for a specific metric while trading-off others, which is exactly what I/O schedulers are for, optimizing for a specific metric.
Quoted 6 lines
Not sure we want to build something biases towards throughput on the expense of latency into the block core. And, as mentioned this is not well suited to all device types...
But if you think this has a better home, I'm assuming that the guys will be open to that.
Also see the reply from Ming. It's a balancing act - don't want to add extra overhead to the core, but also don't want to carry an extra scheduler if the main change is really just variable dispatch batching. And since we already have a notion of that, seems worthwhile to explore that venue.
Signature · 7 lines
Jens Axboe _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Sagi Grimberg
maintainerQuoted 9 lines
Quoted 3 lines
But if you think this has a better home, I'm assuming that the guys will be open to that.
Also see the reply from Ming. It's a balancing act - don't want to add extra overhead to the core, but also don't want to carry an extra scheduler if the main change is really just variable dispatch batching. And since we already have a notion of that, seems worthwhile to explore that venue.
I agree,
The main difference is that this balancing is not driven from device resource pressure, but rather from an assumption of device specific optimization (and also with a specific optimization target), hence a scheduler a user would need to opt-in seemed like a good compromise.
But maybe Ming has some good ideas on a different way to add it..
Jens Axboe
maintainerQuoted 10 lines · Sagi Grimberg
Quoted 9 lines
Quoted 3 lines
But if you think this has a better home, I'm assuming that the guys will be open to that.
Also see the reply from Ming. It's a balancing act - don't want to add extra overhead to the core, but also don't want to carry an extra scheduler if the main change is really just variable dispatch batching. And since we already have a notion of that, seems worthwhile to explore that venue.
Quoted 8 lines
I agree,
The main difference is that this balancing is not driven from device resource pressure, but rather from an assumption of device specific optimization (and also with a specific optimization target), hence a scheduler a user would need to opt-in seemed like a good compromise.
But maybe Ming has some good ideas on a different way to add it..
So here's another case - virtualized nvme. The commit overhead is suitably large there that performance suffers quite a bit, similarly to your remote storage case. If we had suitable logic in the core, then we could easily propagate this knowledge when setting up the queue. Then it could happen automatically, without needing a configuration to switch to a specific scheduler.
Signature · 1 line
Jens Axboe
Sagi Grimberg
maintainerQuoted 17 lines
Quoted 17 lines
Quoted 9 lines
Quoted 3 lines
But if you think this has a better home, I'm assuming that the guys will be open to that.
Also see the reply from Ming. It's a balancing act - don't want to add extra overhead to the core, but also don't want to carry an extra scheduler if the main change is really just variable dispatch batching. And since we already have a notion of that, seems worthwhile to explore that venue.
I agree,
The main difference is that this balancing is not driven from device resource pressure, but rather from an assumption of device specific optimization (and also with a specific optimization target), hence a scheduler a user would need to opt-in seemed like a good compromise.
Quoted 8 lines
Quoted 1 line
But maybe Ming has some good ideas on a different way to add it..
So here's another case - virtualized nvme. The commit overhead is suitably large there that performance suffers quite a bit, similarly to your remote storage case. If we had suitable logic in the core, then we could easily propagate this knowledge when setting up the queue. Then it could happen automatically, without needing a configuration to switch to a specific scheduler.
Yes, these use-cases share characteristics. I'm not at all opposed to placing this in the core. I do think that in order to put something like this in the core, the bar needs to be higher such that an optimization target cannot be biased towards a workload (i.e. needs to be adaptive).
I'm still not sure how we would build this on top of what we already have as it is really centered around device being busy (which is not the case for nvme), but I didn't put enough thought into it yet.
A message that is not in the archive (sent off-list or not yet received): CAKeUqKKHg1wD19pnwJEd8whubnuGVic_ZhDjebaq3kKmY9TtsQ@mail.gmail.com
Sagi Grimberg
maintainerQuoted 9 lines
Dear all:
Thanks, again, for the very constructive decisions.
I am writing back with quite a few updates:
1. We have now included a detailed comparison of i10 scheduler with Kyber with NVMe-over-TCP (https://github.com/i10-kernel/upstream-linux/blob/master/i10-evaluation.pdf). In a nutshell, when operating with NVMe-over-TCP, i10 demonstrates the core tradeoff: higher latency, but also higher throughput. This seems to be the core tradeoff exposed by i10.
Quoted 7 lines
2. We have now implemented an adaptive version of i10 I/O scheduler, that uses the number of outstanding requests at the time of batch dispatch (and whether the dispatch was triggered by timeout or not) to adaptively set the batching size. The new results (https://github.com/i10-kernel/upstream-linux/blob/master/i10-evaluation.pdf) show that i10-adaptive further improves performance for low loads, while keeping the performance for high loads. IMO, there is much to do on designing improved adaptation algorithms.
3. We have now updated the i10-evaluation document to include results for local storage access. The core take-away here is that i10-adaptive can achieve similar throughput and latency at low loads and at high loads when compared to noop, but still requires more work for lower loads. However, given that the tradeoff exposed by i10 scheduler is particularly useful for remote storage devices (and as Jens suggested, perhaps for virtualized local storage access), I do agree with Sagi -- I think we should consider including it in the core, since this may be useful for a broad range of new use cases.
We have also created a second version of the patch that includes these updates: https://github.com/i10-kernel/upstream-linux/blob/master/0002-iosched-Add-i10-I-O-Scheduler.patch
As always, thank you for the constructive discussion and I look forward to working with you on this.
Thanks Rachit,
Would be good if you can send a formal patch for the adaptive queuing so people can have a look.
One thing that was left on the table is weather this should be a full blown scheduler or a core block infrastructure that would either be set on-demand or by default.
I think that Jens and Ming expressed that this should be something that we should place this in the block core, but I'd like to hear maybe Ming can elaborate on his ideas how to do this.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Dear all:
Hope you are all well.
Sagi and I were wondering if you have any additional feedback on the updated patch? (@Ming?) We have been receiving a lot of interest/questions from industry on incorporation of i10 in the kernel. If people do not have additional feedback, it would be nice to move this forward.
Looking forward to hearing from you!
~Rachit
Quoted 51 lines · Rachit Agarwal
Quoted 27 lines · Sagi Grimberg
Quoted 18 lines
Quoted 18 lines
Quoted 10 lines
Quoted 4 lines
But if you think this has a better home, I'm assuming that the guys will be open to that.
Also see the reply from Ming. It's a balancing act - don't want to add extra overhead to the core, but also don't want to carry an extra scheduler if the main change is really just variable dispatch batching. And since we already have a notion of that, seems worthwhile to explore that venue.
I agree,
The main difference is that this balancing is not driven from device resource pressure, but rather from an assumption of device specific optimization (and also with a specific optimization target), hence a scheduler a user would need to opt-in seemed like a good compromise.
Quoted 8 lines
Quoted 1 line
But maybe Ming has some good ideas on a different way to add it..
So here's another case - virtualized nvme. The commit overhead is suitably large there that performance suffers quite a bit, similarly to your remote storage case. If we had suitable logic in the core, then we could easily propagate this knowledge when setting up the queue. Then it could happen automatically, without needing a configuration to switch to a specific scheduler.
Quoted 9 lines
Yes, these use-cases share characteristics. I'm not at all opposed to placing this in the core. I do think that in order to put something like this in the core, the bar needs to be higher such that an optimization target cannot be biased towards a workload (i.e. needs to be adaptive).
I'm still not sure how we would build this on top of what we already have as it is really centered around device being busy (which is not the case for nvme), but I didn't put enough thought into it yet.
Dear all:
Thanks, again, for the very constructive decisions.
I am writing back with quite a few updates:
1. We have now included a detailed comparison of i10 scheduler with Kyber with NVMe-over-TCP (https://github.com/i10-kernel/upstream-linux/blob/master/i10-evaluation.pdf). In a nutshell, when operating with NVMe-over-TCP, i10 demonstrates the core tradeoff: higher latency, but also higher throughput. This seems to be the core tradeoff exposed by i10.
2. We have now implemented an adaptive version of i10 I/O scheduler, that uses the number of outstanding requests at the time of batch dispatch (and whether the dispatch was triggered by timeout or not) to adaptively set the batching size. The new results (https://github.com/i10-kernel/upstream-linux/blob/master/i10-evaluation.pdf) show that i10-adaptive further improves performance for low loads, while keeping the performance for high loads. IMO, there is much to do on designing improved adaptation algorithms.
Quoted 9 lines
3. We have now updated the i10-evaluation document to include results for local storage access. The core take-away here is that i10-adaptive can achieve similar throughput and latency at low loads and at high loads when compared to noop, but still requires more work for lower loads. However, given that the tradeoff exposed by i10 scheduler is particularly useful for remote storage devices (and as Jens suggested, perhaps for virtualized local storage access), I do agree with Sagi -- I think we should consider including it in the core, since this may be useful for a broad range of new use cases.
We have also created a second version of the patch that includes these updates: https://github.com/i10-kernel/upstream-linux/blob/master/0002-iosched-Add-i10-I-O-Scheduler.patch
As always, thank you for the constructive discussion and I look forward to working with you on this.
Best,
~Rachit
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
[Resending the last message] Happy 2021 everyone!
Quoted 10 lines
Dear all:
Hope you are all well.
Sagi and I were wondering if you have any additional feedback on the updated patch? (@Ming?) We have been receiving a lot of interest/questions from industry on incorporation of i10 in the kernel. If people do not have additional feedback, it would be nice to move this forward.
Quoted 64 lines
Looking forward to hearing from you!
~RachitQuoted 60 lines · Rachit Agarwal
Quoted 27 lines · Sagi Grimberg
Quoted 18 lines
Quoted 18 lines
Quoted 10 lines
Quoted 4 lines
But if you think this has a better home, I'm assuming that the guys will be open to that.
Also see the reply from Ming. It's a balancing act - don't want to add extra overhead to the core, but also don't want to carry an extra scheduler if the main change is really just variable dispatch batching. And since we already have a notion of that, seems worthwhile to explore that venue.
I agree,
The main difference is that this balancing is not driven from device resource pressure, but rather from an assumption of device specific optimization (and also with a specific optimization target), hence a scheduler a user would need to opt-in seemed like a good compromise.
Quoted 8 lines
Quoted 1 line
But maybe Ming has some good ideas on a different way to add it..
So here's another case - virtualized nvme. The commit overhead is suitably large there that performance suffers quite a bit, similarly to your remote storage case. If we had suitable logic in the core, then we could easily propagate this knowledge when setting up the queue. Then it could happen automatically, without needing a configuration to switch to a specific scheduler.
Quoted 9 lines
Yes, these use-cases share characteristics. I'm not at all opposed to placing this in the core. I do think that in order to put something like this in the core, the bar needs to be higher such that an optimization target cannot be biased towards a workload (i.e. needs to be adaptive).
I'm still not sure how we would build this on top of what we already have as it is really centered around device being busy (which is not the case for nvme), but I didn't put enough thought into it yet.
Dear all:
Thanks, again, for the very constructive decisions.
I am writing back with quite a few updates:
1. We have now included a detailed comparison of i10 scheduler with Kyber with NVMe-over-TCP (https://github.com/i10-kernel/upstream-linux/blob/master/i10-evaluation.pdf). In a nutshell, when operating with NVMe-over-TCP, i10 demonstrates the core tradeoff: higher latency, but also higher throughput. This seems to be the core tradeoff exposed by i10.
2. We have now implemented an adaptive version of i10 I/O scheduler, that uses the number of outstanding requests at the time of batch dispatch (and whether the dispatch was triggered by timeout or not) to adaptively set the batching size. The new results (https://github.com/i10-kernel/upstream-linux/blob/master/i10-evaluation.pdf) show that i10-adaptive further improves performance for low loads, while keeping the performance for high loads. IMO, there is much to do on designing improved adaptation algorithms.
3. We have now updated the i10-evaluation document to include results for local storage access. The core take-away here is that i10-adaptive can achieve similar throughput and latency at low loads and at high loads when compared to noop, but still requires more work for lower loads. However, given that the tradeoff exposed by i10 scheduler is particularly useful for remote storage devices (and as Jens suggested, perhaps for virtualized local storage access), I do agree with Sagi -- I think we should consider including it in the core, since this may be useful for a broad range of new use cases.
We have also created a second version of the patch that includes these updates: https://github.com/i10-kernel/upstream-linux/blob/master/0002-iosched-Add-i10-I-O-Scheduler.patch
As always, thank you for the constructive discussion and I look forward to working with you on this.
Best,
~Rachit
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Quoted 10 lines · Sagi Grimberg
Quoted 9 lines
Quoted 3 lines
But if you think this has a better home, I'm assuming that the guys will be open to that.
Also see the reply from Ming. It's a balancing act - don't want to add extra overhead to the core, but also don't want to carry an extra scheduler if the main change is really just variable dispatch batching. And since we already have a notion of that, seems worthwhile to explore that venue.
Quoted 8 lines
I agree,
The main difference is that this balancing is not driven from device resource pressure, but rather from an assumption of device specific optimization (and also with a specific optimization target), hence a scheduler a user would need to opt-in seemed like a good compromise.
But maybe Ming has some good ideas on a different way to add it..
Not yet, :-(
It is one very good work to show that IO is improved with batching.
One big question I am still not clear is that how NVMe-TCP performance( should be throughput according to 'Introduction' part of paper[1]) is improved much when batching IO is applied. Is it because network stack performs much well for transporting big chunk data? Or context switch overhead is reduced because 'Ringing the doorbell' implies worker queue scheduling, according to '2.4 Delayed Doorbells' of [1]. Or both? Or others? Do we have data wrt. how much improvement from each factor?
Another question is that 'Introduction' of [1] part mentions that i10 is more for 'throughput-bound applications'. And 'at low loads, latencies may be high(within 1.7× of NVMe-over-RDMA latency over storage devices))', so i10 scheduler is primarily for throughput-bound applications? If yes, I'd suggest to add the words to commit log for helping people to review. Then we can avoid to consider IO latency sensitive usages(such as iopoll).
[1] https://www.usenix.org/conference/nsdi20/presentation/hwang
Thanks,
Ming
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Hello,
Quoted 13 lines · Rachit Agarwal
From: Rachit Agarwal <[email protected]>>
Hi All,
I/O batching is beneficial for optimizing IOPS and throughput for various applications. For instance, several kernel block drivers would benefit from batching, including mmc [1] and tcp-based storage drivers like nvme-tcp [2,3]. While we have support for batching dispatch [4], we need an I/O scheduler to efficiently enable batching. Such a scheduler is particularly interesting for disaggregated storage, where the access latency of remote disaggregated storage may be higher than local storage access; thus, batching can significantly help in amortizing the remote access latency while increasing the throughput.
Quoted 5 lines
This patch introduces the i10 I/O scheduler, which performs batching per hctx in terms of #requests, #bytes, and timeouts (at microseconds granularity). i10 starts dispatching only when #requests or #bytes is larger than a default threshold or when a timer expires. After that, batching dispatch [3] would happen, allowing batching at device drivers along with "
bd->last" and ".commit_rqs".
blk-mq actually has built-in batching(or sort of) mechanism, which is enabled if the hw queue is busy(hctx->dispatch_busy is > 0). We use EWMA to compute hctx->dispatch_busy, and it is adaptive, even though the implementation is quite coarse. But there should be much space to improve, IMO.
It is reported that this way improves SQ high-end SCSI SSD very much[1], and MMC performance gets improved too[2].
[1] https://lore.kernel.org/linux-block/[email protected]/
[2] https://lore.kernel.org/linux-block/CADBw62o9eTQDJ9RvNgEqSpXmg6Xcq=2TxH0Hfxhp29uF2W=TXA@mail.gmail.com/
Quoted 7 lines
The i10 I/O scheduler builds upon recent work on [6]. We have tested the i10 I/O scheduler with nvme-tcp optimizaitons [2,3] and batching dispatch [4], varying number of cores, varying read/write ratios, and varying request sizes, and with NVMe SSD and RAM block device. For NVMe SSDs, the i10 I/O scheduler achieves ~60% improvements in terms of IOPS per core over "noop" I/O scheduler. These results are available at [5], and many additional results are presented in [6].
In case of none scheduler, basically nvme driver won't provide any queue busy feedback, so the built-in batching dispatch doesn't work simply.
kyber scheduler uses io latency feedback to throttle and build io batch, can you compare i10 with kyber on nvme/nvme-tcp?
Quoted 9 lines
While other schedulers may also batch I/O (e.g., mq-deadline), the optimization target in the i10 I/O scheduler is throughput maximization. Hence there is no latency target nor a need for a global tracking context, so a new scheduler is needed rather than to build this functionality to an existing scheduler.
We currently use fixed default values as batching thresholds (e.g., 16 for #requests, 64KB for #bytes, and 50us for timeout). These default values are based on sensitivity tests in [6]. For our future work, we plan to support adaptive batching according to
Frankly speaking, hardcode 16 #rquests or 64KB may not work everywhere, and product environment could be much complicated than your sensitivity tests. If possible, please start with adaptive batching.
50us timeout can be contributed to IO latency, and I'd like to see io latency data with i10, especially i10 vs. vanilla none.
Thanks,
Ming
Sagi Grimberg
maintainerQuoted 5 lines
blk-mq actually has built-in batching(or sort of) mechanism, which is enabled if the hw queue is
busy(hctx->dispatch_busy is > 0). We use EWMA to computehctx->dispatch_busy, and it is adaptive, even though the implementation is quite coarse. But there should be much space to improve, IMO.
You are correct, however nvme-tcp should be getting to dispatch_busy > 0 IIUC.
Quoted 5 lines
It is reported that this way improves SQ high-end SCSI SSD very much[1], and MMC performance gets improved too[2].
[1] https://lore.kernel.org/linux-block/[email protected]/
[2] https://lore.kernel.org/linux-block/CADBw62o9eTQDJ9RvNgEqSpXmg6Xcq=2TxH0Hfxhp29uF2W=TXA@mail.gmail.com/
Yes, the guys paid attention to the MMC related improvements that you made.
Quoted 9 lines
Quoted 6 lines
The i10 I/O scheduler builds upon recent work on [6]. We have tested the i10 I/O scheduler with nvme-tcp optimizaitons [2,3] and batching dispatch [4], varying number of cores, varying read/write ratios, and varying request sizes, and with NVMe SSD and RAM block device. For NVMe SSDs, the i10 I/O scheduler achieves ~60% improvements in terms of IOPS per core over "noop" I/O scheduler. These results are available at [5], and many additional results are presented in [6].
In case of none scheduler, basically nvme driver won't provide any queue busy feedback, so the built-in batching dispatch doesn't work simply.
Exactly.
Quoted 2 lines
kyber scheduler uses io latency feedback to throttle and build io batch, can you compare i10 with kyber on nvme/nvme-tcp?
I assume it should be simple to get, I'll let Rachit/Jaehyun comment.
Quoted 5 lines
Quoted 5 lines
While other schedulers may also batch I/O (e.g., mq-deadline), the optimization target in the i10 I/O scheduler is throughput maximization. Hence there is no latency target nor a need for a global tracking context, so a new scheduler is needed rather than to build this functionality to an existing scheduler.
Quoted 7 lines
Quoted 3 lines
We currently use fixed default values as batching thresholds (e.g., 16 for #requests, 64KB for #bytes, and 50us for timeout). These default values are based on sensitivity tests in [6]. For our future work, we plan to support adaptive batching according to
Frankly speaking, hardcode 16 #rquests or 64KB may not work everywhere, and product environment could be much complicated than your sensitivity tests. If possible, please start with adaptive batching.
That was my feedback as well for sure. But given that this is a scheduler one would opt-in to anyway, that won't be a must-have initially. I'm not sure if the guys made progress with this yet, I'll let them comment.