Re: [PATCH 1/2] blk-mq: Export iterating all tagged requests

2018-12-02 Thread Ming Lei
On Sun, Dec 2, 2018 at 12:48 AM Christoph Hellwig wrote: > > On Fri, Nov 30, 2018 at 01:36:09PM -0700, Jens Axboe wrote: > > On 11/30/18 1:26 PM, Keith Busch wrote: > > > A driver may wish to iterate every tagged request, not just ones that > > > satisfy blk_mq_request_started(). The intended use

[PATCH 11/13] block: remove ->poll_fn

2018-12-02 Thread Christoph Hellwig
This was intended to support users like nvme multipath, but is just getting in the way and adding another indirect call. Signed-off-by: Christoph Hellwig --- block/blk-core.c | 23 --- block/blk-mq.c | 24 +++- include/linux/blkdev.h | 2 --

[PATCH 13/13] block: enable polling by default if a poll map is initalized

2018-12-02 Thread Christoph Hellwig
If the user did setup polling in the driver we should not require another know in the block layer to enable it. Signed-off-by: Christoph Hellwig --- block/blk-mq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/blk-mq.c b/block/blk-mq.c index 9c90c5038d07..a550a00ac00c 100644 ---

[PATCH 08/13] nvme-pci: remove the CQ lock for interrupt driven queues

2018-12-02 Thread Christoph Hellwig
Now that we can't poll regular, interrupt driven I/O queues there is almost nothing that can race with an interrupt. The only possible other contexts polling a CQ are the error handler and queue shutdown, and both are so far off in the slow path that we can simply use the big hammer of disabling

[PATCH 07/13] nvme-pci: don't poll from irq context when deleting queues

2018-12-02 Thread Christoph Hellwig
This is the last place outside of nvme_irq that handles CQEs from interrupt context, and thus is in the way of removing the cq_lock for normal queues, and avoiding lockdep warnings on the poll queues, for which we already take it without IRQ disabling. Signed-off-by: Christoph Hellwig ---

[PATCH 10/13] nvme-mpath: remove I/O polling support

2018-12-02 Thread Christoph Hellwig
The ->poll_fn has been stale for a while, as a lot of places check for mq ops. But there is no real point in it anyway, as we don't even use the multipath code for subsystems without multiple ports, which is usually what we do high performance I/O to. If it really becomes an issue we should

[PATCH 09/13] nvme-rdma: remove I/O polling support

2018-12-02 Thread Christoph Hellwig
The code was always a bit of a hack that digs far too much into RDMA core internals. Lets kick it out and reimplement proper dedicated poll queues as needed. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/rdma.c | 24 1 file changed, 24 deletions(-) diff --git

[PATCH 12/13] block: only allow polling if a poll queue_map exists

2018-12-02 Thread Christoph Hellwig
This avoids having to have differnet mq_ops for different setups with or without poll queues. Signed-off-by: Christoph Hellwig --- block/blk-sysfs.c | 2 +- drivers/nvme/host/pci.c | 29 + 2 files changed, 10 insertions(+), 21 deletions(-) diff --git

[PATCH 06/13] nvme-pci: refactor nvme_disable_io_queues

2018-12-02 Thread Christoph Hellwig
Pass the opcode for the delete SQ/CQ command as an argument instead of the somewhat confusing pass loop. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch --- drivers/nvme/host/pci.c | 41 - 1 file changed, 20 insertions(+), 21 deletions(-) diff

[PATCH 02/13] nvme-pci: use atomic bitops to mark a queue enabled

2018-12-02 Thread Christoph Hellwig
This gets rid of all the messing with cq_vector and the ->polled field by using an atomic bitop to mark the queue enabled or not. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch --- drivers/nvme/host/pci.c | 43 ++--- 1 file changed, 15

[PATCH 01/13] block: move queues types to the block layer

2018-12-02 Thread Christoph Hellwig
Having another indirect all in the fast path doesn't really help in our post-spectre world. Also having too many queue type is just going to create confusion, so I'd rather manage them centrally. Note that the queue type naming and ordering changes a bit - the first index now is the default

[PATCH 05/13] nvme-pci: consolidate code for polling non-dedicated queues

2018-12-02 Thread Christoph Hellwig
We have three places that can poll for I/O completions on a normal interrupt-enabled queue. All of them are in slow path code, so consolidate them to a single helper that uses spin_lock_irqsave and removes the fast path cqe_pending check. Signed-off-by: Christoph Hellwig ---

[PATCH 04/13] nvme-pci: only allow polling with separate poll queues

2018-12-02 Thread Christoph Hellwig
This will allow us to simplify both the regular NVMe interrupt handler and the upcoming aio poll code. In addition to that the separate queues are generally a good idea for performance reasons. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/pci.c | 18 +- 1 file

block and nvme polling improvements V3

2018-12-02 Thread Christoph Hellwig
Hi all, this series optimizes a few bits in the block layer and nvme code related to polling. It starts by moving the queue types recently introduce entirely into the block layer instead of requiring an indirect call for them. It then switches nvme and the block layer to only allow polling with

[PATCH 03/13] nvme-pci: cleanup SQ allocation a bit

2018-12-02 Thread Christoph Hellwig
Use a bit flag to mark if the SQ was allocated from the CMB, and clean up the surrounding code a bit. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch --- drivers/nvme/host/pci.c | 33 +++-- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git