All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: David Buckley <dbuckley@oreilly.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org
Subject: Re: problem with discard granularity in sd
Date: Thu, 13 Apr 2017 22:44:56 -0400	[thread overview]
Message-ID: <yq1efwvwvvb.fsf@oracle.com> (raw)
In-Reply-To: <CA+Xd3XFoRY+SgowfzP69X1ZCSAPGTmec=qMxStoX=trths8kDg@mail.gmail.com> (David Buckley's message of "Wed, 12 Apr 2017 16:58:22 -0700")

David Buckley <dbuckley@oreilly.com> writes:

David,

> The underlying issue seems to be that (per VPD page) the maximum
> supported unmap request is 8192 * 512 = 4194304 bytes, while the
> maximum write same request is 0x4000 * 512 = 8388608 bytes.  It
> appears both of these values are correct, and in the case where a WS
> UNMAP request larger than 8192 blocks is received the UNMAP is ignored
> and the result is effectively a WS ZERO request.

That's broken on the filer, then.

> If I'm correct in my understanding, then it seems like the root cause
> of the failures is that the current code assumes a disk will always
> support WS UNMAP requests up to max_ws_blocks and does not account for
> a case where max_unmap_blocks is smaller than max_ws_blocks.

SBC says:

    "A MAXIMUM UNMAP LBA COUNT field set to a non-zero value indicates
    the maximum number of LBAs that may be unmapped by an UNMAP
    command."

    "A MAXIMUM WRITE SAME LENGTH field set to a non-zero value indicates
    the maximum number of contiguous logical blocks that the device
    server allows to be unmapped or written in a single WRITE SAME
    command."

I'm confident that our behavior is correct and that the problem is on
the storage side.

The good news is that the new discard code would alleviate your problem
in that (based on what the filer reported in your setup) we'd use UNMAP
to deallocate and WRITE SAME to zero.

-- 
Martin K. Petersen	Oracle Linux Engineering

  reply	other threads:[~2017-04-14  2:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-11 18:07 problem with discard granularity in sd David Buckley
2017-04-12  1:55 ` Martin K. Petersen
2017-04-12 23:58   ` David Buckley
2017-04-14  2:44     ` Martin K. Petersen [this message]
2017-04-14 20:07       ` David Buckley
  -- strict thread matches above, loose matches on Subject: below --
2017-03-31 16:52 David Buckley
2017-04-05  0:12 ` Martin K. Petersen
2017-04-05 16:14   ` David Buckley
2017-04-06 17:34     ` Martin K. Petersen

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=yq1efwvwvvb.fsf@oracle.com \
    --to=martin.petersen@oracle.com \
    --cc=dbuckley@oreilly.com \
    --cc=linux-scsi@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.