Slashdot Mirror


Ubuntu Wants To Enable SSD TRIM By Default

jones_supa writes "During the first day of the latest virtual Ubuntu Developer Summit, Canonical developers finally plotted out the enabling of TRIM/DISCARD support by default for solid-state drives on Ubuntu 14.04. Ubuntu developers aren't looking to enable discard at the file-system level since it can slow down delete operations, so instead they're wanting to have their own cron job that routinely runs fstrim for TRIMing the system. In the past there has been talk about the TRIM implementation being unoptimized in the kernel. Around when Linux 3.0 was released, OpenSUSE noted that the kernel performs TRIM to a single range, instead of vectorized list of TRIM ranges, which is what the specification calls for. In some scenarios this results in lowered performance."

135 comments

  1. jargon keeps me alive by turkeydance · · Score: 1

    acronyms, too.

    1. Re:jargon keeps me alive by Anonymous Coward · · Score: 1

      acronyms, too.

      Yes. Thank gods for the 'right click Google ... ' feature!

    2. Re:jargon keeps me alive by Anonymous Coward · · Score: 0

      You must feel positively immortal after reading /. today.

    3. Re:jargon keeps me alive by Anonymous Coward · · Score: 0

      acronyms, too.

      I dumped Ubun(dle)tu. An operating system for those who want shop, surf and browse the web for things to purchase--blows.

  2. I say.......... by Dega704 · · Score: 2

    Well it's about time.

    1. Re:I say.......... by ArcadeMan · · Score: 2

      No, it's about TRIM.

    2. Re:I say.......... by Anonymous Coward · · Score: 0

      Well it's about time.

      I'm always ready for a little trim. --

    3. Re:I say.......... by TheGratefulNet · · Score: 2

      embarassing that it took THIS long. seriously embarassing.

      only about 4 years late. sigh.

      --

      --
      "It is now safe to switch off your computer."
  3. if they used systemd... by Anonymous Coward · · Score: 0

    it would be a both a config option and build time requirement.

  4. A step in the right direction by Cantankerous+Cur · · Score: 3, Interesting

    I'm still waiting for for firefox or chrome to make themselves SSD friendly. I know we all have RAMdisk, but I swear, after the OS, web browsers seem to generate the next highest number of 'writes'.

    1. Re:A step in the right direction by Anonymous Coward · · Score: 1

      Who gives a fuck?
      I run "unfriendly" FF, Chromium and Opera on a Samsung 830 here.
      No discard, no tuning, it also contains a swap partition.
      3.2TB written and 98% remaining life after 15 months.

    2. Re:A step in the right direction by Anonymous Coward · · Score: 0

      Disable the disk cache?

    3. Re:A step in the right direction by Anonymous Coward · · Score: 0

      Do it yourself manually. about:config Disable disk cache in firefox. Jack up the mem cache.

      firefox writes nearly nothing.

    4. Re:A step in the right direction by JanneM · · Score: 1

      I put tmp and the Firefox cache on RAM. It really makes an enormous amount of difference in overall system responsiveness. More RAM and an SSD really are a lot more important than CPU speed for general-use machines.

      --
      Trust the Computer. The Computer is your friend.
    5. Re:A step in the right direction by hairyfeet · · Score: 1

      Preach brother! I have tried just about every browser out there and frankly they ALL suck when it comes to writes, it doesn't matter how much RAM you have either it'll just keep pounding the drive. I mean when I have 8GB of RAM on my netbook there really isn't any excuse for touching the drive until browser close yet the one program that will keep my drive pounded is the browser. Even my audio editing in audacity doesn't seem to hit the drive as much as looking at simple web pages, and that is with ABP and flashblock!

      --
      ACs don't waste your time replying, your posts are never seen by me.
    6. Re:A step in the right direction by Cantankerous+Cur · · Score: 1

      I can only assume you're using the SSD life tool or some equivalent software. http://ssd-life.com/

      In the 13 months I've used mine, I've written 3.8 TB. It estimates the total lifetime for my SSD at little under 9 years. But, honestly, why reduce this number if you don't have to?

      To make a parallel here, properly inflated tires for your car save 1-2% gas mileage. Literally pennies in gasoline per tank. But again, why waste?

    7. Re:A step in the right direction by Anonymous Coward · · Score: 0

      Using smartctl -A
      Samsung 830s report % life remaining for SMART attribute 177 = Wear_Leveling_Count, and the raw value for the same attribute is the highest # of erases any block has seen.
      Btw, this is a 128GB 830.
      To make a parallel here, in 9 years that drive will likely be about as useful as a 40GB 3.5" IDE HD is now.

    8. Re:A step in the right direction by Anonymous Coward · · Score: 0

      You could try denying firefox the ability to force the operating system to write out it's file cache. Described here.

  5. What the fuck? by Anonymous Coward · · Score: 0

    The question here is - why the hell is TRIM not enabled in Ubuntu already? The idea of a cron-job fstrim has been around as long as TRIM-for-Linux itself. Canonical should have done this years ago, I can't believe they are only just starting to discuss this now, when SSDs are commonplace. TRIM is essential for maintaining SSD performance.

    1. Re:What the fuck? by dshk · · Score: 5, Informative

      TRIM is essential for maintaining SSD performance.

      This is not so simple.

      The original TRIM command is non-queued. It can kill drive performance on servers, so enterprise drives are designed to work well without TRIM. If you want better, and more importantly consistent performance then you should overprovision the drive. Overprovisioning means that you do not partition 20-40% of a new drive (or a used drive, after a secure erase). Those blocks will never be used, therefore the drive always have plenty of free space, so there is no need for trim.

      Queued TRIM command appeared only in the SATA 3.1 specification, so only new drives support it.

    2. Re:What the fuck? by Anonymous Coward · · Score: 0

      Relevant and correct info on /., what has the world come to?

    3. Re:What the fuck? by magamiako1 · · Score: 1

      This isn't quite as accurate. Most SSDs these days are built with space already overprovisioned. For example, a 128GB SSD might actually have 160GB of NAND flash inside of the device, with the remaining flash unreachable by the operating system and is used by the device.

      Essentially, the age old adage of "over provisioning" is not actually that necessary on modern systems.

    4. Re:What the fuck? by subreality · · Score: 4, Informative

      Those blocks will never be used, therefore the drive always have plenty of free space, so there is no need for trim.

      It's not quite that simple either.

      SSDs write in pages, but erase in blocks of pages. When a page is changed it gets rewritten to another block. The original page is marked as free, but it can't be erased until the whole block is free. Therefore the SSD performs garbage collection of free pages, re-packing them into complete blocks.

      On its own the SSD only knows which pages it freed during rewrites - it doesn't know about pages that COULD be freed because they're deleted. Overprovisioning prevents blocking when there are no free pages (that's a huge win), but the drive still wastes lots of time and wear-life moving deleted data around during GC. TRIM provides the necessary hint to prevent that waste.

    5. Re:What the fuck? by Anonymous Coward · · Score: 0

      This is simply not true.

      SSDs for quite a while have had a hidden overprovision. Today's 120GB and 128GB SSDs have 128GiB of flash, resulting in 13% or 7% spare areas, respectively.

      To overprovision further, one might only create a 100GB partition, resulting in 27% unused space.

      For some workloads, there are serious benefits to having more unused space. How "modern" the system is has nothing to do with it - if anything, flash has become less reliable the more "modern" it gets.

    6. Re:What the fuck? by TheRaven64 · · Score: 1

      It's also worth noting that there are two modes for TRIM. One enforces the invariant that two reads of the same block will give the same value if there are no writes between them, the other only requires this invariant for blocks that have not been marked as erased. There's often a performance difference between them, because the latter lets the drive just leave the block as spare and overwrite it during a GC and then reallocate it on write (a good implementation would mark it as zero'd and always return zeros until there is a write, but this requires slightly more space in the remapping tables and so isn't always done). It sounds like Linux is still using the former version, which can be very slow on some drives.

      --
      I am TheRaven on Soylent News
    7. Re:What the fuck? by bill_mcgonigle · · Score: 1

      Those blocks will never be used, therefore the drive always have plenty of free space, so there is no need for trim.

      Clue me in: how in the world does the drive firmware know which blocks the filesystem data structures have pointers to as valid, currently unused ranges?

      --
      My God, it's Full of Source!
      OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    8. Re:What the fuck? by dshk · · Score: 1

      The firmware is not interested in filesystem pointers. It does know, however, if a block has never been written.

  6. Can someone dumb-down the comment... by Daniel+Hoffmann · · Score: 1

    to Computer Science graduate? You know, down from kernel hacker?

    What? I still count as a nerd and this IS news for nerds...

    1. Re:Can someone dumb-down the comment... by Feyr · · Score: 5, Funny

      TRIM makes your new flash toys go weeeeeeeee, instead of them going only wee

    2. Re:Can someone dumb-down the comment... by tepples · · Score: 5, Informative

      Solid-state drives (SSDs) are an alternative to hard disk drives using flash memory instead of spinning platters. This greatly improves read speeds but doesn't do quite as much for write speeds. One reason is that each sector on a solid-state drive can only be erased a finite number of times before it starts failing. For this reason, the microcontroller in an SSD perform wear leveling to spread writes across more physical sectors. TRIM is a feature that an operating system can use to notify a drive that a range of sectors has become unused, which helps wear leveling run more efficiently. A cron job is a program that runs periodically in the background, and Canonical (the publisher of Ubuntu, a distribution of the GNU/Linux operating system) wants to add a cron job that scans attached drives for unused sectors and sends TRIM commands for these sectors. It's possible for an operating system kernel to send a TRIM command for multiple ranges of sectors, but the current version of Linux doesn't know this and instead sends one range at a time. This slows down deleting files because the kernel has to notify the drive of each sector range as the file is deleted. To work around this missing feature of Linux, the cron job will TRIM when a drive isn't busy doing something else.

    3. Re:Can someone dumb-down the comment... by Anonymous Coward · · Score: 2, Insightful

      A filesystem just notes which blocks are erased, it doesn't actually erase them. A flash based disk would normally keep maintaining the contents of erased blocks, since it doesn't know which blocks are still in use and which are not. Due to the way flash memory based disks work, keeping the contents of erased blocks causes significant overhead. Flash memory is erased and written in big blocks, so to write just a small sector, an SSD has to read a big block, modify it and write it back. This read-modify-write cycle causes so-called write-amplification, where writing a small amount of data actually causes much more data to be (read, erased and then) written to the flash memory. This is the reason why some disks are fast initially but become much slower once the entire capacity has been used once. With TRIM, the OS can tell the disk which blocks are no longer needed, so that the disk can treat them like empty blocks and not copy them in the read-modify-write cycle. (It's actually more complicated, but that's the idea.) The criticism is that the Linux kernel uses TRIM inefficiently (it uses many individual calls instead of combining several discontiguous erased blocks into one TRIM call.)

    4. Re:Can someone dumb-down the comment... by dgatwood · · Score: 5, Informative

      Quick terminology note: Flash storage is divided into large blocks, commonly called pages (to avoid confusion with disk blocks). Each page contains many disk blocks.

      Flash storage has an interesting property in that you can change individual bits in only a single direction (either from 0 to 1 or 1 to 0, depending on the flash type). To change it in the other direction, you must wipe an entire flash page, which means rewriting the contents of a large number of blocks. To avoid a high risk of a power failure causing the loss of data that wasn't even changing at the time, the flash controller does not do the erase and rewrite in place. Instead, it rewrites the entire page in a different physical location (with an updated copy of the changed block or blocks), and then atomically changes the block or page mapping so that the blocks are now associated with the new physical page. It then erases the original page so that it can be reused during a subsequent write operation.

      This need to erase and rewrite has a side effect, however. As the flash drive gets more and more full, it eventually runs low on pages that can be erased ahead of time, because eventually every block on the disk has had something written to it at some point in the past, even if that block is no longer actively being used by any actual file. The disk does keep some spare pages around, but that only goes so far towards fixing this problem. This means erasing pages during the write operation itself, which is a much slower operation than writing to a pre-erased page. Many of those pages, however, may contain only data that is no longer relevant—blocks from files that were deleted a long time ago. Therefore, if the flash controller could somehow know that it is safe to pre-erase those pages ahead of time, they could be ready to go when you need to write data to them.

      Unfortunately, it isn't practical for a flash controller to understand every possible file system, which makes that somewhat difficult. To solve this problem, they added a new ATA command, called TRIM. The operating system sends a TRIM command to tell the flash controller that the blocks within a certain range are no longer in use by the filesystem, which means that the flash pages that contain those blocks can be pre-erased for fast reuse.

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    5. Re:Can someone dumb-down the comment... by Lennie · · Score: 2

      This isn't about Linux kernel not being smart enough, it's about crap SSDs that have horrible performance when TRIM is used during normal operations. So Linux can't use it during normal operations.

      --
      New things are always on the horizon
    6. Re:Can someone dumb-down the comment... by KiloByte · · Score: 1

      Even on non-crap SSDs it's better to do this in batches rather than in tiny fragments every time a sector gets freed.

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
  7. Well done, linux by Anonymous Coward · · Score: 0

    Hell yeah, I'm trim'ing live for some time now, even through a luks/dmcrypt layer. Works smoothly. Followed http://wiki.ubuntuusers.de/SSD/TRIM#TRIM-mit-Festplattenverschluesselung (german).

  8. Several years too slow by readacc · · Score: 3, Informative

    Windows 7 incorporated TRIM support for SSDs back in 2009. I know the Linux kernel can do it with the right mount options and has been able to for some time, but after a while you just assume distros are setting things automatically as expected (there's very few situations where TRIM is a bad idea, particularly on a desktop-focused distro like Ubuntu).

    There's a reason I still feel like using a poor-man's system when using Linux on the desktop. They just don't think hard enough about automating stuff. Heck, Ubuntu (and no other distro I believe) doesn't enable Wake-on-lan when you shutdown, whereas Windows 7 and onwards does. This is something you have to script in yourself. Why the fuck aren't distros doing things you can reliably expect in commercials operating systems!?!

    1. Re:Several years too slow by Anonymous Coward · · Score: 2, Informative

      I really don't know about windows TRIM support, but It'd better do it only if the HDD supports it. For this it requires HDD specific drivers. Or at least a complete list of drives that support TRIM. This isn't necessarily available to all linux distros.

      About the wake-on-lan thing, I can only say that on lenovo systems, it's possible to take-over the system by wake-on-lan in the default configuration (because you can boot from dhcp/tftp by default). So I'm pretty glad they didn't enable this by default. Sounds more like a well-thought choice than a missing feature.

      So imho, those distros chose some very good defaults, especially for your usecase.

    2. Re:Several years too slow by Anonymous Coward · · Score: 0

      You should be submitting detailed suggestions directly to the distribution developers instead of whining on /.

    3. Re:Several years too slow by BronsCon · · Score: 1

      If the drive doesn't support it, it just discards the command. There's no reason not to do it. Period.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    4. Re:Several years too slow by readacc · · Score: 0

      No point. The launchpad pages for Ubuntu are full of legitimate bug reports that never get fixed or even addressed/confirmed. Canonical just don't have the manpower to manage a desktop operating system like Microsoft does.

      I've grown tired to writing scripts to manually enable things that a distro could have implemented themselves if they just fucking TRIED once in a while. But they don't, because Unity is more important to them than actual backend improvements. Remember, the shiny is more fun to work on.

    5. Re: Several years too slow by Anonymous Coward · · Score: 0

      About the wake-on-lan thing, I can only say that on lenovo systems, it's possible to take-over the system by wake-on-lan in the default configuration (because you can boot from dhcp/tftp by default). So I'm pretty glad they didn't enable this by default. Sounds more like a well-thought choice than a missing feature.

      So... a system will PXE boot by default and the security concern is the ability to remotely turn the computer on??? Are you fucking serious? Is the machine supposed to otherwise stay off forever on this rogue boot server infested network?

    6. Re:Several years too slow by c0lo · · Score: 2

      Windows 7 incorporated TRIM support for SSDs back in 2009.

      And, to date, it stays the same: only for SATA drives.

      --
      Questions raise, answers kill. Raise questions to stay alive.
    7. Re:Several years too slow by Lennie · · Score: 1

      I encounter many Windows systems that don't enable Wake On Lan on almost a daily basis. So I wouldn't be so sure.

      --
      New things are always on the horizon
    8. Re:Several years too slow by jones_supa · · Score: 1

      Yes.

      What really hits my nerve is the bug which causes the brightness to be adjusted in double steps on laptops.[1] [2]

      The brightness change event is probably processed by two recipients. Maybe the OS grabs it and does the adjustment but lets the event to be handled by BIOS too. Or maybe there are two handlers for the event inside the Ubuntu power management system.

      Anybody, see it for yourself. Install Ubuntu on a laptop and wank the brightness up/down. On most laptops it goes two steps. Usually this temporary workaround fixes it:

      # echo 'N' > /sys/module/video/parameters/brightness_switch_enabled

      This should be basic Quality Assurance stuff...

    9. Re:Several years too slow by Anonymous Coward · · Score: 0

      AHCI is a generic interface for SATA that allows detection and use of TRIM without HD specific drivers. Any modern SATA HD should not require any drivers outside of AHCI.

  9. It's cache by tepples · · Score: 2

    I swear, after the OS, web browsers seem to generate the next highest number of 'writes'.

    I'd bet a lot of these writes are for caching received HTTP response bodies to disk. Otherwise, desktop browsers in low-memory environments would have to act like Firefox for Android and Chrome for Android. When I open multiple pages in tabs in these mobile browsers, they tend to discard entire pages as soon as I switch to another tab and reload them when I switch back. This interferes with my common use case of opening multiple pages in tabs and then reading them while offline and riding transit. Firefox for X11/Linux can keep pages open on a Dell Inspiron mini 1012 laptop with 1 GB of RAM, but Firefox for Android can't on a first-generation ASUS Nexus 7 tablet with the same amount of RAM. I guess the difference comes from two differences in the environment: swapping is more acceptable on X11/Linux than on Android, and desktop browsers are more likely to keep things in disk cache than mobile browsers.

    1. Re:It's cache by PhrostyMcByte · · Score: 3, Informative

      The reason mobile browsers discard pages rather than write them to disk is that they use flash memory. Unlike a SSD which has expensive chips and lots of them, able to spread the writes around and implementing a RAID for speed, the flash in your phones and tablets is a lot more like a microsd card: rather low bandwidth and less useful write cycles.

    2. Re:It's cache by timeOday · · Score: 1

      Why do you say that? According to this guy, passmark scores 44MB/s read / 157 MB/s write on the iPhone 5s, which is very impressive. I am skeptical of the strange imbalance though, but according to the actual passmark website, the 5s earns 19,288 DiskMarks. I don't know what a "DiskMark" is, but for comparison the iPhone 3G scored 586 diskmarks, so the "disk" in the 5s is 33x faster. For sure it's not just a soldered-on MicroSD.

    3. Re:It's cache by CadentOrange · · Score: 1

      You can now buy SDXC cards that have 90MB/s transfer speeds, so it's not impossible that it's just high speed flash. SSDs on the other hand are capable of 400MB/s transfer speeds, 800MB/s if it's one of the new PCI-e devices found in the new MacBooks.

    4. Re:It's cache by tlhIngan · · Score: 2

      For sure it's not just a soldered-on MicroSD.

      Apple traditionally uses raw NAND flash for the phones - this gives them the advantage in that the controller is all theirs in the SoC and any performance issues likewise are in their control rather than use eMMC which you're dependent on the controller and flash array.

      You can now buy SDXC cards that have 90MB/s transfer speeds, so it's not impossible that it's just high speed flash. SSDs on the other hand are capable of 400MB/s transfer speeds, 800MB/s if it's one of the new PCI-e devices found in the new MacBooks.

      Just because the card can do 90MB/sec sequential doesn't mean it can do 90MB/sec random. In fact, a lot of faster SD cards are SLOWER for random reads and writes - they're optimized for high-speed sequential writes because the typical use case is to record high-def video (continuous writes), or handle a big dump of large photos. Very rarely would the device do a random read or write compared to the larger writes.

      And then, there's stuff like what happened on the old Nexus 7 where it starts out great, but as you use it, performance degrades to the point where it's just lagging out.

    5. Re:It's cache by KingMotley · · Score: 1

      Or if it's an OCZ Revo drive which is also an PCI-e device that's been around for years.

    6. Re:It's cache by timeOday · · Score: 1

      A year ago I spent a bunch of money and time trying to move all my data onto SDXC so I could easily move between computers. I bought a Lexar Professional 128 GB 400x SDXC and also the equivalent 128 GB from SanDisk. It was a complete failure. The access time was unacceptable (even in internal readers, not USB readers). But the worse problem was that I had intermittent compatibility errors and transfer errors causing corruption. SD cards are find for what they are made for - intermediate-sized files like images and videos. But for a VMWare image or a TrueCrypt volume, or lots of small files, they are no good.

    7. Re:It's cache by Anonymous Coward · · Score: 0

      Might as well write your data to /dev/null

  10. Re:Doesn't implement the standard???? by viperidaenz · · Score: 1

    Of source it doesn't implement the standard because it's a OS kernel, not a hard drive.
    The drives implement TRIM, Linux just doesn't take full advantage of its capabilities.

  11. Re:Doesn't implement the standard???? by dreamchaser · · Score: 4, Insightful

    More like Linux doesn't follow the best practice recommendations of the standard when it wouldn't be all that hard to do so.

  12. Where TRIM is unsupported by tepples · · Score: 1

    I really don't know about windows TRIM support, but It'd better do it only if the HDD supports it.

    What happens when the kernel sends a TRIM command to a drive that does not recognize TRIM commands?

    1. Re:Where TRIM is unsupported by Immerman · · Score: 1

      I don't have the spec in front of me, but my bet is one of two things:
      1) The command is recognized in it's entirety by the drive as being an unrecognized command, and either ignored or reported to the OS as an error.
      2) undefined behavior (This *probably* does not include your hard drive animating and going on a homicidal rampage. Probably.)

      Now, how much do you want to bet that all the old HDDs out there properly recognize the TRIM command as invalid and fail gracefully?

      --
      --- Most topics have many sides worth arguing, allow me to take one opposite you.
    2. Re:Where TRIM is unsupported by Anonymous Coward · · Score: 0

      It gets more fun. Some early SSDs *claim* to support TRIM but choke on it.

    3. Re:Where TRIM is unsupported by 0123456 · · Score: 1

      It gets more fun. Some early SSDs *claim* to support TRIM but choke on it.

      Fortunately, those early SSDs have mostly expired from other firmware bugs or write lifetime by now.

    4. Re:Where TRIM is unsupported by Anonymous Coward · · Score: 0

      Depends on what the stupid engineer decided to use the not yet defined command for, instead of using the "reserved for internal use" commands.

      One drive model reportedly used it for firmware update. No magic numbers, no checksums, just fire off the TRIM command, followed by the new firmware.

      These drives were bricked when used with a Linux distro that enabled TRIM by default. That taught the distros to not enable TRIM by default.

    5. Re:Where TRIM is unsupported by Anonymous Coward · · Score: 0

      You'll still get a bunch of OMG LINUX KILLED MY SSD idiots and the resulting press frenzy :/

  13. Increase suggestion quality for busy developers by tepples · · Score: 3, Insightful

    I imagine that discussing the suggestions on Slashdot first is a way to avoid presenting half-baked suggestions to busy developers.

    1. Re:Increase suggestion quality for busy developers by Anonymous Coward · · Score: 0

      I imagine that discussing the suggestions on Slashdot first is a way to avoid presenting half-baked suggestions to busy developers.

      Very true. If anything the audience here can usually validate an issue and provide a reasonable level of impact to vet kernel or distro changes, or at least find out it's not just them going batshit crazy on a particular problem.

  14. Oversimplification in the article by adisakp · · Score: 4, Informative

    "As long as that SSD doesn't stall trying to pull blocks off the top of that queue, it really doesn't matter how deep it is. So if you have 10GB of free space on your partition, you only need to call wiper.sh / fstrim once every 10GB worth of file deletions."

    This isn't necessarily true. Earlier Trim will improve the performance of the SSD drive because the drive knows more free space -- more free space allows the drive to 1) pre-emptively erase flash 2) coalesce fragmented blocks 3) more efficiently combine write blocks 4) perform wear levelling operations with less overhead.

    Early trimming can have a similar effect to the manufacturer increasing slack space which increases performances on nearly all SSD's.

  15. Nice to see... by Anonymous Coward · · Score: 0

    Nice to see the SuSE Linux guys keeping their eyes on the ball. It is (at least used to, haven't been using linux in a while) a good distro, and clearly it has some bright people working on it.

    1. Re:Nice to see... by cbhacking · · Score: 1

      Still my preferred Linux distro for desktop productivity (where the important points are A) easy to tell it what I want it to do, and B) it does it well, without needing a lot of hand-holding but also without needing me to fix anything afterward). Backtrack (I suppose I should really upgrade to Kali now...) and FreeBSD in VMs, for work and play respectively.

      --
      There's no place I could be, since I've found Serenity...
  16. Poor man's TRIM by tepples · · Score: 1

    A filesystem just notes which blocks are erased, it doesn't actually erase them. [...] With TRIM, the OS can tell the disk which blocks are no longer needed, so that the disk can treat them like empty blocks

    Why couldn't an operating system just write a big block of 0xFF bytes to an unused sector, which the SSD's controller would compress into an efficient representation of a low-information-content sector, instead of needing a dedicated command?

    1. Re:Poor man's TRIM by dgatwood · · Score: 1

      Because that would not cause the underlying flash page to be erased, which means it would not improve performance later, when the flash controller runs out of pre-erased pages and has to start erasing pages on the fly during the write operation.

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    2. Re:Poor man's TRIM by Cley+Faye · · Score: 1

      Because the drive itself have no concept of filesystem, and wouldn't know what some specific patterns means. A sector full of only 0xFF might mean "I don't need this anymore" as well as "this file have a sector worth of 0xFF stored there". So, no way for the drive to know where there is actual unused space.
      Using trim, the FS/OS/whatever's on the line can tell the drive "ok, this part I don't need anymore, go play with it" in a non-ambiguous way.

    3. Re:Poor man's TRIM by Anonymous Coward · · Score: 0

      To make it work, the disk would have to look at every written block and see if it's "the empty block". With this method, you'd transmit huge amounts of data over the bus and have the disk compare every byte just so that the disk knows which blocks are empty. Then it would treat empty blocks like unused blocks. But why would you do that? You have to modify the OS anyway, because as I mentioned earlier, file systems don't usually erase blocks, so the disk would not benefit from detecting empty blocks unless the OS specifically writes them. So you either add a TRIM instruction or an instruction to overwrite empty blocks. TRIM is faster and easier.

    4. Re:Poor man's TRIM by Anonymous Coward · · Score: 0

      As long as the drive returns the same data that was written, it doesn't matter whether the data is actually read or generated because the disk only remembered "empty block". The actual reason for using TRIM instead of overwriting erased sectors with zeros is that telling the disk "blocks 1234865 to 19651281 are unused" is much faster than writing gigabytes of zeros.

    5. Re:Poor man's TRIM by ultranova · · Score: 1

      Why couldn't an operating system just write a big block of 0xFF bytes to an unused sector, which the SSD's controller would compress into an efficient representation of a low-information-content sector, instead of needing a dedicated command?

      Why go to the trouble of implementing a command implicitly when you can implement it explicitly and avoid unintended side effects? Not to mention operating systems would still need to change the way they handle the disk to support the 0xFF method, and it would take up bandwidth needlessly.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    6. Re:Poor man's TRIM by TheGratefulNet · · Score: 1

      every byte from 00 thru ff is a valid data byte. writing what you think is a 'code' is still just data.

      trim tells the drive that there is NO data on this sector. ...if we had 257 binary codes that bit inside an 8bit byte, we would not need trim ;)

      --

      --
      "It is now safe to switch off your computer."
    7. Re:Poor man's TRIM by wonkey_monkey · · Score: 1

      Why couldn't an operating system just write a big block of 0xFF bytes to an unused sector

      My desktop background is a white .bmp, you insensitive clod!

      --
      systemd is Roko's Basilisk.
    8. Re:Poor man's TRIM by Lennie · · Score: 1

      The SSD can't treat 0xFF as empty because 0xFF could be part of a file.

      --
      New things are always on the horizon
    9. Re:Poor man's TRIM by Anonymous Coward · · Score: 0

      Irrelevant. When you read from trimmed sectors, you get 0x00 ...

    10. Re:Poor man's TRIM by Anonymous Coward · · Score: 0

      The thing is, though... An empty flash page contains 0xFF anyway, so it should work still. Even if the page is not mapped, if the controller implemented "page of 0xFF = trim", it would know to return a page of 0xFF when it gets a request for an unmapped page.

    11. Re:Poor man's TRIM by TheRaven64 · · Score: 1

      Because that would require the flash to do deduplication and know that the blocks were full of FF and so could be copy-on-write (and, in your scheme, block-level compression). You're thinking of an SSD as if it were a big RAM chip, full of blocks of flash with a simple addressing scheme. It isn't. It's a load of flash cells, which wear out over time, and a very complicated controller that maps blocks to cells. The point of TRIM is not to erase the block, it is to remove the block from the remapping tables so that that the wear levelling knows it has an unused block that can be erased whenever it makes sense to do so. The erasure happens on a cell granularity, and cells are some multiple of the block size (not sure what they are these days, probably 64-128KB). Knowing that all blocks in a cell are free is great, because the controller can then erase the entire cell. Knowing that only one block is in use and it hasn't been modified for a while means that it can defragment by erasing one cell, moving the individual infrequently modified blocks to that cell, and then add their old cells to the free list for erasure.

      --
      I am TheRaven on Soylent News
    12. Re:Poor man's TRIM by tepples · · Score: 1

      Perhaps you missed my implication: Instead of having a concept of empty sectors to begin with, just treat sectors with long runs of a constant value as highly compressible. You need to do that anyway for the last sector of a file, which contains on average half a sector of zeroes.

    13. Re:Poor man's TRIM by KingMotley · · Score: 1

      Well except for the error detection/correction bits. That would be the difference.

    14. Re:Poor man's TRIM by KingMotley · · Score: 1

      It's not the same because you are forgetting that even sectors with long runs have error detection/correction bits at the end, and a TRIM will make them 0x00 (or technically, SSD trimed pages are written with all bits on, so 0xFF). In order to be able to (likely) quickly reuse that sector again, it must first be erased setting all bits on, then written by turning off selected bits. Writes can only change bits from 1 to 0, which is quick, and does not degrade the life of the sector. Erasing it however, is a longer process, and does degrade the sector.

    15. Re:Poor man's TRIM by Vegemeister · · Score: 1

      Compressible data should never hit disk. For your scheme to work, the OS's encryption layer would have to detect runs of your magic byte and send them through unencrypted. Much easier to just use an out-of-band method like TRIM.

  17. It's not enabled by default?!?! its 2013!! by citylivin · · Score: 0, Troll

    What the hell reason would it not be enabled by default? I dropped an SSD in my webserver at home a year ago. I just assumed, since osx and windows both support it for YEARS, that forward thinking linux did. Wow.

    Now i have to go check tonight when I get home with this article as a reference
    http://askubuntu.com/questions/18903/how-to-enable-trim

    I am shocked and appalled. We all laughed 10 years ago when M$ said installing linux may damage your hard drive, but in this case its true! What a sad state of affairs.

    --
    As a potential lottery winner, I totally support tax cuts for the wealthy
    1. Re:It's not enabled by default?!?! its 2013!! by Microlith · · Score: 4, Informative

      Linux fully supports TRIM and failure to enable it will not damage the device in any way. What will happen is the device will slow down and spend more time freeing blocks as-needed if the drive is increasingly full.

      Of course, if your SSD is your boot drive and you have /home elsewhere, chances are you aren't going to suffer and current drives are significantly faster than older ones (and at their worst, still significantly faster than rotating media.)

    2. Re:It's not enabled by default?!?! its 2013!! by Anonymous Coward · · Score: 1

      > osx and windows both support it for YEARS

      So you've proven yourself an irrational Linux-hater. Why are you here?

      With my MacBook, here is what I had to do to enable TRIM:

      http://www.mactrast.com/2011/07/how-to-enable-trim-support-for-all-ssds-in-os-x-lion/

      With my work laptop that is a Dell, I had to download a utility from Intel to enable TRIM:

      https://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&DwnldID=18455

      Care to apologize for your lies?

    3. Re:It's not enabled by default?!?! its 2013!! by magamiako1 · · Score: 1

      There is nothing you do special in Windows to enable TRIM support. It is included support directly in the OS and the drivers, automatically. The only time you have to do anything special in Windows for TRIM support is when you're actively using Intel SSDs in a RAID configuration using the Intel Rapid Storage Driver--and even that is merely a driver update, and boom, RAID0 TRIM support passed from OS to driver to device.

      That's it. Under all other circumstances TRIM is automatically enabled and there are no extra utilities needed under any circumstances.

    4. Re:It's not enabled by default?!?! its 2013!! by cmurf · · Score: 1

      What the hell reason would it not be enabled by default?

      a.) Because the spec was poorly written making the command a non-queuing command, therefore file systems can't just spit out a series of TRIM commands every time a file is deleted because the queue has to be cleared first. This slows down everything, reads and writes. With multiple file systems per drive, a given file system doesn't necessarily know the drive is idle so some other process would need to do the delayed TRIM which is what Canonical is suggesting.

      b.) Some manufacturers have implemented very aggressive erase cycles upon TRIM commands being received and that stalls the drive also. This is also not very smart.

      I just assumed, since osx and windows both support it for YEARS, that forward thinking linux did. Wow.

      OK OS X only supports it for Apple branded drives, it's disabled for most (maybe all) 3rd party SSDs. No doubt Apple found certain edge cases where it was causing a problem and instead of white or blacklisting piles of drives they decided not to let manufacturers use users as guinea pigs. Conversely, Microsoft decided it's probably better than not doing it and after all the manufacturer's and their industry trade association and standards body need to sort out this mess rather than being bailed out of it.

    5. Re:It's not enabled by default?!?! its 2013!! by TheRaven64 · · Score: 1

      And TRIM is enabled by default on OS X if you use the stock drives. If you use an after-market replacement then you do need to explicitly enable it (which sucks). With FreeBSD, it's enabled for UFS by default since 9.0 and ZFS by default since 9.2. It is also enabled in software raid configurations by default in 10.0. I'm very surprised Linux doesn't enable it by default.

      --
      I am TheRaven on Soylent News
    6. Re:It's not enabled by default?!?! its 2013!! by TheRaven64 · · Score: 2

      With multiple file systems per drive, a given file system doesn't necessarily know the drive is idle so some other process would need to do the delayed TRIM which is what Canonical is suggesting.

      Why would a filesystem need to know? On FreeBSD, the filesystem just spits a BIO_DELETE command into the GEOM layer, and it is up to GEOM to schedule when to dispatch it - it's free to reorder it, as long as it doesn't move it after a BIO_WRITE with an overlapping range. If the filesystem needs to know about the status of other filesystems then that's a serious layering problem. The FS should not be making the decision about whether to send the BIO_DELETE, because it's the responsibility of something lower down the stack to decide what to do with it. For example, a RAM disk can use it to free the underlying memory. You don't want every filesystem to have to know about every possible kind of device.

      --
      I am TheRaven on Soylent News
    7. Re:It's not enabled by default?!?! its 2013!! by jones_supa · · Score: 1

      Linux fully supports TRIM and failure to enable it will not damage the device in any way.

      Linux does not fully support TRIM. It is the very reason why many distros do not automatically enable "discard" in fstab. As noted in the summary: "the kernel performs TRIM to a single range, instead of vectorized list of TRIM ranges, which is what the specification calls for. In some scenarios this results in lowered performance".

  18. Re:Doesn't implement the standard???? by Anonymous Coward · · Score: 0

    Seriously? What relevance is that on an Ubuntu thread??

  19. Re:Doesn't implement the standard???? by sexconker · · Score: 5, Informative

    Of source it doesn't implement the standard because it's a OS kernel, not a hard drive.
    The drives implement TRIM, Linux just doesn't take full advantage of its capabilities.

    The drive does shit (shit that you don't get to know the details about) when issued a TRIM command.
    The OS is responsible for sending that TRIM command.

    TRIM tells the drive when data is deleted, allowing the drive to do whatever it thinks is best when writing pages of data or erasing blocks of data.
    Without TRIM, the drives considers all previously written data to be valid because it doesn't know about deletions (they're done at the logical level within the file system).

    TRIM enables your drive to have much more flexibility when writing (and overwriting) data, and when load balancing and garbage collecting. It also reduces the need for load balancing and garbage collecting.

    All decent modern SSDs support TRIM for good reason. All decent modern OSs should as well.
    Now if I could just get Intel to enable TRIM on RAID 0 for my chipset (1 generation behind the cutoff), I'd be set.

  20. Re:Doesn't implement the standard???? by Anonymous Coward · · Score: 1

    I'm surprised this is still being figured out. I thought TRIM was old-hat, long since turned-on by default and working as intended.

    So it's off by default because the Linux implementation slows regular IO, and even when it's on it's sub-optimal due to lack of multiple trim ranges.

    Microsoft has had this working in Windows 7 circa 2009. With multiple trim ranges.

    WTF? SSDs are important Linus. What is the major malfunction here?

  21. Re:Doesn't implement the standard???? by viperidaenz · · Score: 1

    The drive does shit (shit that you don't get to know the details about) when issued a TRIM command.

    My point exactly. the drive implements the standard. Not the OS.

  22. Already part of my Ubuntu setup routine. by Flammon · · Score: 1

    I already setup a cron job to fstrim my drives so this is a welcome addition that will save me a step during new installations.

    1. Re:Already part of my Ubuntu setup routine. by magamiako1 · · Score: 1

      In Windows, when I perform a delete operation, the TRIM command is automatically sent along with the DELETE operation command. No scheduled tasks needed.

    2. Re:Already part of my Ubuntu setup routine. by magamiako1 · · Score: 1

      Adding to this:

      http://blogs.msdn.com/b/e7/archive/2009/05/05/support-and-q-a-for-solid-state-drives-and.aspx

      "Windows 7 requests the Trim operation for more than just file delete operations. The Trim operation is fully integrated with partition- and volume-level commands like Format and Delete, with file system commands relating to truncate and compression, and with the System Restore (aka Volume Snapshot) feature."

    3. Re:Already part of my Ubuntu setup routine. by Flammon · · Score: 1

      Hence the performance hit in Windows. Sounds similar to discard mount option, something that I didn't want because of the performance hit while I was working. I'd much rather keep my system snappy when I'm using it and trim the drives when I'm not.

    4. Re:Already part of my Ubuntu setup routine. by magamiako1 · · Score: 1

      How is there a performance hit? I get over 500MB/second reads and writes on my Samsung 830 SSDs--each. I've pushed over 1GB/sec when I had them in a RAID0.

      There is a much higher performance hit by not "trimming" your drive. And if this isn't enabled by default, it means a vast majority of Linux users out there with SSDs are experiencing significant performance degradation that they don't even know about.

    5. Re:Already part of my Ubuntu setup routine. by magamiako1 · · Score: 1

      http://opensuse.14.x6.nabble.com/SSD-detection-when-creating-first-time-fstab-td3313048.html

      If you read the source for the information on the 'performance hit' issue, It looks like Windows 7 is not performing the TRIM command in the same manner for which there was a performance hit with the 'mount -discard' option when using ext4.

      "Also, it was assumed 9 months ago that Windows 7 did it that way. But
      since then one of the kernel devs got a sata protocol analyser and
      monitored how Windows 7 is doing it. Not like "mount -discard" at
      all, so that whole paradigm seems like a rat hole to me. "

      "Note FITRIM is still not as good as what Windows 7 is doing. The
      claim is aggregating multiple trim ranges into one ATA command is hard
      for the kernel to do, so it is still on the wish list, not the done
      list."

      Whatever is implied by these 2 tidbits means that Windows is handling the situation much better than the Linux kernel.

    6. Re:Already part of my Ubuntu setup routine. by Flammon · · Score: 1

      Yes, when you compare it the mount discard option, which is why I avoided it. A daily trim job will however give you much better performance which is what Windows 8 is doing now. Not sure about Windows 7.

      Trimming on the fly, whatever the implementation, will always slow you down more during use than batch trimming when the system is idle.

    7. Re:Already part of my Ubuntu setup routine. by Anonymous Coward · · Score: 0

      Windows 8 still includes the TRIM operation on deletes. It also includes the TRIM in the new 'defrag' tool.

      I am actually not entirely sure why they did this, but I suspect it's a number of reasons:

      -There are file operations that happen that do NOT send trim and could slow down performance over a much longer period of time. (Perhaps Hyper-V and virtual machine devices on thinly provisioned vhds?)
      -The teams that develop these applications do so completely independently. Figured it wouldn't hurt to include a built-in TRIM operation in the updated 'defrag' tool anyway. There could be no real benefit nor use to its existence.

    8. Re:Already part of my Ubuntu setup routine. by Curate · · Score: 1

      Windows 8 still includes the TRIM operation on deletes. It also includes the TRIM in the new 'defrag' tool.

      The defrag tool isn't sending TRIMs, the file system is. The file system sends TRIMs for clusters that get freed for any reason. One reason a cluster would get freed is of course the file gets deleted. But another reason is that the file gets defragged. Say there's a request from the defrag tool to move a particular file VCN from LCN1 to LCN2. Then in the same transaction LCN2 gets allocated by the file system and LCN1 gets freed, and so LCN1 can now be TRIM'd. All of this is being performed inside the file system completely transparent to the application. The only application that explicitly sends a TRIM is format, which sends a TRIM for the entire volume.

  23. Some drives choke on TRIM by tepples · · Score: 1

    To make it work, the disk would have to look at every written block and see if it's "the empty block".

    A lot of flash controllers already use compression of some sort to reduce write amplification. So a controller could just store which sectors compress to the smallest sizes. That wouldn't be much more effort than storing which sectors are TRIMmed, and it'd ensure a well-defined response when the kernel attempts to read a TRIMmed sector.

    TRIM is faster and easier.

    Unless, as Immerman pointed out, a particular drive chokes on it. Sending TRIM to a device that doesn't correctly support TRIM produces "undefined behavior", and even some drives that claim to support TRIM don't in fact. No drive chokes on constant fill.

    1. Re:Some drives choke on TRIM by Anonymous Coward · · Score: 0

      Don't buy broken SSD drives. Seriously.

  24. The drive would decompress it by tepples · · Score: 1

    A sector full of only 0xFF might mean "I don't need this anymore" as well as "this file have a sector worth of 0xFF stored there".

    Either way, when you read that sector back, the drive would decompress it to a string of 0xFF. This is true whether it's an "empty sector" or a row of white pixels in a BMP file.

    Using trim, the FS/OS/whatever's on the line can tell the drive "ok, this part I don't need anymore, go play with it" in a non-ambiguous way.

    What happens when the kernel attempts to read back a sector that hasn't been written since it was last TRIMmed?

    1. Re:The drive would decompress it by Anonymous Coward · · Score: 0

      I don't have the URL, but there is floating out there an article about using NTFS recovery tools on a plain old hard disk versus a SSD. Needless to say, a FDISK got data back on the hard disk, and on the SSD, bunches of zeroes and the bare fs index tree.

  25. Secure deletion by tepples · · Score: 0

    Why go to the trouble of implementing a command implicitly when you can implement it explicitly and avoid unintended side effects?

    Because the explicit command causes unintended side effects in drives manufactured prior to the command's introduction.

    Not to mention operating systems would still need to change the way they handle the disk to support the 0xFF method

    Any file system supporting "secure" deletion should be filling deleted files' sectors in the background anyway.

    1. Re:Secure deletion by Anonymous Coward · · Score: 3, Informative

      Why go to the trouble of implementing a command implicitly when you can implement it explicitly and avoid unintended side effects?

      Because the explicit command causes unintended side effects in drives manufactured prior to the command's introduction.

      What in the fuck, you seriously consider some dude's admitted speculation as proof that this is a real risk?

      Here's some vastly more likely semi-informed speculation: Like most modern standards, SATA has many optional features, and standardized discovery methods to inform software what each device can and cannot do. If a drive says it doesn't support TRIM (or, to be more precise, lacks some new capability tag which says it can do TRIM), the OS simply never issues a TRIM command.

      It's like you (and that Immerman dude) have no concept of how sane people design protocols to safely accommodate future extensions.

      Not to mention operating systems would still need to change the way they handle the disk to support the 0xFF method

      Any file system supporting "secure" deletion should be filling deleted files' sectors in the background anyway.

      Which operating system would that be? I'm not aware of any mainstream OS which even tries to implement secure deletion at the kernel level. I know of exactly one (OS X) which implements it in a user-visible way at all, and there it's just an option to "secure empty" Trash (read: it overwrites file contents in place). This is really not very secure since it is 100% userland code which has no way of tracking all the blocks ever occupied by that file and scrubbing them all -- it can only scrub blocks currently occupied by the file. It can defeat casual attempts to recover file contents, but there aren't any guarantees.

      But it's worse than that. Let's say you tried to write an OS For Paranoids which, at the kernel level, scrubbed all blocks as the file was deleted or as they ceased to be part of a file. This still would not be truly secure. ATA (and other abstract block device protocols like SCSI) implements semantics somewhat like this: "If you read block N, you'll get back whatever was last written to block N, or undefined data if N was TRIMmed and not subsequently written to". There is absolutely no guarantee that the device did not make invisible, unaddressable extra copies of the contents of block N behind the operating system's back. As a matter of fact, SSDs frequently do just that -- it's required if you're going to implement effective wear leveling. Even HDDs frequently leave invisible copies of old data behind whenever they have to spare out a bad sector. Merely overwriting blocks is not, and never has been, a true guarantee that the contents are actually gone from storage media.

      This is why good SSDs implement the ATA Secure Erase command, which (if implemented according to spec) truly erases 100% of the media, including all overprovisioned space, any invisible copies of old data which it may contain, and so on. But wait, oh mah gawd that's another new command- HOLY SHIT IT WILL NEVER WORK BECAUSE NOBODY CAN EVER ADD NEW THINGS TO A STANDARD!!! why did I not see this before?!

      Tepples, please, for the sake of my sanity, please consider no longer arguing endlessly with posters who are explaining how shit works in the real world. Next time, instead of succumbing to the temptation of raising objection after objection based on your ideas about how things ought to work, consider the possibility that those ideas are naive and wrong.

    2. Re:Secure deletion by cmurf · · Score: 1

      Any file system supporting "secure" deletion should be filling deleted files' sectors in the background anyway.

      You don't seem to understand the basics of how SSD's work or you would haven't said this. Such secure file deletion doesn't actually work on SSDs. The LBA's overwritten with zeros or random data are written to different, already erased physical pages, while the original pages containing the data are simply flagged for erase. It isn't possible to directly overwrite SSD pages. They have to be erased first.

    3. Re:Secure deletion by ultranova · · Score: 1

      Because the explicit command causes unintended side effects in drives manufactured prior to the command's introduction.

      Such as? The post you linked to explicitly said they were simply guessing.

      On the other hand, compression algorithms do have plenty of weird side effects, from increased latency to randomly varying write speeds to the impossibility of estimating actual free space - because for every bit a lossless compression algorithm shaves off one file, it must add to some other file (because if a bigger file is made to look like a smaller file, the smaller file that looks like its compressed form must be moved out of the way, and the only place with room is what the bigger file just vacated). Thus some files are actually made bigger than their size implies.

      Any file system supporting "secure" deletion should be filling deleted files' sectors in the background anyway.

      Secure against what, exactly speaking? Even physical hard drives can remap blocks. And how many files actually need to be unrecoverable? Not many. And drives are cheap. So, if you store sensitive information, don't trust "secure erase" or even "drive wipers", just physically destroy the drive when you're done with it (but if you're too cheap for that, a drive wiper is still better than trusting an OS "secure" delete; even if the OS is trustworthy, filling the entire drive with garbage several times over has a much higher chance of pushing out your secret data than filling just a tiny fraction of it, as "secure" delete does). And given that, "secure" deletion is a pointless waste of resources that will actually lower people's security by giving them promises it can't keep.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    4. Re:Secure deletion by tepples · · Score: 1

      for every bit a lossless compression algorithm shaves off one file, it must add to some other file

      Pigeonhole principle. I'm aware of that.

      Thus some files are actually made bigger than their size implies.

      By about one byte, a marker that the sector is uncompressed. In a real file system, this overhead of one byte per sector is made up for by real files that contain real redundancy, such as the last sector of a file (or the only sector of a small file). On average, the last sector of a file will contain a run of half a sector's worth of $00 bytes. This and other cases where sectors can be compressed allow more logical sectors to fit into a single erase page.

    5. Re:Secure deletion by Anonymous Coward · · Score: 0

      That's a relly good writeup which should get a 5 for informative, though I don't know if that's done to anonymous.

  26. Writing to disk on purpose by tepples · · Score: 2

    I'm aware of that. But what should I do if I want the browser to write the page to flash memory, such as if I'm about to go offline for an hour?

    1. Re:Writing to disk on purpose by JanneM · · Score: 2

      Firefox Mobile (at least the tablet Beta) has a "reader" mode for that. You see a small "book" icon in the address bar; it makes a "book" style reflow of the site without a lot of the navigation cruft for easier reading, but if you long-press it, it will also save the document for later offline reading.

      --
      Trust the Computer. The Computer is your friend.
    2. Re:Writing to disk on purpose by cerberusss · · Score: 1

      I use instapaper, pocket or some other offline reader for that.

      --
      8 of 13 people found this answer helpful. Did you?
  27. Re:Doesn't implement the standard???? by Anonymous Coward · · Score: 0
    Marketing and competitor bashing.

    Microsoft's main products now.

  28. Re:Doesn't implement the standard???? by Anonymous Coward · · Score: 2, Funny

    WTF? SSDs are important Linus. What is the major malfunction here?

    There was a fully functioning implementation on its way into the kernel, but Linus lost it when his only copy of the code was lost because his SSD failed.

  29. Re:Doesn't implement the standard???? by Anonymous Coward · · Score: 0

    The word you are looking for is execute. TRIM needs to be implemented on both sides of the equation.

  30. Re:Doesn't implement the standard???? by Anonymous Coward · · Score: 0

    cool story bro

  31. Re:Doesn't implement the standard???? by jones_supa · · Score: 2

    It makes you wonder what other optimizations are not being done but are done in Windows.

    I'll toss in one: in Windows 8, an USB memory stick is automatically powered down if it is mounted but has not been in use for a while.

  32. Here's a solution... by bayankaran · · Score: 1

    I moved all the cache directories of Firefox/Chrome/IE and even the temp directory of OS and all applications point to a cheap USB thumb drive.

    I have not looked around to find out if there is more writes happening elsewhere other than cache/temp...but I guess a super majority is taken care of.

    The above might be the reason the SSD did not 'disappear' when a power outage happened.

    Now, as far as I know the only cache I cannot control is when the virtual machines are booted up - swap spaces remain in the SSD.

    --
    Tat Tvam Asi
  33. Re:Doesn't implement the standard???? by VortexCortex · · Score: 2

    The word you are looking for is API. An implementation is on the side of the thing that exposes the API. The OS uses the API, it does not implement the standard. Implement would mean providing the API. Not making use of an API doesn't mean you're not standards compliant. Eg. None of my OSs make use of (U)EFI (because coreboot is amazing). My OSs are following the boot standards, They just aren't using the API that was implemented for (U)EFI.

    You "execute" TRIM through the API of its implementation. Calling it on delete is an optional part of the protocol. Not calling it on deletes is not deviation from the standard.

  34. Re:Doesn't implement the standard???? by sl4shd0rk · · Score: 1

    Windows 8, an USB memory stick is automatically powered down if it is mounted

    Yeah, but in reality it gets it wrong half the time and closes Firefox instead.

    --
    Join the Slashcott! Feb 10 thru Feb 17!
  35. Block-level RLE by tepples · · Score: 1

    Because that would require the flash to do deduplication and know that the blocks were full of FF and so could be copy-on-write (and, in your scheme, block-level compression)

    Block-level run-length encoding is exactly what I had in mind. This way more logical sectors can be packed into one 64-128K erase page. A sector that has been compressed into "0x00, then 4095 more of the last byte" is as good as TRIMmed. It needs to be done anyway for file tails.

    1. Re:Block-level RLE by KingMotley · · Score: 1

      is as good as TRIMmed

      Negative. See any of the above explanations as to why.

  36. Finding unbroken SSDs by tepples · · Score: 1

    How should one make sure a particular model of SSD is not broken before buying it? I was under the impression that by the time all the bugs got shaken out of a product, it ended up close to EOL.

  37. Optimizations are trade-offs by Larry_Dillon · · Score: 1

    The "everything turned on by default" concept is part of why Windows is bloated and insecure.

    This is changing, but part of what I like about Linux is that it makes less assumptions about what you are doing and assumes a (at least somewhat) skilled operator. Part of what I dislike about Ubuntu is that it makes too many assumptions about what I want to do. It's also why multiple Linux distros that target different audiences are a good thing.

    The points here are that :
    1. All optimizations or assumptions make something better for a certain task or use scenario.
    2. Any optimization that makes something better for a certain task or scenario will be worse for a different task/use scenario.

    Think of strong versus lightweight -- it's a tradeoff.

    --
    Competition Good, Monopoly Bad.
  38. Re:Doesn't implement the standard???? by KingMotley · · Score: 1

    Windows does this for hard disks too.

  39. Re:Doesn't implement the standard???? by sexconker · · Score: 1

    The word you are looking for is API. An implementation is on the side of the thing that exposes the API. The OS uses the API, it does not implement the standard. Implement would mean providing the API. Not making use of an API doesn't mean you're not standards compliant. Eg. None of my OSs make use of (U)EFI (because coreboot is amazing). My OSs are following the boot standards, They just aren't using the API that was implemented for (U)EFI.

    You "execute" TRIM through the API of its implementation. Calling it on delete is an optional part of the protocol. Not calling it on deletes is not deviation from the standard.

    Holy shit no.

    TRIM is a COMMAND, part of the ATA INTERFACE STANDARD.
    Hardware devices IMPLEMENT this STANDARD to function. Operating systems IMPLEMENT this STANDARD to support said hardware.

    API stands for APPLICATION PROGRAMMING INTERFACE. APIs allow for SOFTWARE to talk to SOFTWARE. APIs do not fucking apply here. TRIM is not part of an API. It is part of the fucking STANDARD. Whatever the drive does in its FIRMWARE doesn't make TRIM an API, nor does it mean the OS doesn't have to IMPLEMENT TRIM as part of the latest SPECIFICATION of the ATA STANDARD.

    People like you are why manufacturers have to pay money and get certified to be able to slap a Windows or Mac sticker on their gear, and not the other way around.