[opensuse-factory] SSD discard support? hdparm's wiper.sh?
All, Let me know where the below should be posted if not the factory list. It relates to how 11.3 will handle SSD discards. === There is currently a fairly large thread on the Ext4 mailing list that I've been participating in. The basic conclusion is that for SSD based drives that can benefit from discards, there are two existing approaches. One is in the current kernels and it involves invoking discard any time data blocks are freed up. Thus it can mean large number of discards per second. This code was written and accepted into the kernel prior to any hardware to really test it with. Apparently now that vendors are shipping SSDs that support discard, that methodology is proving to be a loser and SSD performance is lower if it is enabled, instead of higher which is the entire goal of the discards. I haven't seen benchmarks yet for this with high-end SCSI array backends. If they too are bad, the existing logic is very likely to be tossed from the kernel. Not sure what will replace it in the kernel, if anything. Alternatively, hdparm was enhanced a year or so ago to have several discard related functionalities. That functionality is already in 11.2 and factory, so there's no issue there. But hdparm is only providing base functionality and it needs a script to actually invoke it correctly and cause the appropriate sectors to be discarded. Fortunately Mark Lord (the hdparm maintainer) is now also including "wiper.sh" with hdparm that will scan a filesystem (ext4 and xfs for sure and possibly others) and invoke discard in a very efficient way. I don't think 11.2 or factory are including that script, but I'd like to see it go in as the opensuse 11.3 methodology for calling discard on a SSD. That will mean including the script, testing it as part of opensuse, and getting it in the nightly cron scripts or something. How does a decision like that get made, etc. Thanks Greg -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org
On Thursday 22 April 2010 17:50:06 Greg Freemyer wrote:
All,
Let me know where the below should be posted if not the factory list. It relates to how 11.3 will handle SSD discards.
===
There is currently a fairly large thread on the Ext4 mailing list that I've been participating in.
The basic conclusion is that for SSD based drives that can benefit from discards, there are two existing approaches.
One is in the current kernels and it involves invoking discard any time data blocks are freed up. Thus it can mean large number of discards per second. This code was written and accepted into the kernel prior to any hardware to really test it with.
Apparently now that vendors are shipping SSDs that support discard, that methodology is proving to be a loser and SSD performance is lower if it is enabled, instead of higher which is the entire goal of the discards. I haven't seen benchmarks yet for this with high-end SCSI array backends. If they too are bad, the existing logic is very likely to be tossed from the kernel. Not sure what will replace it in the kernel, if anything.
Alternatively, hdparm was enhanced a year or so ago to have several discard related functionalities. That functionality is already in 11.2 and factory, so there's no issue there.
But hdparm is only providing base functionality and it needs a script to actually invoke it correctly and cause the appropriate sectors to be discarded. Fortunately Mark Lord (the hdparm maintainer) is now also including "wiper.sh" with hdparm that will scan a filesystem (ext4 and xfs for sure and possibly others) and invoke discard in a very efficient way.
I don't think 11.2 or factory are including that script, but I'd like wiper.sh is included already in 11.2 : rpm -ql hdparm | grep wiper /sbin/wiper.sh /usr/share/doc/packages/hdparm/README.wiper
to see it go in as the opensuse 11.3 methodology for calling discard on a SSD.
That will mean including the script, testing it as part of opensuse, and getting it in the nightly cron scripts or something. in README.wiper I see a lot of thinks like: ".... This script may be EXTREMELY HAZARDOUS TO YOUR DATA. ... btrfs -- DO NOT USE !!! ...."
so creating some default crontab rule with wiper.sh for openSUSE doesn't look safe for me ...
How does a decision like that get made, etc.
I think openFATE is good place
Thanks Greg
-- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 04/22/2010 01:50 PM, Greg Freemyer wrote:
But hdparm is only providing base functionality and it needs a script to actually invoke it correctly and cause the appropriate sectors to be discarded. Fortunately Mark Lord (the hdparm maintainer) is now also including "wiper.sh" with hdparm that will scan a filesystem (ext4 and xfs for sure and possibly others) and invoke discard in a very efficient way.
I don't think 11.2 or factory are including that script, but I'd like to see it go in as the opensuse 11.3 methodology for calling discard on a SSD.
That will mean including the script, testing it as part of opensuse, and getting it in the nightly cron scripts or something.
AFAIK these scripts and tools aren't safe to run on a mounted file system. Blocks could be allocated underneath the tool and would end up discarding parts of the file system that are in use. - -Jeff - -- Jeff Mahoney SUSE Labs -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAkvRp/0ACgkQLPWxlyuTD7LanQCfejsIcoqet8nUIfR8PEfzsbaH R88AoJ4K7/fjJDg/U66C2EBamppszBGi =DX+L -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org
On Fri, Apr 23, 2010 at 10:00 AM, Jeff Mahoney <jeffm@suse.com> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 04/22/2010 01:50 PM, Greg Freemyer wrote:
But hdparm is only providing base functionality and it needs a script to actually invoke it correctly and cause the appropriate sectors to be discarded. Fortunately Mark Lord (the hdparm maintainer) is now also including "wiper.sh" with hdparm that will scan a filesystem (ext4 and xfs for sure and possibly others) and invoke discard in a very efficient way.
I don't think 11.2 or factory are including that script, but I'd like to see it go in as the opensuse 11.3 methodology for calling discard on a SSD.
That will mean including the script, testing it as part of opensuse, and getting it in the nightly cron scripts or something.
AFAIK these scripts and tools aren't safe to run on a mounted file system. Blocks could be allocated underneath the tool and would end up discarding parts of the file system that are in use.
Jeff, The script/hdparm pair use fallocate to accumulate a large chunk of unused blocks thus ensuring they are not used elsewhere. (note hdparm now has a --fallocate arg, as well as the new --trim-sector-ranges-stdin arg. Both are in OS 11.2) The pair then aggregate the discardable block ranges in to groups of a few thousand and invoke ATA-8 trim commands to the SSD bypassing most of the block layer (as hdparm likes to do). At the sata bus level, the trim command can carry thousands of sector ranges with it. ie. The spec calls for up to 255 sectors worth of payload, where the payload is a vectorized list of discard ranges. hdparm as it exists in 11.2 already has the ability to accept a huge list of discard ranges and parse it down into those 255 sector payloads and send it down to the drive. It's extremely efficient. Much more so than whats currently in the kernel. The only negative I see is that it is designed to be invoked routinely, not instantaneously like the kernel currently does it. But as stated, it is not safe with btrfs per the script notes, and I don't know how much hardware its been tested with. Greg -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org
On Friday 23 April 2010 16:15:07 Greg Freemyer wrote:
The only negative I see is that it is designed to be invoked routinely, not instantaneously like the kernel currently does it.
Given that write performance degradation occurs over time, I can't see this being a problem if it's a more efficient method of reclaiming pages. -- “What can be asserted without proof can be dismissed without proof.” - Christopher Hitchens -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org
On Fri, Apr 23, 2010 at 8:53 PM, Graham Anderson <graham.anderson@gmail.com> wrote:
On Friday 23 April 2010 16:15:07 Greg Freemyer wrote:
The only negative I see is that it is designed to be invoked routinely, not instantaneously like the kernel currently does it.
Given that write performance degradation occurs over time, I can't see this being a problem if it's a more efficient method of reclaiming pages.
Given we're already in feature freeze and that per Mark Lord (the hdparm maintainer) wiper.sh has not been tested with Intel SSDs, I decided to create a wiki entry instead of an openfate entry. But I don't know how to actually create a wiki page, so I did it on my home page: http://en.opensuse.org/User:Gregfreemyer Can someone please volunteer to move that to a new wiki page. Thanks Greg -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org
participants (4)
-
Graham Anderson
-
Greg Freemyer
-
Jeff Mahoney
-
Michal Seben