Re: discard synchronous on most SSDs?

2014-03-16 Thread Marc MERLIN
On Sat, Mar 15, 2014 at 11:26:27AM +, Duncan wrote:
 Chris Samuel posted on Sat, 15 Mar 2014 17:48:56 +1100 as excerpted:
 
  $ sudo smartctl --identify /dev/sdb | fgrep 'Trim bit in DATA SET
  MANAGEMENT'
   169  0  1   Trim bit in DATA SET MANAGEMENT command
   supported
  $
  
  If that command returns nothing then it's not reported as supported (and
  I've tested that).  You can get the same info with hdparm -I.
 
  My puzzle now is that I have two SSD drives that report supporting NCQ
  TRIM (one confirmed via product info) but report only supporting SATA
  3.0 not 3.1.
 
 My SATA 2.5 SSDs reported earlier, report support for it too, so it's 
 apparently not SATA 3.1 limited.  (Note that I'm simply grepping word 
 169, in the command below.  Since word 169 is trim support...)
 
 sudo smartctl --identify /dev/sda | grep '^ 169'
  169  - 0x0001   Data Set Management support
  169  0  1   Trim bit in DATA SET MANAGEMENT command supported
 
 Either that or that feature bit simply indicates trim support, not NCQ 
 trim support.

Mmmh, so now I'm confused.

See this:

=== START OF INFORMATION SECTION ===
Device Model: INTEL SSDSC2BW180A3L
Serial Number:CVCV215200XU180EGN
LU WWN Device Id: 5 001517 bb28c5317
Firmware Version: LE1i
User Capacity:180,045,766,656 bytes [180 GB]
Sector Size:  512 bytes logical/physical
Rotation Rate:Solid State Device
Device is:Not in smartctl database [for details use: -P showall]
ATA Version is:   ACS-2 (minor revision not indicated)
SATA Version is:  SATA 3.0, 3.0 Gb/s (current: 3.0 Gb/s)
Local Time is:Sat Mar 15 15:49:06 2014 PDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

polgara:/usr/src# smartctl --identify /dev/sda | grep '^ 169'
 169  - 0x0001   Data Set Management support
 169  0  1   Trim bit in DATA SET MANAGEMENT command supported

This is a super old SSD from 3 years ago. Clearly it can't support
synchronous dicard, right?

Yet, deleting a kernel tree also takes 1.5 seconds:
polgara:/usr/src# time rm -rf linux-3.14-rc5/
real0m1.441s
user0m0.048s
sys 0m1.352s


So maybe it's not the data level, but just the value of 169?

Either way, this SSD is more than 2 years old, maybe 3 actually.

Marc
-- 
A mouse is a device used to point at the xterm you want to type in - A.S.R.
Microsoft is to operating systems 
   what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/ | PGP 1024R/763BE901
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: discard synchronous on most SSDs?

2014-03-16 Thread Chris Murphy

On Mar 16, 2014, at 12:06 AM, Marc MERLIN m...@merlins.org wrote:
 
 Mmmh, so now I'm confused.
 
 See this:
 
 === START OF INFORMATION SECTION ===
 Device Model: INTEL SSDSC2BW180A3L
 Serial Number:CVCV215200XU180EGN
 LU WWN Device Id: 5 001517 bb28c5317
 Firmware Version: LE1i
 User Capacity:180,045,766,656 bytes [180 GB]
 Sector Size:  512 bytes logical/physical
 Rotation Rate:Solid State Device
 Device is:Not in smartctl database [for details use: -P showall]
 ATA Version is:   ACS-2 (minor revision not indicated)
 SATA Version is:  SATA 3.0, 3.0 Gb/s (current: 3.0 Gb/s)
 Local Time is:Sat Mar 15 15:49:06 2014 PDT
 SMART support is: Available - device has SMART capability.
 SMART support is: Enabled
 
 polgara:/usr/src# smartctl --identify /dev/sda | grep '^ 169'
 169  - 0x0001   Data Set Management support
 169  0  1   Trim bit in DATA SET MANAGEMENT command supported
 
 This is a super old SSD from 3 years ago. Clearly it can't support
 synchronous dicard, right?

No. The first signs I saw they were appearing in the wild was 3rd quarter 2013. 
I'm pretty sure SAS SSDs always have had a queued trim command. So in the 
workloads that demanded it and with a budget, this wouldn't have ever been a 
problem.


 Yet, deleting a kernel tree also takes 1.5 seconds:
 polgara:/usr/src# time rm -rf linux-3.14-rc5/
 real0m1.441s
 user0m0.048s
 sys 0m1.352s

I don't know that this is a good test for two reasons. Does rm always call trim 
before the rm command completes? If trim is batched or delayed it could happen 
well after. Second, and more of a factor, the queue needs to have pending 
commands in them that an async trim command will have to wait for. The problem 
with non-queued trim is that it requires the queue to be empty. So you'd need a 
test or workload that causes that behavior to be a problem.

And yet another factor with trim is that some SSDs immediately, aggressively 
start garbage collection and become slow to respond to anything. While others 
are smarter about doing this when the drive isn't as busy.


Chris Murphy

--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: discard synchronous on most SSDs?

2014-03-16 Thread Marc MERLIN
On Sun, Mar 16, 2014 at 12:22:05PM -0400, Martin K. Petersen wrote:
 queued trim, not even a prototype. I went out and bought a 840 EVO this
 morning because the general lazyweb opinion seemed to indicate that this
 drive supports queued trim. Well, it doesn't. At least not in the 120GB
 version:
 
 # smartctl -l gplog,0x13 /dev/sda
 smartctl 5.43 2012-06-30 r3573 [x86_64-linux-3.14.0-rc6+] (local build)
 Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net
 
 General Purpose Log 0x13 does not exist (override with '-T permissive' option)
 
 If there's a drive with a working queued trim implementation out there,
 I'd like to know about it...

I tried that for you on my 840 EVO 1TB and go the same as you:
legolas:/usr/src# smartctl -l gplog,0x13 /dev/sda
smartctl 6.2 2013-07-26 r3841 
[x86_64-linux-3.14.0-rc5-amd64-i915-preempt-20140216c] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

General Purpose Log 0x13 does not exist (override with '-T permissive' option)

Now, back to the fact that it takes 1.5sec to delete a kernel tree with
discard on, and it doesn't seem faster with discard off on either that
drive or my very old intel SSD, I'm starting to think that this is kind
of a non problem and/or that something else makes rm of a kernel tree
take around 1.5sec

Is is it much faster on an ssd for someone else?

Marc
-- 
A mouse is a device used to point at the xterm you want to type in - A.S.R.
Microsoft is to operating systems 
   what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/ | PGP 1024R/763BE901
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: discard synchronous on most SSDs?

2014-03-15 Thread Chris Samuel
On Sat, 15 Mar 2014 04:25:05 PM Chris Samuel wrote:

 I wonder if it would be possible to use that knowledge to extend the 
 smartctl's --identify functionality to report this?

After reading the SATA 3.1 spec I believe that smartctl *can* indicate if a 
drive claims to support SATA 3.1 NCQ TRIM, thus:

$ sudo smartctl --identify /dev/sdb | fgrep 'Trim bit in DATA SET MANAGEMENT'
 169  0  1   Trim bit in DATA SET MANAGEMENT command supported 
$

If that command returns nothing then it's not reported as supported (and I've 
tested that).  You can get the same info with hdparm -I.

Of course, as Martin said, that doesn't necessarily mean the kernel is using 
that reported ability.

My puzzle now is that I have two SSD drives that report supporting NCQ TRIM 
(one confirmed via product info) but report only supporting SATA 3.0 not 3.1.

cheers,
Chris
-- 
 Chris Samuel  :  http://www.csamuel.org/  :  Melbourne, VIC



signature.asc
Description: This is a digitally signed message part.


Re: discard synchronous on most SSDs?

2014-03-14 Thread Chris Samuel
On Thu, 13 Mar 2014 09:39:02 PM Chris Murphy wrote:

 smartctl -a or -x will tell you what SATA revision is in place. The queued
 trim support is in SATA Rev 3.1. I'm not certain if this requires only the
 drive to support that revision level, or both controller and drive.

Both I'd say as I believe it's the controller that has to issue it to the 
drive, and the drive needs to understand it.

cheers,
Chris
-- 
 Chris Samuel  :  http://www.csamuel.org/  :  Melbourne, VIC



signature.asc
Description: This is a digitally signed message part.


Re: discard synchronous on most SSDs?

2014-03-14 Thread Chris Samuel
Hi Marc,

On Thu, 13 Mar 2014 10:17:50 PM Marc MERLIN wrote:

 I'm not sure I'm seeing this, which field is that?

I *think* you want smartctl -i instead, and look for the field that says 
something like:

ATA Version is:   ATA8-ACS, ACS-2 T13/2015-D revision 3

So if my understanding is correct that says it's just rev. 3.0 so TRIM for 
this is synchronous.

Good luck!
Chris
-- 
 Chris Samuel  :  http://www.csamuel.org/  :  Melbourne, VIC



signature.asc
Description: This is a digitally signed message part.


Re: discard synchronous on most SSDs?

2014-03-14 Thread Duncan
Marc MERLIN posted on Thu, 13 Mar 2014 22:17:50 -0700 as excerpted:

 On Thu, Mar 13, 2014 at 09:39:02PM -0600, Chris Murphy wrote:
 
 On Mar 13, 2014, at 8:11 PM, Marc MERLIN m...@merlins.org wrote:
 
  On Sun, Mar 09, 2014 at 11:33:50AM +, Hugo Mills wrote:
  discard is, except on the very latest hardware, a synchronous
  command (it's a limitation of the SATA standard), and therefore
  results in very very poor performance.
  
  Interesting. How do I know if a given SSD will hang on discard?
  Is a Samsung EVO 840 1TB SSD latest hardware enough, or not? :)
 
 smartctl -a or -x will tell you what SATA revision is in place. The
 queued trim support is in SATA Rev 3.1. I'm not certain if this
 requires only the drive to support that revision level, or both
 controller and drive.
 
 I'm not sure I'm seeing this, which field is that?

 ATA Version is:   8
 ATA Standard is:  ATA-8-ACS revision 4c

Your drive didn't report it, but here, I have SATA fields as well, in 
addition to the ATA fields:

Here's the fields from my Corsair Neutron SSDs:

ATA Version is:   ATA8-ACS (minor revision not indicated)
SATA Version is:  SATA 2.5, 6.0 Gb/s

Here's the fields from my Seagate 500-gig 2.5-inch spinning rust:

ATA Version is:   ATA8-ACS T13/1699-D revision 4
SATA Version is:  SATA 2.6, 3.0 Gb/s

(More about that below.)

Smartctl version here is 6.2 2013-07-26 r3841, according to the output. 
(I'm running gentoo/~amd64 FWIW so it's a local-build). You snipped that 
bit of your output so I can't compare.

But it may also depend on whether smartctl auto-detected and used the ATA 
or the SCSI (or something else) command set and how your devices are 
actually connected, plus BIOS settings, etc.  See the manpage 
documentation for the -d TYPE (--device=TYPE) option and the ATA/SCSI/SAT 
discussion rather further down the manpage for more.

Here I have direct SATA connections with the BIOS set to AHCI mode and am 
thus using the kernel's AHCI drivers, since that's the most common SATA 
chipset standard these days, thus increasing portability given my 
monolithic kernel build.

smartctl's -d test reports an original guess of scsi, changed to sat 
after detection.

Of course connection via USB bridge or the like complicates things 
considerably.


Meanwhile, SATA 2.5, 6 Gb/s on the SSDs, SATA 2.6, 3 Gb/s on the spinning 
rust?  WTF?  The SSDs have SATA 2.5 but 6 Gb/s while the spinning rust 
has a later 2.6 but only 3 Gb/s (tho of course on a mechanical drive the 
bus speed won't be the bottleneck)?  Now I'm confused.

-- 
Duncan - List replies preferred.   No HTML msgs.
Every nonfree program has a lord, a master --
and if you use the program, he is your master.  Richard Stallman

--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: discard synchronous on most SSDs?

2014-03-14 Thread Marc MERLIN
On Fri, Mar 14, 2014 at 12:07:54PM +, Duncan wrote:
 Marc MERLIN posted on Thu, 13 Mar 2014 22:17:50 -0700 as excerpted:
 
  On Thu, Mar 13, 2014 at 09:39:02PM -0600, Chris Murphy wrote:
  
  On Mar 13, 2014, at 8:11 PM, Marc MERLIN m...@merlins.org wrote:
  
   On Sun, Mar 09, 2014 at 11:33:50AM +, Hugo Mills wrote:
   discard is, except on the very latest hardware, a synchronous
   command (it's a limitation of the SATA standard), and therefore
   results in very very poor performance.
   
   Interesting. How do I know if a given SSD will hang on discard?
   Is a Samsung EVO 840 1TB SSD latest hardware enough, or not? :)
  
  smartctl -a or -x will tell you what SATA revision is in place. The
  queued trim support is in SATA Rev 3.1. I'm not certain if this
  requires only the drive to support that revision level, or both
  controller and drive.
  
  I'm not sure I'm seeing this, which field is that?
 
  ATA Version is:   8
  ATA Standard is:  ATA-8-ACS revision 4c
 
 Your drive didn't report it, but here, I have SATA fields as well, in 
 addition to the ATA fields:
 
 Here's the fields from my Corsair Neutron SSDs:
 
 ATA Version is:   ATA8-ACS (minor revision not indicated)
 SATA Version is:  SATA 2.5, 6.0 Gb/s
 
 Here's the fields from my Seagate 500-gig 2.5-inch spinning rust:
 
 ATA Version is:   ATA8-ACS T13/1699-D revision 4
 SATA Version is:  SATA 2.6, 3.0 Gb/s

Ok, my smartmontools was too old. I got a newer one and now have proper
output:
Device Model: Samsung SSD 840 EVO 1TB
Serial Number:S1D9NEAD934600N
LU WWN Device Id: 5 002538 85009a8ff
Firmware Version: EXT0BB0Q
User Capacity:1,000,204,886,016 bytes [1.00 TB]
Sector Size:  512 bytes logical/physical
Rotation Rate:Solid State Device
Device is:Not in smartctl database [for details use: -P showall]
ATA Version is:   ACS-2, ATA8-ACS T13/1699-D revision 4c
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:Fri Mar 14 10:49:39 2014 PDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

So I have Sata 3.1, that's great news, it means I can keep using discard
without worrying about performance and hangs

Thanks,
Marc
-- 
A mouse is a device used to point at the xterm you want to type in - A.S.R.
Microsoft is to operating systems 
   what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/  
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: discard synchronous on most SSDs?

2014-03-14 Thread Martin K. Petersen
 Marc == Marc MERLIN m...@merlins.org writes:

Marc,

Marc So I have Sata 3.1, that's great news, it means I can keep using
Marc discard without worrying about performance and hangs

The fact that the drive reports compliance with a certain version of
SATA does not in any way imply that it implements all commands defined
in that specification.

The location where queued TRIM support is reported is somewhat unusual.
And last I looked hdparm -I had no infrastructure in place to report
stuff contained in log pages.

The kernel does look the right place to determine whether to issue the
queued or unqueued variant or not. But the information isn't exported to
userland.

So right now I'm afraid we don't have a good way for a user to determine
whether a device supports queued trims or not.

I guess we could consider either adding an ATA-specific I don't suck
flag in sysfs, add the missing code to hdparm, or both...

-- 
Martin K. Petersen  Oracle Linux Engineering
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: discard synchronous on most SSDs?

2014-03-14 Thread Holger Hoffstätte
On Fri, 14 Mar 2014 15:57:41 -0400, Martin K. Petersen wrote:

 So right now I'm afraid we don't have a good way for a user to determine
 whether a device supports queued trims or not.

Mount with discard, unpack kernel tree, sync, rm -rf tree.
If it takes several seconds, you have sync discard, no?

This changed somewhere around kernel 3.8.x; before that it used to be 
acceptably fast. Since then I only do batch trims, daily (server) or 
weekly (laptop).

-h

--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: discard synchronous on most SSDs?

2014-03-14 Thread Chris Murphy

On Mar 13, 2014, at 11:17 PM, Marc MERLIN m...@merlins.org wrote:

 On Thu, Mar 13, 2014 at 09:39:02PM -0600, Chris Murphy wrote:
 
 On Mar 13, 2014, at 8:11 PM, Marc MERLIN m...@merlins.org wrote:
 
 On Sun, Mar 09, 2014 at 11:33:50AM +, Hugo Mills wrote:
 discard is, except on the very latest hardware, a synchronous command
 (it's a limitation of the SATA standard), and therefore results in
 very very poor performance.
 
 Interesting. How do I know if a given SSD will hang on discard?
 Is a Samsung EVO 840 1TB SSD latest hardware enough, or not? :)
 
 smartctl -a or -x will tell you what SATA revision is in place. The queued 
 trim support is in SATA Rev 3.1. I'm not certain if this requires only the 
 drive to support that revision level, or both controller and drive.
 
 I'm not sure I'm seeing this, which field is that?
 
 === START OF INFORMATION SECTION ===
 Device Model: Samsung SSD 840 EVO 1TB
 Serial Number:S1D9NEAD934600N
 LU WWN Device Id: 5 002538 85009a8ff
 Firmware Version: EXT0BB0Q
 User Capacity:1,000,204,886,016 bytes [1.00 TB]
 Sector Size:  512 bytes logical/physical
 Device is:Not in smartctl database [for details use: -P showall]
 ATA Version is:   8
 ATA Standard is:  ATA-8-ACS revision 4c
 Local Time is:Thu Mar 13 22:15:14 2014 PDT
 SMART support is: Available - device has SMART capability.
 SMART support is: Enabled


After ATA Version for me.

$ smartctl -a /dev/disk0
smartctl 6.1 2013-03-16 r3800 [x86_64-apple-darwin12.3.0] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family: Samsung based SSDs
Device Model: SAMSUNG SSD 830 Series
Serial Number:S0Z4NEAC933856
LU WWN Device Id: 5 002538 043584d30
Firmware Version: CXM03B1Q
User Capacity:256,060,514,304 bytes [256 GB]
Sector Size:  512 bytes logical/physical
Rotation Rate:Solid State Device
Device is:In smartctl database [for details use: -P show]
ATA Version is:   ACS-2 T13/2015-D revision 2
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:Fri Mar 14 15:37:07 2014 MDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

The Samsung hardware by and large is fairly well behaved with discard in my 
experience. But it does really depend a lot on the workload. I'd notice 
occasional random freezes for a couple of seconds when I had it enabled in OS X 
(totally different animal from the kernel up), nothing severe. But it was 
annoying enough I disabled it, and the problem went away. Apple doesn't enable 
trim by default on non-Apple SSD's still, so the idea that everyone else is 
doing this isn't true. The Windows implementation is rather complex, and also 
isn't always used contrary to what's been reported (on the everybody panic or 
get mad NOW type web sites).

If you want to be conservative about it, I'd say just manually run fstrim when 
the system is idle. Do that once a week or two. Chron job it if you want.


Chris Murphy--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: discard synchronous on most SSDs?

2014-03-14 Thread Chris Samuel
On Fri, 14 Mar 2014 06:33:24 PM Chris Samuel wrote:

 I *think* you want smartctl -i instead, and look for the field that says 
 something like:
 
 ATA Version is:   ATA8-ACS, ACS-2 T13/2015-D revision 3

Late night, cut and pasted the wrong line of output, mine says:

SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)

Of course that's what the drive is reporting it supports, I'm not sure whether 
that's the result of what has been negotiated between the controller and drive 
or purely what the drive supports.

To get more information from smartctl you can use the --identify=wb option 
instead of -i and that should give you a lot more detail about what then 
drives claims to (and not to) support.   On the version in Kubuntu 13.10 
(6.1+svn3812-1) it only reports 3 things regarding TRIM for my drives.

chris@quad:/tmp$ sudo smartctl --identify=wb -d sat /dev/sdb | egrep -i 'trim|
discard'
  69 14  1   Deterministic data after trim supported
  69  5  0   Trimmed LBA range(s) returning zeroed data supported
 169  0  1   Trim bit in DATA SET MANAGEMENT command supported

I'm currently doing a git clone of their SVN repo to see if there's any new 
functionality that will gather any more information.

cheers,
Chris
-- 
 Chris Samuel  :  http://www.csamuel.org/  :  Melbourne, VIC



signature.asc
Description: This is a digitally signed message part.


Re: discard synchronous on most SSDs?

2014-03-14 Thread Marc MERLIN
On Fri, Mar 14, 2014 at 08:46:09PM +, Holger Hoffstätte wrote:
 On Fri, 14 Mar 2014 15:57:41 -0400, Martin K. Petersen wrote:
 
  So right now I'm afraid we don't have a good way for a user to determine
  whether a device supports queued trims or not.
 
 Mount with discard, unpack kernel tree, sync, rm -rf tree.
 If it takes several seconds, you have sync discard, no?

Mmmh, interesting point.

legolas:/usr/src# time rm -rf linux-3.14-rc5
real0m1.584s
user0m0.008s
sys 0m1.524s

I remounted my FS with remount,nodiscard, and the time was the same.

 This changed somewhere around kernel 3.8.x; before that it used to be 
 acceptably fast. Since then I only do batch trims, daily (server) or 
 weekly (laptop).

I'm never really timed this before. Is it supposed to be faster than 1.5s on
a fast SSD?

Marc
-- 
A mouse is a device used to point at the xterm you want to type in - A.S.R.
Microsoft is to operating systems 
   what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/  
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: discard synchronous on most SSDs?

2014-03-13 Thread Chris Murphy

On Mar 13, 2014, at 8:11 PM, Marc MERLIN m...@merlins.org wrote:

 On Sun, Mar 09, 2014 at 11:33:50AM +, Hugo Mills wrote:
 discard is, except on the very latest hardware, a synchronous command
 (it's a limitation of the SATA standard), and therefore results in
 very very poor performance.
 
 Interesting. How do I know if a given SSD will hang on discard?
 Is a Samsung EVO 840 1TB SSD latest hardware enough, or not? :)

smartctl -a or -x will tell you what SATA revision is in place. The queued trim 
support is in SATA Rev 3.1. I'm not certain if this requires only the drive to 
support that revision level, or both controller and drive.

Chris Murphy--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: discard synchronous on most SSDs?

2014-03-13 Thread Marc MERLIN
On Thu, Mar 13, 2014 at 09:39:02PM -0600, Chris Murphy wrote:
 
 On Mar 13, 2014, at 8:11 PM, Marc MERLIN m...@merlins.org wrote:
 
  On Sun, Mar 09, 2014 at 11:33:50AM +, Hugo Mills wrote:
  discard is, except on the very latest hardware, a synchronous command
  (it's a limitation of the SATA standard), and therefore results in
  very very poor performance.
  
  Interesting. How do I know if a given SSD will hang on discard?
  Is a Samsung EVO 840 1TB SSD latest hardware enough, or not? :)
 
 smartctl -a or -x will tell you what SATA revision is in place. The queued 
 trim support is in SATA Rev 3.1. I'm not certain if this requires only the 
 drive to support that revision level, or both controller and drive.

I'm not sure I'm seeing this, which field is that?

=== START OF INFORMATION SECTION ===
Device Model: Samsung SSD 840 EVO 1TB
Serial Number:S1D9NEAD934600N
LU WWN Device Id: 5 002538 85009a8ff
Firmware Version: EXT0BB0Q
User Capacity:1,000,204,886,016 bytes [1.00 TB]
Sector Size:  512 bytes logical/physical
Device is:Not in smartctl database [for details use: -P showall]
ATA Version is:   8
ATA Standard is:  ATA-8-ACS revision 4c
Local Time is:Thu Mar 13 22:15:14 2014 PDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status:  (   0) The previous self-test routine completed
without error or no self-test has ever 
been run.
Total time to complete Offline 
data collection:(15000) seconds.
Offline data collection
capabilities:(0x53) SMART execute Offline immediate.
Auto Offline data collection on/off 
support.
Suspend Offline collection upon new
command.
No Offline surface scan supported.
Self-test supported.
No Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities:(0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability:(0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine 
recommended polling time:(   2) minutes.
Extended self-test routine
recommended polling time:( 250) minutes.
SCT capabilities:  (0x003d) SCT Status supported.
SCT Error Recovery Control supported.
SCT Feature Control supported.
SCT Data Table supported.

SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME  FLAGSVALUE WORST THRESH FAIL RAW_VALUE
  5 Reallocated_Sector_Ct   PO--CK   100   100   010-0
  9 Power_On_Hours  -O--CK   099   099   000-2219
 12 Power_Cycle_Count   -O--CK   099   099   000-659
177 Wear_Leveling_Count PO--C-   099   099   000-3
179 Used_Rsvd_Blk_Cnt_Tot   PO--C-   100   100   010-0
181 Program_Fail_Cnt_Total  -O--CK   100   100   010-0
182 Erase_Fail_Count_Total  -O--CK   100   100   010-0
183 Runtime_Bad_Block   PO--C-   100   100   010-0
187 Reported_Uncorrect  -O--CK   100   100   000-0
190 Airflow_Temperature_Cel -O--CK   054   041   000-46
195 Hardware_ECC_Recovered  -O-RC-   200   200   000-0
199 UDMA_CRC_Error_Count-OSRCK   100   100   000-0
235 Unknown_Attribute   -O--C-   099   099   000-35
241 Total_LBAs_Written  -O--CK   099   099   000-12186944165
||_ K auto-keep
|__ C event count
___ R error rate
||| S speed/performance
||_ O updated online
|__ P prefailure warning


-- 
A mouse is a device used to point at the xterm you want to type in - A.S.R.
Microsoft is to operating systems 
   what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/  
--
To unsubscribe from this list: send the line unsubscribe