From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
jens.axboe@oracle.com, james.bottomley@hansenpartnership.com,
willy@wil.cx, jgarzik@pobox.com, sandeen@redhat.com,
rwheeler@redhat.com, linux-ide@vger.kernel.org,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH 3/4] libata: Report zeroed read after Trim and max discard size
Date: Sat, 21 Nov 2009 15:16:05 -0500 [thread overview]
Message-ID: <yq11vjrskfu.fsf@sermon.lab.mkp.net> (raw)
In-Reply-To: <20091121104923.GB30153@infradead.org> (Christoph Hellwig's message of "Sat, 21 Nov 2009 05:49:23 -0500")
>>>>> "Christoph" == Christoph Hellwig <hch@infradead.org> writes:
Christoph> On Fri, Nov 20, 2009 at 09:45:23PM -0500, Martin K. Petersen wrote:
>> * with the unmap bit set.
>> */
>> - if (ata_id_has_trim(args->id))
>> + if (ata_id_has_trim(args->id)) {
>> + put_unaligned_be32(65535 * 512 / 8, &rbuf[20]);
>> put_unaligned_be32(1, &rbuf[28]);
Christoph> My reading of SPC is that the max unmap size only makes sense
Christoph> for devices supporting UNMAP, while the SATL for now only
Christoph> supports WRITE SAME with the unmap bit.
I was trying to help Eric figure out why his drive pooped on big Trim
requests. For WRITE SAME the limit is inherent in the arguments,
whereas our SATL implementation is limited by the 512-byte WRITE SAME
payload. So I needed a way to convey this up the stack.
Since you already return a B0 VPD page I thought it would be a
convenient place to communicate the max without having to tweak the
queue limits directly from within libata.
You are right that I'm relying on fuzziness in SBC which requires both
the max LBA count and the descriptor count to be specified for UNMAP.
So what I can do is this:
if (lba_count) {
q->limits.max_discard_sectors =
lba_count * sector_sz >> 9;
if (desc_count)
sdkp->unmap = 1;
}
That way we don't impose limits on "normal" WRITE SAME devices.
--
Martin K. Petersen Oracle Linux Engineering
next prev parent reply other threads:[~2009-11-21 20:16 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-21 2:45 Thin provisioning fixes Martin K. Petersen
2009-11-21 2:45 ` [PATCH 1/4] block: Allow devices to indicate whether discarded blocks are zeroed Martin K. Petersen
2009-11-21 10:13 ` Christoph Hellwig
2009-11-21 19:58 ` Matthew Wilcox
2009-11-22 2:43 ` Mark Lord
2009-11-23 16:37 ` Ric Wheeler
2009-11-23 16:54 ` Greg Freemyer
2009-11-23 17:02 ` Ric Wheeler
2009-11-23 17:03 ` Christoph Hellwig
2009-11-23 17:50 ` Eric Sandeen
2009-11-23 17:05 ` Christoph Hellwig
2009-11-21 12:50 ` Ric Wheeler
2009-11-21 20:17 ` Martin K. Petersen
2009-11-21 2:45 ` [PATCH 2/4] sd: WRITE SAME(16) / UNMAP support Martin K. Petersen
2009-11-21 2:45 ` [PATCH 3/4] libata: Report zeroed read after Trim and max discard size Martin K. Petersen
2009-11-21 10:49 ` Christoph Hellwig
2009-11-21 20:16 ` Martin K. Petersen [this message]
2009-11-24 14:35 ` Christoph Hellwig
2009-11-24 15:20 ` Mark Lord
2009-11-24 15:21 ` Christoph Hellwig
2009-11-21 2:45 ` [PATCH 4/4] libata: Fix garbled Trim payload Martin K. Petersen
2009-11-21 10:47 ` Christoph Hellwig
2009-11-21 19:50 ` Martin K. Petersen
2009-11-21 4:56 ` Thin provisioning fixes Eric Sandeen
2009-11-21 6:08 ` Martin K. Petersen
2009-11-21 6:55 ` Martin K. Petersen
2009-11-26 10:59 ` Christoph Hellwig
2009-11-26 11:01 ` Jens Axboe
2009-11-26 11:05 ` Christoph Hellwig
2009-11-26 15:13 ` Mark Lord
2009-11-26 15:14 ` Mark Lord
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=yq11vjrskfu.fsf@sermon.lab.mkp.net \
--to=martin.petersen@oracle.com \
--cc=hch@infradead.org \
--cc=james.bottomley@hansenpartnership.com \
--cc=jens.axboe@oracle.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=rwheeler@redhat.com \
--cc=sandeen@redhat.com \
--cc=willy@wil.cx \
/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;
as well as URLs for NNTP newsgroup(s).