All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Keith Busch <kbusch@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, Sagi Grimberg <sagi@grimberg.me>,
	Bart Van Assche <bvanassche@acm.org>,
	James Smart <james.smart@broadcom.com>,
	Christoph Hellwig <hch@lst.de>,
	linux-nvme@lists.infradead.org
Subject: Re: [PATCH V2 1/2] blk-mq: introduce blk_mq_complete_request_sync()
Date: Thu, 28 Mar 2019 08:50:57 +0800	[thread overview]
Message-ID: <20190328005056.GA19708@ming.t460p> (raw)
In-Reply-To: <20190327133244.GA8448@localhost.localdomain>

On Wed, Mar 27, 2019 at 07:32:45AM -0600, Keith Busch wrote:
> On Wed, Mar 27, 2019 at 04:51:13PM +0800, Ming Lei wrote:
> > @@ -594,8 +594,11 @@ static void __blk_mq_complete_request(struct request *rq)
> >  	/*
> >  	 * For a polled request, always complete locallly, it's pointless
> >  	 * to redirect the completion.
> > +	 *
> > +	 * If driver requires to complete the request synchronously,
> > +	 * complete it locally, and it is usually done in error handler.
> >  	 */
> > -	if ((rq->cmd_flags & REQ_HIPRI) ||
> > +	if ((rq->cmd_flags & REQ_HIPRI) || sync ||
> >  	    !test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags)) {
> >  		q->mq_ops->complete(rq);
> >  		return;
> 
> I think this is fine and agree this is fixing a problem, but just
> considering an alternative: would it be okay to just temporarily clear
> QUEUE_FLAG_SAME_COMP in the necessary error handling that wants a sync
> completion so that we're not introducing an additional parameter?

But the flag can be changed by sysfs too.

Thanks,
Ming

WARNING: multiple messages have this Message-ID (diff)
From: ming.lei@redhat.com (Ming Lei)
Subject: [PATCH V2 1/2] blk-mq: introduce blk_mq_complete_request_sync()
Date: Thu, 28 Mar 2019 08:50:57 +0800	[thread overview]
Message-ID: <20190328005056.GA19708@ming.t460p> (raw)
In-Reply-To: <20190327133244.GA8448@localhost.localdomain>

On Wed, Mar 27, 2019@07:32:45AM -0600, Keith Busch wrote:
> On Wed, Mar 27, 2019@04:51:13PM +0800, Ming Lei wrote:
> > @@ -594,8 +594,11 @@ static void __blk_mq_complete_request(struct request *rq)
> >  	/*
> >  	 * For a polled request, always complete locallly, it's pointless
> >  	 * to redirect the completion.
> > +	 *
> > +	 * If driver requires to complete the request synchronously,
> > +	 * complete it locally, and it is usually done in error handler.
> >  	 */
> > -	if ((rq->cmd_flags & REQ_HIPRI) ||
> > +	if ((rq->cmd_flags & REQ_HIPRI) || sync ||
> >  	    !test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags)) {
> >  		q->mq_ops->complete(rq);
> >  		return;
> 
> I think this is fine and agree this is fixing a problem, but just
> considering an alternative: would it be okay to just temporarily clear
> QUEUE_FLAG_SAME_COMP in the necessary error handling that wants a sync
> completion so that we're not introducing an additional parameter?

But the flag can be changed by sysfs too.

Thanks,
Ming

  reply	other threads:[~2019-03-28  0:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-27  8:51 [PATCH V2 0/2] blk-mq/nvme: cancel request synchronously Ming Lei
2019-03-27  8:51 ` [PATCH V2 1/2] blk-mq: introduce blk_mq_complete_request_sync() Ming Lei
2019-03-27  8:51   ` Ming Lei
2019-03-27 13:32   ` Keith Busch
2019-03-27 13:32     ` Keith Busch
2019-03-28  0:50     ` Ming Lei [this message]
2019-03-28  0:50       ` Ming Lei
2019-03-27  8:51 ` [PATCH V2 2/2] nvme: cancel request synchronously Ming Lei
2019-03-27  8:51   ` Ming Lei
2019-04-02  3:38 ` [PATCH V2 0/2] blk-mq/nvme: " Ming Lei

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=20190328005056.GA19708@ming.t460p \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=hch@lst.de \
    --cc=james.smart@broadcom.com \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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.