Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-29 Thread Maxim Patlasov
On 08/28/2014 06:06 AM, Ming Lei wrote: On 8/28/14, Maxim Patlasov wrote: On 08/21/2014 09:44 AM, Ming Lei wrote: On Wed, Aug 20, 2014 at 4:50 AM, Jens Axboe wrote: Reworked a bit more: http://git.kernel.dk/?p=linux-block.git;a=commit;h=a323185a761b9a54dc340d383695b4205ea258b6 One big pro

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-29 Thread Maxim Patlasov
On 8/28/14, Zach Brown wrote: On Wed, Aug 27, 2014 at 09:19:36PM +0400, Maxim Patlasov wrote: On 08/27/2014 08:29 PM, Benjamin LaHaise wrote: On Wed, Aug 27, 2014 at 08:08:59PM +0400, Maxim Patlasov wrote: ... 1) /dev/loop0 of 3.17.0-rc1 with Ming's patches applied -- 11K iops 2) the same as

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-27 Thread Ming Lei
On 8/28/14, Zach Brown wrote: > On Wed, Aug 27, 2014 at 09:19:36PM +0400, Maxim Patlasov wrote: >> On 08/27/2014 08:29 PM, Benjamin LaHaise wrote: >> >On Wed, Aug 27, 2014 at 08:08:59PM +0400, Maxim Patlasov wrote: >> >... >> >>1) /dev/loop0 of 3.17.0-rc1 with Ming's patches applied -- 11K iops >>

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-27 Thread Ming Lei
On 8/28/14, Maxim Patlasov wrote: > On 08/21/2014 09:44 AM, Ming Lei wrote: >> On Wed, Aug 20, 2014 at 4:50 AM, Jens Axboe wrote: >> >>> >>> Reworked a bit more: >>> >>> http://git.kernel.dk/?p=linux-block.git;a=commit;h=a323185a761b9a54dc340d383695b4205ea258b6 >> One big problem of the commit is

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-27 Thread Zach Brown
On Wed, Aug 27, 2014 at 09:19:36PM +0400, Maxim Patlasov wrote: > On 08/27/2014 08:29 PM, Benjamin LaHaise wrote: > >On Wed, Aug 27, 2014 at 08:08:59PM +0400, Maxim Patlasov wrote: > >... > >>1) /dev/loop0 of 3.17.0-rc1 with Ming's patches applied -- 11K iops > >>2) the same as above, but call loop

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-27 Thread Maxim Patlasov
On 08/27/2014 08:29 PM, Benjamin LaHaise wrote: On Wed, Aug 27, 2014 at 08:08:59PM +0400, Maxim Patlasov wrote: ... 1) /dev/loop0 of 3.17.0-rc1 with Ming's patches applied -- 11K iops 2) the same as above, but call loop_queue_work() directly from loop_queue_rq() -- 270K iops 3) /dev/nullb0 of 3.

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-27 Thread Benjamin LaHaise
On Wed, Aug 27, 2014 at 08:08:59PM +0400, Maxim Patlasov wrote: ... > 1) /dev/loop0 of 3.17.0-rc1 with Ming's patches applied -- 11K iops > 2) the same as above, but call loop_queue_work() directly from > loop_queue_rq() -- 270K iops > 3) /dev/nullb0 of 3.17.0-rc1 -- 380K iops > > Taking into acc

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-27 Thread Maxim Patlasov
On 08/21/2014 09:44 AM, Ming Lei wrote: On Wed, Aug 20, 2014 at 4:50 AM, Jens Axboe wrote: Reworked a bit more: http://git.kernel.dk/?p=linux-block.git;a=commit;h=a323185a761b9a54dc340d383695b4205ea258b6 One big problem of the commit is that it is basically a serialized workqueue because of

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-20 Thread Ming Lei
On Wed, Aug 20, 2014 at 4:50 AM, Jens Axboe wrote: > > > Reworked a bit more: > > http://git.kernel.dk/?p=linux-block.git;a=commit;h=a323185a761b9a54dc340d383695b4205ea258b6 One big problem of the commit is that it is basically a serialized workqueue because of single &hctx->run_work, and per-re

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-20 Thread Ming Lei
On Thu, Aug 21, 2014 at 10:58 AM, Jens Axboe wrote: > On 2014-08-20 21:54, Ming Lei wrote: From my investigation, context switch increases almost 50% with workqueue compared with kthread in loop in a quad-core VM. With kthread, requests may be handled as batch in cases which

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-20 Thread Ming Lei
On Thu, Aug 21, 2014 at 11:13 AM, Ming Lei wrote: > On Thu, Aug 21, 2014 at 10:58 AM, Jens Axboe wrote: >> On 2014-08-20 21:54, Ming Lei wrote: > > From my investigation, context switch increases almost 50% with > workqueue compared with kthread in loop in a quad-core VM. With >

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-20 Thread Ming Lei
On Thu, Aug 21, 2014 at 10:58 AM, Jens Axboe wrote: > On 2014-08-20 21:54, Ming Lei wrote: From my investigation, context switch increases almost 50% with workqueue compared with kthread in loop in a quad-core VM. With kthread, requests may be handled as batch in cases which

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-20 Thread Ming Lei
On Thu, Aug 21, 2014 at 12:09 AM, Jens Axboe wrote: > On 2014-08-19 20:23, Ming Lei wrote: >> >> On Wed, Aug 20, 2014 at 4:50 AM, Jens Axboe wrote: >>> >>> On 2014-08-18 06:53, Ming Lei wrote: On Mon, Aug 18, 2014 at 9:22 AM, Ming Lei wrote: > > > On Mon, Aug 18,

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-19 Thread Ming Lei
On Wed, Aug 20, 2014 at 4:50 AM, Jens Axboe wrote: > On 2014-08-18 06:53, Ming Lei wrote: >> >> On Mon, Aug 18, 2014 at 9:22 AM, Ming Lei wrote: >>> >>> On Mon, Aug 18, 2014 at 1:48 AM, Jens Axboe wrote: On 2014-08-16 02:06, Ming Lei wrote: > > > On 8/16/14, Jens Axboe wro

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-18 Thread Ming Lei
On Mon, Aug 18, 2014 at 9:22 AM, Ming Lei wrote: > On Mon, Aug 18, 2014 at 1:48 AM, Jens Axboe wrote: >> On 2014-08-16 02:06, Ming Lei wrote: >>> >>> On 8/16/14, Jens Axboe wrote: On 08/15/2014 10:36 AM, Jens Axboe wrote: > > On 08/15/2014 10:31 AM, Christoph Hellwig wrote: >>>

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-17 Thread Ming Lei
On Mon, Aug 18, 2014 at 1:48 AM, Jens Axboe wrote: > On 2014-08-16 02:06, Ming Lei wrote: >> >> On 8/16/14, Jens Axboe wrote: >>> >>> On 08/15/2014 10:36 AM, Jens Axboe wrote: On 08/15/2014 10:31 AM, Christoph Hellwig wrote: >> >> +static void loop_queue_work(struct work_struct

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-17 Thread Jens Axboe
On 2014-08-16 02:06, Ming Lei wrote: On 8/16/14, Jens Axboe wrote: On 08/15/2014 10:36 AM, Jens Axboe wrote: On 08/15/2014 10:31 AM, Christoph Hellwig wrote: +static void loop_queue_work(struct work_struct *work) Offloading work straight to a workqueue dosn't make much sense in the blk-mq m

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-16 Thread Ming Lei
On 8/16/14, Jens Axboe wrote: > On 08/15/2014 10:36 AM, Jens Axboe wrote: >> On 08/15/2014 10:31 AM, Christoph Hellwig wrote: +static void loop_queue_work(struct work_struct *work) >>> >>> Offloading work straight to a workqueue dosn't make much sense >>> in the blk-mq model as we'll usually

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-15 Thread Jens Axboe
On 08/15/2014 10:36 AM, Jens Axboe wrote: > On 08/15/2014 10:31 AM, Christoph Hellwig wrote: >>> +static void loop_queue_work(struct work_struct *work) >> >> Offloading work straight to a workqueue dosn't make much sense >> in the blk-mq model as we'll usually be called from one. If you >> need to

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-15 Thread Jens Axboe
On 08/15/2014 10:31 AM, Christoph Hellwig wrote: >> +static void loop_queue_work(struct work_struct *work) > > Offloading work straight to a workqueue dosn't make much sense > in the blk-mq model as we'll usually be called from one. If you > need to avoid the cases where we are called directly a

Re: [PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-15 Thread Christoph Hellwig
> + > +static int loop_init_hctx(struct blk_mq_hw_ctx *hctx, void *data, > + unsigned int index) > +{ > + struct loop_device *lo = data; > + > + hctx->driver_data = lo; I don't think there is much of a point to store this in the hctx instead of relying on the queue.

[PATCH v1 5/9] block: loop: convert to blk-mq

2014-08-14 Thread Ming Lei
The conversion is a bit straightforward, and use work queue to dispatch reqests of loop block, so scalability gets improved a lot, and also thoughput is increased a lot in case of concurrent I/O requests. Another benefit is that loop driver code gets simplified much, and the patch can be thought a