Re: [PATCH 2/2] umem: fix up unplugging
From: Tao Guo <hidden>
Date: 2012-06-04 14:49:39
Also in:
lkml
This patch is to fix a regression introduced by 7eaceaccab5f40
("block: remove per-queueplugging").
-Tao
On Mon, Jun 4, 2012 at 10:41 PM, Tao Guo [off-list ref] wrote:quoted hunk ↗ jump to hunk
In that patch, Jens removed the whole mm_unplug_device() function, which used to be the trigger to make umem start to work. We need to implement unplugging to make umem start to work, or I/O will never be triggered. Signed-off-by: Tao Guo <redacted> Cc: Neil Brown <redacted> Cc: Jens Axboe <axboe@kernel.dk> Cc: <redacted> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: <redacted> --- drivers/block/umem.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)diff --git a/drivers/block/umem.c b/drivers/block/umem.c index aa27120..89cc9a6 100644 --- a/drivers/block/umem.c +++ b/drivers/block/umem.c@@ -513,6 +513,15 @@ static void process_page(unsigned long data)} } +static void mm_unplug(struct blk_plug_cb *cb) +{ + struct cardinfo *card = cb->q->queuedata; + + spin_lock_irq(&card->lock); + activate(card); + spin_unlock_irq(&card->lock); +} + static void mm_make_request(struct request_queue *q, struct bio *bio) { struct cardinfo *card = q->queuedata;@@ -523,6 +532,8 @@ static void mm_make_request(struct request_queue *q, struct bio *bio)*card->biotail = bio; bio->bi_next = NULL; card->biotail = &bio->bi_next; + if (bio->bi_rw & REQ_SYNC || !blk_check_plugged(q, mm_unplug)) + activate(card); spin_unlock_irq(&card->lock); return; -- 1.7.7.6