Re: [PATCH v4] NVMe: basic conversion to blk-mq

2014-06-02 Thread Matias Bjørling
On 06/02/2014 12:08 PM, Christoph Hellwig wrote: +static int nvme_map_rq(struct nvme_queue *nvmeq, struct nvme_iod *iod, + struct request *req, enum dma_data_direction dma_dir, + int psegs) { sg_init_table(iod->sg, psegs); + iod->nents =

Re: [PATCH v4] NVMe: basic conversion to blk-mq

2014-06-02 Thread Christoph Hellwig
> +static int nvme_map_rq(struct nvme_queue *nvmeq, struct nvme_iod *iod, > + struct request *req, enum dma_data_direction dma_dir, > + int psegs) > { > sg_init_table(iod->sg, psegs); > + iod->nents = blk_rq_map_sg(req->q, req, iod->sg); > > + if

Re: [PATCH v4] NVMe: basic conversion to blk-mq

2014-06-02 Thread Christoph Hellwig
+static int nvme_map_rq(struct nvme_queue *nvmeq, struct nvme_iod *iod, + struct request *req, enum dma_data_direction dma_dir, + int psegs) { sg_init_table(iod-sg, psegs); + iod-nents = blk_rq_map_sg(req-q, req, iod-sg); + if

Re: [PATCH v4] NVMe: basic conversion to blk-mq

2014-06-02 Thread Matias Bjørling
On 06/02/2014 12:08 PM, Christoph Hellwig wrote: +static int nvme_map_rq(struct nvme_queue *nvmeq, struct nvme_iod *iod, + struct request *req, enum dma_data_direction dma_dir, + int psegs) { sg_init_table(iod-sg, psegs); + iod-nents =

Re: [PATCH v4] NVMe: basic conversion to blk-mq

2014-05-30 Thread Jens Axboe
On 05/30/2014 09:00 AM, Matthew Wilcox wrote: > On Thu, May 29, 2014 at 11:51:25PM +0200, Matias Bjørling wrote: >> -static int nvme_map_bio(struct nvme_queue *nvmeq, struct nvme_iod *iod, >> -struct bio *bio, enum dma_data_direction dma_dir, int psegs) >> +static int

Re: [PATCH v4] NVMe: basic conversion to blk-mq

2014-05-30 Thread Matias Bjorling
On 05/30/2014 06:48 PM, Keith Busch wrote: > On Thu, 29 May 2014, Matias Bjørling wrote: >> This converts the current NVMe driver to utilize the blk-mq layer. > > I'm pretty darn sure this new nvme_remove can cause a process > with an open reference to use queues after they're freed in the >

Re: [PATCH v4] NVMe: basic conversion to blk-mq

2014-05-30 Thread Matthew Wilcox
On Thu, May 29, 2014 at 11:51:25PM +0200, Matias Bjørling wrote: > +static int nvme_init_hctx(struct blk_mq_hw_ctx *hctx, void *data, > + unsigned int i) > { > + struct nvme_dev *dev = data; > + struct nvme_queue *nvmeq = dev->queues[(i % dev->queue_count) + 1]; > +

Re: [PATCH v4] NVMe: basic conversion to blk-mq

2014-05-30 Thread Keith Busch
On Thu, 29 May 2014, Matias Bjørling wrote: This converts the current NVMe driver to utilize the blk-mq layer. I'm pretty darn sure this new nvme_remove can cause a process with an open reference to use queues after they're freed in the nvme_submit_sync_command path, maybe even the admin tags

Re: [PATCH v4] NVMe: basic conversion to blk-mq

2014-05-30 Thread Matthew Wilcox
On Thu, May 29, 2014 at 11:51:25PM +0200, Matias Bjørling wrote: > -static int nvme_map_bio(struct nvme_queue *nvmeq, struct nvme_iod *iod, > - struct bio *bio, enum dma_data_direction dma_dir, int psegs) > +static int nvme_map_rq(struct nvme_queue *nvmeq, struct nvme_iod *iod, > +

Re: [PATCH v4] NVMe: basic conversion to blk-mq

2014-05-30 Thread Matthew Wilcox
On Thu, May 29, 2014 at 11:51:25PM +0200, Matias Bjørling wrote: > @@ -816,9 +671,7 @@ static irqreturn_t nvme_irq(int irq, void *data) > irqreturn_t result; > struct nvme_queue *nvmeq = data; > spin_lock(>q_lock); > - nvme_process_cq(nvmeq); > - result = nvmeq->cqe_seen

Re: [PATCH v4] NVMe: basic conversion to blk-mq

2014-05-30 Thread Matthew Wilcox
On Thu, May 29, 2014 at 11:51:25PM +0200, Matias Bjørling wrote: @@ -816,9 +671,7 @@ static irqreturn_t nvme_irq(int irq, void *data) irqreturn_t result; struct nvme_queue *nvmeq = data; spin_lock(nvmeq-q_lock); - nvme_process_cq(nvmeq); - result = nvmeq-cqe_seen ?

Re: [PATCH v4] NVMe: basic conversion to blk-mq

2014-05-30 Thread Matthew Wilcox
On Thu, May 29, 2014 at 11:51:25PM +0200, Matias Bjørling wrote: -static int nvme_map_bio(struct nvme_queue *nvmeq, struct nvme_iod *iod, - struct bio *bio, enum dma_data_direction dma_dir, int psegs) +static int nvme_map_rq(struct nvme_queue *nvmeq, struct nvme_iod *iod, +

Re: [PATCH v4] NVMe: basic conversion to blk-mq

2014-05-30 Thread Keith Busch
On Thu, 29 May 2014, Matias Bjørling wrote: This converts the current NVMe driver to utilize the blk-mq layer. I'm pretty darn sure this new nvme_remove can cause a process with an open reference to use queues after they're freed in the nvme_submit_sync_command path, maybe even the admin tags

Re: [PATCH v4] NVMe: basic conversion to blk-mq

2014-05-30 Thread Matthew Wilcox
On Thu, May 29, 2014 at 11:51:25PM +0200, Matias Bjørling wrote: +static int nvme_init_hctx(struct blk_mq_hw_ctx *hctx, void *data, + unsigned int i) { + struct nvme_dev *dev = data; + struct nvme_queue *nvmeq = dev-queues[(i % dev-queue_count) + 1]; +

Re: [PATCH v4] NVMe: basic conversion to blk-mq

2014-05-30 Thread Matias Bjorling
On 05/30/2014 06:48 PM, Keith Busch wrote: On Thu, 29 May 2014, Matias Bjørling wrote: This converts the current NVMe driver to utilize the blk-mq layer. I'm pretty darn sure this new nvme_remove can cause a process with an open reference to use queues after they're freed in the

Re: [PATCH v4] NVMe: basic conversion to blk-mq

2014-05-30 Thread Jens Axboe
On 05/30/2014 09:00 AM, Matthew Wilcox wrote: On Thu, May 29, 2014 at 11:51:25PM +0200, Matias Bjørling wrote: -static int nvme_map_bio(struct nvme_queue *nvmeq, struct nvme_iod *iod, -struct bio *bio, enum dma_data_direction dma_dir, int psegs) +static int nvme_map_rq(struct

[PATCH v4] NVMe: basic conversion to blk-mq

2014-05-29 Thread Matias Bjørling
This converts the current NVMe driver to utilize the blk-mq layer. Contributions in this patch from: Sam Bradshaw Jens Axboe Signed-off-by: Matias Bjørling --- drivers/block/nvme-core.c | 1100 ++--- include/linux/nvme.h | 11 +- 2 files

[PATCH v4] NVMe: basic conversion to blk-mq

2014-05-29 Thread Matias Bjørling
This converts the current NVMe driver to utilize the blk-mq layer. Contributions in this patch from: Sam Bradshaw sbrads...@micron.com Jens Axboe ax...@kernel.dk Signed-off-by: Matias Bjørling m...@bjorling.me --- drivers/block/nvme-core.c | 1100