All of lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <damien.lemoal@hgst.com>
To: Jens Axboe <axboe@fb.com>, <linux-block@vger.kernel.org>,
	<hch@lst.de>, <hare@suse.de>
Subject: Re: [PATCH] block: Fix front merge check
Date: Thu, 14 Jul 2016 10:23:42 +0900	[thread overview]
Message-ID: <8a365634-e2e7-45d9-a86d-10894212a4d2@hgst.com> (raw)
In-Reply-To: <57866A2B.5000403@fb.com>


Jens,

On 7/14/16 01:19, Jens Axboe wrote:
> On 07/12/2016 10:23 PM, Damien Le Moal wrote:
>> For a front merge, the maximum number of sectors of the
>> request must be checked against the front merge BIO sector,
>> not the current sector of the request.
>
> Why does this matter? The merging should only happen before we start the
> request, hence rq pos and first bio should be one and the same.

The block device of SMR drives is set up as chunked with the chunk size 
equal to the drive zone size. Since write requests directed to 
sequential zones cannot cross zone boundaries, both the front merge code 
and the back merge code must ensure that requests resulting from a merge 
do not cross chunk boundaries.

The back merge code does this well, but the front merge code fails to 
prevent merging when the BIO is the last write in a zone and the request 
is the first write in the following (empty) zone. The check against the 
request LBA does not prevent the merge as the request+bio size fit in 
the empty zone. The check must be against the BIO LBA to detect the 
chunk boundary crossing.

Best regards.

-- 
Damien Le Moal, Ph.D.
Sr. Manager, System Software Group, HGST Research,
HGST, a Western Digital brand
Damien.LeMoal@hgst.com
(+81) 0466-98-3593 (ext. 513593)
1 kirihara-cho, Fujisawa,
Kanagawa, 252-0888 Japan
www.hgst.com
Western Digital Corporation (and its subsidiaries) E-mail Confidentiality Notice & Disclaimer:

This e-mail and any files transmitted with it may contain confidential or legally privileged information of WDC and/or its affiliates, and are intended solely for the use of the individual or entity to which they are addressed. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited. If you have received this e-mail in error, please notify the sender immediately and delete the e-mail in its entirety from your system.


  reply	other threads:[~2016-07-14  1:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-13  5:23 [PATCH] block: Fix front merge check Damien Le Moal
2016-07-13  5:42 ` Hannes Reinecke
2016-07-13 16:19 ` Jens Axboe
2016-07-14  1:23   ` Damien Le Moal [this message]
2016-07-21  3:38     ` Jens Axboe

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=8a365634-e2e7-45d9-a86d-10894212a4d2@hgst.com \
    --to=damien.lemoal@hgst.com \
    --cc=axboe@fb.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --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.