All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche@sandisk.com>
To: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"axboe@kernel.dk" <axboe@kernel.dk>
Subject: Re: [PATCH] blk-mq-sched: add might_sleep() check for flush/fua insert
Date: Thu, 20 Apr 2017 22:57:13 +0000	[thread overview]
Message-ID: <1492729028.2642.16.camel@sandisk.com> (raw)
In-Reply-To: <cd6d3a9a-8f6d-1cf8-6379-51de69544c1d@kernel.dk>

On Thu, 2017-04-20 at 16:45 -0600, Jens Axboe wrote:
> If we're doing a flush/fua insert, insertion might block on getting
> a driver tag, if can_block =3D=3D true. Add a might_sleep check for that,
> since we just had a bug like that. This will help us catch a similar
> issue quicker in the future.
>=20
> diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c
> index 9e3c0f92851b..57aec8462e93 100644
> --- a/block/blk-mq-sched.c
> +++ b/block/blk-mq-sched.c
> @@ -372,6 +372,7 @@ void blk_mq_sched_insert_request(struct request *rq, =
bool at_head,
>  	struct blk_mq_hw_ctx *hctx =3D blk_mq_map_queue(q, ctx->cpu);
> =20
>  	if (rq->tag =3D=3D -1 && op_is_flush(rq->cmd_flags)) {
> +		might_sleep_if(can_block);
>  		blk_mq_sched_insert_flush(hctx, rq, can_block);
>  		return;
>  	}

Hello Jens,

The above patch looks fine to me. But seeing that patch made me wonder
whether it would be useful to move that might_sleep_if() call into
blk_mq_get_driver_tag() such that if ever an additional call to
blk_mq_get_driver_tag() is added that might sleep would also be covered?

Bart.=

  reply	other threads:[~2017-04-20 22:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20 22:45 [PATCH] blk-mq-sched: add might_sleep() check for flush/fua insert Jens Axboe
2017-04-20 22:57 ` Bart Van Assche [this message]
2017-04-20 23:09   ` Jens Axboe
2017-04-20 23:20     ` Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1492729028.2642.16.camel@sandisk.com \
    --to=bart.vanassche@sandisk.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.