public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Tom Yan <tom.ty89@gmail.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org
Subject: Re: configurable discard parameters
Date: Mon, 22 Jun 2015 16:57:27 -0400	[thread overview]
Message-ID: <yq1616f796w.fsf@sermon.lab.mkp.net> (raw)
In-Reply-To: <CAGnHSEnLACL6XisaFn3axRETAD3CjOa7fGrHKR7s6GOroQXkew@mail.gmail.com> (Tom Yan's message of "Mon, 22 Jun 2015 04:30:00 +0800")

>>>>> "Tom" == Tom Yan <tom.ty89@gmail.com> writes:

Tom> However, I am curious what is the meaning of "Our current TRIM
Tom> payload is a single sector that can accommodate 64 * 65535 blocks
Tom> being unmapped. Report this value in the Block Limits Maximum Unmap
Tom> LBA count field." in the commit message. What does the value
Tom> actually mean/affect? Could it cause trouble to certain drives?

DSM Trim takes a payload of <block nr, block count> ranges. The block
count is constrained to 65535 by virtue of being 16 bits. We can fit 64
8-byte range descriptors in a single 512-byte sector payload. That's why
we set the limit for a single, contiguous discard request to
0x3fffc0. That results in 2GB minus change for a single command.

Tom> By the way I think I got the answer for my USB TRIM question.
Tom> Basically for USB->SATA drives the SATL is implemented in the
Tom> bridges, so it must be able to "SAT" one of the three SCSI unmap
Tom> methods to ATA TRIM, just like libata does,

Yep. I have set to see one that gets that right, though. There are even
many enterprise SAS/RAID controllers that don't support UNMAP-TRIM
translation.

Linux' libata was one of the first implementations of SCSI-ATA
translation for TRIM. Initially we bent the rules for UNMAP a bit. When
the standards caught up we switched to WRITE SAME.

Tom> So it actually tells. And I hope that the kernel wouldn't "falsify"
Tom> anything for devices which do provide some VPD(s). : \

SATA doesn't have VPDs.

-- 
Martin K. Petersen	Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in

  reply	other threads:[~2015-06-22 20:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-20 17:12 configurable discard parameters Tom Yan
2015-06-21  0:20 ` Martin K. Petersen
2015-06-21  7:03   ` Tom Yan
2015-06-21  8:05     ` Tom Yan
2015-06-21 12:36       ` Tom Yan
2015-06-21 20:30         ` Tom Yan
2015-06-22 20:57           ` Martin K. Petersen [this message]
2015-06-23 14:16             ` Tom Yan
2015-06-23 15:36               ` Martin K. Petersen
2015-06-23 16:41                 ` Tom Yan
2015-06-23 17:03                   ` Martin K. Petersen
2015-06-23 17:24                     ` Tom Yan
2015-06-23 18:26                       ` Martin K. Petersen
2015-06-23 21:25                         ` Tom Yan
2015-06-24  2:55                           ` Martin K. Petersen
2015-06-24 12:46                             ` Tom Yan
2015-06-25  1:15                               ` Martin K. Petersen
2015-06-26  7:05                                 ` Tom Yan

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=yq1616f796w.fsf@sermon.lab.mkp.net \
    --to=martin.petersen@oracle.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=tom.ty89@gmail.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