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>
Cc: Keith Busch <kbusch@kernel.org>,
	Bart Van Assche <bvanassche@acm.org>,
	Christoph Hellwig <hch@lst.de>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	alim.akhtar@samsung.com, avri.altman@wdc.com,
	linux-scsi@vger.kernel.org, linux-block@vger.kernel.org
Subject: Re: [PATCH] scsi: ufs: mark HPB support as BROKEN
Date: Wed, 27 Oct 2021 23:16:14 +0800	[thread overview]
Message-ID: <YXltPgRTxe+Xn66i@T590> (raw)
In-Reply-To: <3f43feaa-5c3a-9e4c-ebc1-c982b0723e7e@kernel.dk>

On Wed, Oct 27, 2021 at 09:06:05AM -0600, Jens Axboe wrote:
> On 10/27/21 9:03 AM, Ming Lei wrote:
> > On Wed, Oct 27, 2021 at 07:12:31AM -0700, Keith Busch wrote:
> >> On Wed, Oct 27, 2021 at 06:16:19AM -0700, Bart Van Assche wrote:
> >>> On 10/26/21 10:27 PM, Christoph Hellwig wrote:
> >>>> On Tue, Oct 26, 2021 at 01:10:47PM -0700, Bart Van Assche wrote:
> >>>>> If blk_insert_cloned_request() is moved into the device mapper then I
> >>>>> think that blk_mq_request_issue_directly() will need to be exported.
> >>>>
> >>>> Which is even worse.
> >>>>
> >>>>> How
> >>>>> about the (totally untested) patch below for removing the
> >>>>> blk_insert_cloned_request() call from the UFS-HPB code?
> >>>>
> >>>> Which again doesn't fix anything.  The problem is that it fans out one
> >>>> request into two on the same queue, not the specific interface used.
> >>>
> >>> That patch fixes the reported issue, namely removing the additional accounting
> >>> caused by calling blk_insert_cloned_request(). Please explain why it is
> >>> considered wrong to fan out one request into two. That code could be reworked
> >>> such that the block layer is not involved as Adrian Hunter explained. However,
> >>> before someone spends time on making these changes I think that someone should
> >>> provide more information about why it is considered wrong to fan out one request
> >>> into two.
> >>
> >> The original request consumes a tag from that queue's tagset. If the
> >> lifetime of that tag depends on that same queue having another free tag,
> >> you can deadlock.
> > 
> > Just take a quick look at the code, if the spawned request can't be allocated,
> > scsi will return BLK_STS_RESOURCE for the original scsi request which will be
> > retried later by blk-mq.
> > 
> > So if tag depth is > 1 and max allowed inflight write buffer command is limited
> > as 1, there shouldn't be the deadlock.
> > 
> > Or is it possible to reuse the original scsi request's tag for the
> > spawned request? Like the trick used in inserting flush request.
> 
> The flush approach did come to mind here as well, but honestly that one is
> very ugly and would never have been permitted if it wasn't excluded to be
> in the very core code already. But yes, reuse of the existing request is
> probably another potentially viable approach. My worry there is that
> inevitably you end up needing to stash a lot of data to restore the original,
> and we're certainly not adding anything to struct request for that.
> 
> Hence I think being able to find a new request reliably would be better.

request with scsi_cmnd may be allocated by the ufshpb driver, even it
should be fine to call ufshcd_queuecommand() directly for this driver
private IO, if the tag can be reused. One example is scsi_ioctl_reset().


Thanks,
Ming


  reply	other threads:[~2021-10-27 15:16 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26  7:12 [PATCH] scsi: ufs: mark HPB support as BROKEN Christoph Hellwig
2021-10-26  7:18 ` Hannes Reinecke
2021-10-26  7:24 ` Damien Le Moal
2021-10-26 13:04   ` James Bottomley
2021-10-26 16:36 ` Bart Van Assche
2021-10-26 17:19   ` James Bottomley
2021-10-26 17:25     ` Jens Axboe
2021-10-26 18:05       ` Bart Van Assche
2021-10-26 18:10         ` Jens Axboe
2021-10-26 18:18           ` James Bottomley
2021-10-26 18:27             ` Martin K. Petersen
2021-10-26 20:10               ` Bart Van Assche
2021-10-26 22:22                 ` Daejun Park
2021-10-27  5:27                 ` Christoph Hellwig
2021-10-27 12:20                   ` James Bottomley
2021-10-28 20:21                     ` Bart Van Assche
2021-10-28 20:33                       ` James Bottomley
2021-10-28 20:53                         ` Bart Van Assche
2021-10-28 21:14                           ` Daejun Park
2021-10-27 13:16                   ` Bart Van Assche
2021-10-27 14:12                     ` Keith Busch
2021-10-27 14:38                       ` Jens Axboe
2021-10-27 14:43                         ` James Bottomley
2021-10-27 15:03                       ` Ming Lei
2021-10-27 15:06                         ` Jens Axboe
2021-10-27 15:16                           ` Ming Lei [this message]
2021-10-27 15:44                             ` Martin K. Petersen
2021-10-27 15:58                               ` Ming Lei
2021-10-27 16:16                                 ` Keith Busch
2021-10-27 16:19                                   ` Jens Axboe
2021-10-28  0:42                                   ` Ming Lei
2021-10-28  1:10                                     ` Daejun Park
2021-10-28  2:07                                       ` Ming Lei
2021-10-27 16:59                                 ` Martin K. Petersen
2021-10-27 15:35                           ` Martin K. Petersen
2021-10-27 15:40                             ` Jens Axboe
2021-10-27 16:16                               ` Martin K. Petersen
2021-10-27 17:01                                 ` Bart Van Assche
2021-10-28  1:32                                   ` Ming Lei
2021-10-29 10:53 ` Christoph Hellwig
2021-10-29 11:39   ` James Bottomley
2021-10-29 13:35     ` Avri Altman
2021-10-29 13:44       ` James Bottomley

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=YXltPgRTxe+Xn66i@T590 \
    --to=ming.lei@redhat.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=hch@lst.de \
    --cc=jaegeuk@kernel.org \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /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