public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche@wdc.com>
To: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	Damien Le Moal <Damien.LeMoal@wdc.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: "hch@lst.de" <hch@lst.de>
Subject: Re: [PATCH] sd_zbc: Write unlock zone from sd_uninit_cmnd()
Date: Wed, 9 Aug 2017 03:57:18 +0000	[thread overview]
Message-ID: <1502251037.2784.2.camel@wdc.com> (raw)
In-Reply-To: <cea78872-8e58-549d-87fc-2897e640c31c@wdc.com>

On Wed, 2017-08-09 at 11:47 +0900, Damien Le Moal wrote:
> On 8/9/17 11:19, Damien Le Moal wrote:
> > On 8/9/17 00:07, Bart Van Assche wrote:
> > > On Tue, 2017-08-08 at 13:17 +0900, Damien Le Moal wrote:
> > > > acquired the lock completes can cause deadlocks with scsi-mq due to
> > > > potential queue reordering if the lock owning request is requeued and
> > > > not executed.
> > > 
> > > Please note that even with scsi-sq requeueing can cause request reordering.
> > 
> > I am painfully aware of this fact... I will update the commit message to
> > reflect this.
> 
> Correction: checking the code again, I just realized that the prep_fn
> queue function, which calls sd_init_cmnd() and causes a zone to be
> write-locked if the prepared command is a write, is called within
> blk_peek_request(). That function is called in scsi_request_fn() with
> the queue lock held. So for the legacy scsi path, this means that for a
> write command to a zone, the operation "lock zone and dequeue command"
> is atomic. Thanks to the zone lock, further dequeue of write commands
> for the same (locked) zone cannot happen and so there is no reordering
> possible for write commands directed at the same zone. Reordering for
> other commands is possible, but similarly to regular disks, this is not
> a problem with ZBC/ZAC drives.

Hello Damien,

The locking approach in the upstream code indeed prevents reordering of
write requests that apply to the same zone. However, this patch modifies
the locking approach. Are you sure that with this patch applied no request
reordering will occur if requests are requeued since this patch causes the
zone lock to be released before requeuing occurs?

Bart.

  reply	other threads:[~2017-08-09  3:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-08  4:17 [PATCH] sd_zbc: Write unlock zone from sd_uninit_cmnd() Damien Le Moal
2017-08-08 15:07 ` Bart Van Assche
2017-08-09  2:19   ` Damien Le Moal
2017-08-09  2:47     ` Damien Le Moal
2017-08-09  3:57       ` Bart Van Assche [this message]
2017-08-09  4:07         ` Damien Le Moal
2017-08-09  4:15           ` Bart Van Assche
2017-08-09  5:15             ` Damien Le Moal
2017-08-09 15:24               ` Bart Van Assche
2017-08-10  2:14                 ` Damien Le Moal
2017-08-10  3:09                   ` Damien Le Moal
2017-08-10 15:35                   ` 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=1502251037.2784.2.camel@wdc.com \
    --to=bart.vanassche@wdc.com \
    --cc=Damien.LeMoal@wdc.com \
    --cc=hch@lst.de \
    --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