public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Jens Axboe <axboe@kernel.dk>, linux-block@vger.kernel.org
Cc: Tejun Heo <tj@kernel.org>,
	Bart Van Assche <bart.vanassche@wdc.com>,
	Martin Steigerwald <Martin@Lichtvoll.de>,
	Israel Rukshin <israelr@mellanox.com>,
	Ming Lei <ming.lei@redhat.com>
Subject: [PATCH V4 0/2] blk-mq: fix race between completion and BLK_EH_RESET_TIMER
Date: Sun, 15 Apr 2018 23:43:55 +0800	[thread overview]
Message-ID: <20180415154357.19788-1-ming.lei@redhat.com> (raw)

Hi Jens,

This two patches fixes the recently discussed race between completion
and BLK_EH_RESET_TIMER.

Israel & Martin, this one is a simpler fix on this issue and can
cover the potencial hang of MQ_RQ_COMPLETE_IN_TIMEOUT request, could
you test V4 and see if your issue can be fixed?

Thanks,

V4:
	- run synchronize_rcu() once for handling all timed out request
	between .timeout() and the following handling
	- address tj's concern about reorder between blk_add_timer() and
    blk_mq_rq_update_aborted_gstate(req, 0)

V3:
	- before completing rq for BLK_EH_HANDLED, sync with normal completion path
	- make sure rq's state updated as MQ_RQ_IN_FLIGHT before completing
V2:
	- rename the new flag as MQ_RQ_COMPLETE_IN_TIMEOUT
	- fix lock uses in blk_mq_rq_timed_out
	- document re-order between blk_add_timer() and
	blk_mq_rq_update_aborted_gstate(req, 0)


Ming Lei (2):
  blk-mq: set RQF_MQ_TIMEOUT_EXPIRED when the rq's timeout isn't handled
  blk-mq: fix race between complete and BLK_EH_RESET_TIMER

 block/blk-mq.c         | 120 +++++++++++++++++++++++++++++++++++++++----------
 block/blk-mq.h         |   1 +
 block/blk-timeout.c    |   1 -
 include/linux/blkdev.h |   6 +++
 4 files changed, 104 insertions(+), 24 deletions(-)

-- 
2.9.5

             reply	other threads:[~2018-04-15 15:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-15 15:43 Ming Lei [this message]
2018-04-15 15:43 ` [PATCH V4 1/2] blk-mq: set RQF_MQ_TIMEOUT_EXPIRED when the rq's timeout isn't handled Ming Lei
2018-04-15 15:43 ` [PATCH V4 2/2] blk-mq: fix race between complete and BLK_EH_RESET_TIMER Ming Lei
2018-04-15 16:31 ` [PATCH V4 0/2] blk-mq: fix race between completion " Martin Steigerwald
2018-04-16  0:45   ` Ming Lei
2018-04-16 13:12     ` Martin Steigerwald
2018-04-16 16:04       ` jianchao.wang
2018-04-17  0:15         ` Bart Van Assche
2018-04-17  3:49           ` jianchao.wang
2018-04-18 16:46       ` Ming Lei
2018-04-23  8:41         ` Martin Steigerwald

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=20180415154357.19788-1-ming.lei@redhat.com \
    --to=ming.lei@redhat.com \
    --cc=Martin@Lichtvoll.de \
    --cc=axboe@kernel.dk \
    --cc=bart.vanassche@wdc.com \
    --cc=israelr@mellanox.com \
    --cc=linux-block@vger.kernel.org \
    --cc=tj@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox