Re: [PATCH 3/7] nvme: implement mq_ops->commit_rqs() hook

2018-11-29 Thread Jens Axboe
On 11/29/18 10:38 AM, Keith Busch wrote: > On Thu, Nov 29, 2018 at 10:06:20AM -0700, Jens Axboe wrote: >> On 11/29/18 10:04 AM, Christoph Hellwig wrote: >>> gcc never warns about unused static inline functions. Which makes a lot >>> of sense at least for headers.. >> >> Not so much for non-headers

Re: [PATCH 3/7] nvme: implement mq_ops->commit_rqs() hook

2018-11-29 Thread Keith Busch
On Thu, Nov 29, 2018 at 10:06:20AM -0700, Jens Axboe wrote: > On 11/29/18 10:04 AM, Christoph Hellwig wrote: > > gcc never warns about unused static inline functions. Which makes a lot > > of sense at least for headers.. > > Not so much for non-headers :-) You can #include .c files too! :)

Re: [PATCH 3/7] nvme: implement mq_ops->commit_rqs() hook

2018-11-29 Thread Jens Axboe
On 11/29/18 10:04 AM, Christoph Hellwig wrote: > On Thu, Nov 29, 2018 at 10:02:25AM -0700, Jens Axboe wrote: >> On 11/29/18 8:47 AM, Christoph Hellwig wrote: +static inline int nvme_next_ring_index(struct nvme_queue *nvmeq, u16 index) +{ + if (++index == nvmeq->q_depth) +

Re: [PATCH 3/7] nvme: implement mq_ops->commit_rqs() hook

2018-11-29 Thread Christoph Hellwig
On Thu, Nov 29, 2018 at 10:02:25AM -0700, Jens Axboe wrote: > On 11/29/18 8:47 AM, Christoph Hellwig wrote: > >> +static inline int nvme_next_ring_index(struct nvme_queue *nvmeq, u16 > >> index) > >> +{ > >> + if (++index == nvmeq->q_depth) > >> + return 0; > >> + > >> + return index; >

Re: [PATCH 3/7] nvme: implement mq_ops->commit_rqs() hook

2018-11-29 Thread Jens Axboe
On 11/29/18 8:47 AM, Christoph Hellwig wrote: >> +static inline int nvme_next_ring_index(struct nvme_queue *nvmeq, u16 index) >> +{ >> +if (++index == nvmeq->q_depth) >> +return 0; >> + >> +return index; >> +} > > This is unused now. Huh, wonder how I missed that. GCC must not

Re: [PATCH 3/7] nvme: implement mq_ops->commit_rqs() hook

2018-11-29 Thread Christoph Hellwig
> +static inline int nvme_next_ring_index(struct nvme_queue *nvmeq, u16 index) > +{ > + if (++index == nvmeq->q_depth) > + return 0; > + > + return index; > +} This is unused now. Also what about this little cleanup on top? diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/

[PATCH 3/7] nvme: implement mq_ops->commit_rqs() hook

2018-11-28 Thread Jens Axboe
Split the command submission and the SQ doorbell ring, and add the doorbell ring as our ->commit_rqs() hook. This allows a list of requests to be issued, with nvme only writing the SQ update when it's necessary. This is more efficient if we have lists of requests to issue, particularly on virtualiz