Re: [PATCH 2/2] umem: fix up unplugging

From: Tao Guo
Date: Mon Jun 04 2012 - 10:49:34 EST


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 <glorioustao@xxxxxxxxx> wrote:
> 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 <Tao.Guo@xxxxxxx>
> Cc: Neil Brown <neilb@xxxxxxx>
> Cc: Jens Axboe <axboe@xxxxxxxxx>
> Cc: <stable@xxxxxxxxxxxxxxx>
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Cc: <stable@xxxxxxxxxxxxxxx>
> ---
> Â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
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/