block: loop: use kthread_work
authorMing Lei <ming.lei@canonical.com>
Mon, 17 Aug 2015 02:31:48 +0000 (10:31 +0800)
committerJens Axboe <axboe@fb.com>
Wed, 23 Sep 2015 17:01:16 +0000 (11:01 -0600)
commite03a3d7a94e2485b6e2fa3fb630b9b3a30b65718
treece0d022f49faefa5845da085c0dcd66ff72252f9
parent5b5e20f421c0b6d437b3dec13e53674161998d56
block: loop: use kthread_work

The following patch will use dio/aio to submit IO to backing file,
then it needn't to schedule IO concurrently from work, so
use kthread_work for decreasing context switch cost a lot.

For non-AIO case, single thread has been used for long long time,
and it was just converted to work in v4.0, which has caused performance
regression for fedora live booting already. In discussion[1], even
though submitting I/O via work concurrently can improve random read IO
throughput, meantime it might hurt sequential read IO performance, so
better to restore to single thread behaviour.

For the following AIO support, it is better to use multi hw-queue
with per-hwq kthread than current work approach suppose there is so
high performance requirement for loop.

[1] http://marc.info/?t=143082678400002&r=1&w=2

Signed-off-by: Ming Lei <ming.lei@canonical.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/loop.c
drivers/block/loop.h