Slashdot Mirror


Linux 3.15 Will Suspend & Resume Much Faster

An anonymous reader writes "The Linux 3.15 kernel now in its early life will be able to suspend and resume much faster than previous versions of the Linux kernel. A few days ago we saw ACPI and Power Management updates that enable asynchronous threads for more suspend and resume callbacks. Carrying out more async operations leads to reduced time for the system suspend and then resuming. According to one developer, it was about an 80% time savings within one of the phases. On Friday, work was merged that ensured the kernel is no longer blocked by waiting for ATA devices to resume. Multiple ATA devices can be woken up simultaneously, and any ATA commands for the device(s) will be queued until they have powered up. According to an 01.org blog post on the ATA/SCSI resume optimization patches, when tested on three Intel Linux systems the resume time was between 7x and 12x faster (not including the latest ACPI/PM S&R optimizations)."

32 of 117 comments (clear)

  1. Caution by arth1 · · Score: 5, Insightful

    There's a reason why RAID controllers tend to wake up drives sequentially. The power load of waking up 20 hard drives at the same time can be tremendous compared to the load when they're all spinning and purring. So you don't do that.

    So I hope that power draw is taken into account, and that there will be options to limit the number of devices woken up simultaneously.

    1. Re:Caution by K.+S.+Kyosuke · · Score: 5, Insightful

      Something tells me that machines with a heavily RAID-ed disk subsystem are not exactly your usual candidates for frequent power cycles.

      --
      Ezekiel 23:20
    2. Re:Caution by RulerOf · · Score: 2

      But what system with dozens of hard drives in it would be entering and exiting S3 constantly anyway?

      You might do power saving on hypervisor hosts, but on a SAN? I can't think of a scenario where it makes a lot of sense... but perhaps I'm just lacking the proper imagination :P

      On topic: I think this is awesome. I want to be able to suspend my machine and wake it up whenever I feel like it, with VMs shuffling around waiting for me to pick up a different tablet, or sit at a different desk. x86 has a lot of catching up to do. After all, I've gotten pretty used to putting a device "to sleep" and "waking it up" instantly. It'd be nice if my computer could do the same thing... even if it's only in spirit. Of course, an S3/4/5 is a much deeper sleep than my phone or tablet ever enters while it's powered on, AFAIK.

      --
      Boot Windows, Linux, and ESX over the network for free.
    3. Re:Caution by SpankiMonki · · Score: 5, Informative

      There's a reason why RAID controllers tend to wake up drives sequentially.

      And the RAID controllers will continue to do just that. All this change does is allow the kernel to continue resuming without having to wait for the device to report that it's ready. Any commands sent to the device in the meantime are queued.

    4. Re:Caution by KiloByte · · Score: 2

      If your UPS dies, a suspended machine is screwed just the same. There's rather little point in suspending a server: even ones that are off outside business hours are better off hibernating rather than suspending.

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    5. Re:Caution by Anonymous Coward · · Score: 3, Informative

      Consider that Linux runs on everything. It's not unlikely that there are plenty of clusters out there that suspends whole computers when the power is not needed. If they are also filled with HDDs, then that use case arises.

      I think it's a valid point, even though it's not very common.

    6. Re:Caution by Anonymous Coward · · Score: 2, Informative

      If it's a hardware RAID controller then the kernel should "see" a single logical device it needs to wake up, and it can leave it to the controller firmware to wake up the drives in the correct order.

    7. Re:Caution by sjames · · Score: 2

      No, but but that one time a year when it does, it will be important to power the drives in sequence, not all at once.

      The parallel start can still help though. There is a period of time between the inrush where the platters are at about the right speed but not yet stable. That's the point where powering the next drive on would be OK.

    8. Re:Caution by sjames · · Score: 3, Interesting

      And if it's soft RAID or a ZFS pool?

    9. Re:Caution by arth1 · · Score: 2

      But what system with dozens of hard drives in it would be entering and exiting S3 constantly anyway?

      It doesn't have to be constantly. Once is enough.

      And you don't even need dozens of hard drives. Workstations with RAID 10 aren't all that uncommon. Being able to not have all drives spin up all at the same time would be beneficial, especially as the power supply gets older - even after as little as a year of constant use, the ability to handle high loads can easily be half or less of what it was when new.

      While a motherboard BIOS will take care of spinning up drives sequentially at boot, it won't help for suspend.
      So yes, having the ability to limit how much can be woken up at a time by the kernel would be beneficial.

  2. so how fast is fast..? by Anonymous Coward · · Score: 5, Interesting

    On my SandyBridge-era Thinkpad Edge, with:
    - one 7200rpm Hitachi drive from ~ 2011 and
    - one Intel SSD 525 from ~ 2013,
    Debian Testing/Sid with kernel 3.13-1-amd64 wakes up from RAM sleep in 1s or so, thus extremely covenient so I never shutdown/hibernate.. how much more improvement can you get?..

    1. Re:so how fast is fast..? by elal1862 · · Score: 3, Interesting

      Some perspective is needed here:
      We're talking about almost-a-decade-old hardware running a current linux version. Yet it's still fast enough to resume within 5 seconds, boot in 45 seconds, start libreoffice in 4 seconds, IOW: still quite usable
      My $200 says you can't run Mavericks on a (similar vintage!) PowerBook G4 with the same usability...

    2. Re:so how fast is fast..? by thegarbz · · Score: 2

      Think embedded. A device in complete sleep state can be powered for eons on a battery. Waking, doing whatever it needs to do and then going back to sleep waiting for the next interrupt is critical to battery life. In the micro-controller world the difference in battery life of 2 seconds of wake-up time can mean the difference between swapping out your batteries in a day or in a year. I have not very fond memories of counting how many cycles various assembly instructions will take to ensure the CPU on small micro controllers isn't awake for more than a few microseconds to meet some power requirements. The prospect of running a small linux machine the same way is quite interesting.

    3. Re:so how fast is fast..? by Trogre · · Score: 2

      A more useful metric, IMO, is how reliable the suspend/wakeup cycles are. For example, a particular Fedora 16 box I ran would suspend/resume with 100% reliability. That is, it would suspend every time you asked it to, and wake up every time you asked it to. Another Fedora 20 machine has 100% sleep and 0% wake. ie it goes to sleep and NEVER WAKES UP without a hard power cycle. Another machine had 100% sleep and about 75% wake, which is again utterly useless.

      --
      "Nine times out of ten, starting a fire is not the best way to solve the problem." - my wife
    4. Re:so how fast is fast..? by elal1862 · · Score: 2

      Hey, it's not my problem that Apple dropped PPC support with Snow Leopard *smirk*

    5. Re:so how fast is fast..? by Samizdata · · Score: 2

      Stop reminding me, you insensitive clod!

      --
      It's not the years, honey, it's the mileage. - Colonel Henry Walton Jones, Jr., Ph.D.
  3. not fast by lgalindo · · Score: 3, Insightful

    will be happy if it does it right ...

    1. Re:not fast by SuricouRaven · · Score: 3, Interesting

      And there lies the problem. Windows is very tolerant of badly-configured ACPI implimentations - it'll happily work even if half the configuration fields are wrong, as it simply ignores them and uses hard-coded suboptimal values. There's little incentive for OEMs to bother supporting any OS other than Windows, so typically once the firmware works for Windows it is considered good enough. All is well, until we stick linux on it - and linux then follows the ACPI specification correctly, and fails horribly.

    2. Re:not fast by YoopDaDum · · Score: 2

      The sloppiness in the PC ACPI world can also bite Windows too. You can find nice Asrock mini PCs based on laptop hardware. If you look at a Tom's hardware review of the Asrock VisionX 420, with a mobile core and mobile AMD GPU, you'll see that it consumes 28W at idle. This is crazy high for what's in effect a mobile laptop in small form factor box. One of the big reason is that the system ACPI says that PCIe ASPM (the low-power mode of PCIe) is not supported. Configuring laptop-mode on Linux and forcing ASPM results in idling at ~12.5W only, and a quieter box. Enabling ASPM in power saving mode alone saves ~8W, the rest is due to other suboptimal Windows defaults I guess.

      So IMHO the "let's do the minimum and ship" to save a buck approach of PC vendors hurts Windows and linux both. On the Windows side you'll usually get something considered good enough for its product class (here power was not considered as relevant for an HTPC it seems) but likely not optimal. On Linux you will get a mess by default because as you say vendors can't be bothered with it. But with some work you can actually get something quite good.

  4. It doesn't work at all. by Janek+Kozicki · · Score: 2

    What's the point if suspend resume doesn't work at all?

    Here's my SLEEP script, in which I am testing various kernels:

    #!/bin/bash

    logger "========== touch forcefsck ==========="
    # if resume failed, then I want fsck (SSD disks, so it's just few seconds)
    touch /forcefsck
    /bin/sync
    sleep 1

    logger "hibernating"
    # https://help.ubuntu.com/commun...
    # it says there to try hibernating using various different methods

    ### method: 1 kernel 3,13,0 - fail, (2/6 success rate)
    #/usr/sbin/hibernate

    ### method: 2 kernel 3,13,0 - fail, (3/6 success rate)
    #/usr/sbin/s2disk

    ### method: 3 kernel 3.13.0 - fail, (2/6 success rate)
    #echo platform > /sys/power/disk
    #echo disk > /sys/power/state

    ### method: 4 kernel 3.13.0 - (3/6 success rate)
    ### kernel 3.2.0 - 80% sukcesów 20% fail (over 80/100 success rate - currently in use)
    ### kernel 3.12-bpo - (0/1) success rate)
    echo shutdown > /sys/power/disk
    echo disk > /sys/power/state

    sleep 5
    logger "restart network"
    ## something screws networking after resume
    /etc/init.d/networking restart
    sleep 2

    ## also UPS connection is screwed (sometimes I need to disconnect and reconnect the USB cable)
    sleep 5
    /etc/init.d/nut-client stop
    sleep 5
    /etc/init.d/nut-server stop
    sleep 5
    /etc/init.d/nut-server start
    sleep 5
    /etc/init.d/nut-client start
    sleep 5
    # don't mess with clock /etc/init.d/ntp restart
    logger "resume complete"

    Besides, this is old news. Our new and better site beat slashdot: https://soylentnews.org/articl... . The only working kernel was 2.6.29 with tuxonice

    --
    #
    #\ @ ? Colonize Mars
    #
    1. Re:It doesn't work at all. by jones_supa · · Score: 2

      Sorry to hear about that. Probably a good idea to file a bug report at https://bugzilla.kernel.org/ (if you didn't already).

  5. I'd rather have "easier to debug" by Cley+Faye · · Score: 2

    My main issue with suspend with my laptop is that it never wake up. Now it can be faster at not waking up, wow.
    I'd rather have a way to generate log and find the issue relatively easily.

  6. Coupled with systemd and LinuxBios by Antique+Geekmeister · · Score: 2

    There are quite a few things that slow booting systems. Systemd is _supposed_ to take a lot of the slow, sequential starup out of the actual system daemons: it will be a while before it's really working well for critical, production systems, but that can take minutes off of startup time in a large environment. Note, also, that much of its "startup advantage" is illusory. Daemons are told to start up, and systemd keeps them starting up, but they're not necessarily available for quite some time after startup. This especially applies to databases and bulky Java applications.

    The kernel startup is another big factor. Scanning for, assessing, and activating drivers for all the potentially available hardware is a slow and painful process because the upstream specifications are poorly documented, and even violated by many vendors. Many of them are legacy drivers and could in theory be discarded in most production kernels, but doing so can be quite tricky and hard to test for enough strange configuration cases.

    The third big software factor is the BIOS. "coreboot", formerly "LinuxBIOS", is blazingly fast compared to most proprietary BIOS's. It has made some inroads but is still not available for any commercial systems I can find. So no matter what is done in the other two factors, the BIOS is still a limiting factor of suspend and restore delays.

    1. Re:Coupled with systemd and LinuxBios by whoever57 · · Score: 2

      Systemd is _supposed_ to take a lot of the slow, sequential starup out of the actual system daemons:

      So is OpenRC.

      --
      The real "Libtards" are the Libertarians!
    2. Re:Coupled with systemd and LinuxBios by evilviper · · Score: 3, Informative

      The third big software factor is the BIOS. "coreboot", formerly "LinuxBIOS", is blazingly fast compared to most proprietary BIOS's. It has made some inroads but is still not available for any commercial systems I can find. So no matter what is done in the other two factors, the BIOS is still a limiting factor of suspend and restore delays.

      POST has to be performed by the BIOS when restoring from hibernation, but NOT suspend. So no, the BIOS is NOT a significant "limiting factor of suspend and [resume]" operations.

      --
      Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
  7. Who cares? by Antonovich · · Score: 2

    Tell me when they can make my laptop last for more than an hour without mains and I'll be happy. I need to upgrade but battery life under Linux is so woeful I can't justify spending the ridiculous prices they are asking these days. To get a similar laptop to the 3 yr old one I have (at least in terms of size, weight, memory and disk) I would have to spend the same amount today as back then. Where is Moore's law again? Even though I can't afford one, I was looking at the Dell XPS 13 but for a couple of hundred more (for similar specs) I could get a macbook air and have *double* the battery life with osx. I would even consider it if I could run Linux on it and get similar battery life to osx... But alas, I read it sucks just as much as on all other machines.

  8. Does it fix this issue? by tdelaney · · Score: 2

    https://github.com/OpenELEC/Op...

    Just determined in the last week to be due to async suspend/resume. From the various reports, oretty much all Intel hardware is affected.

  9. In other news... by mugurel · · Score: 5, Funny

    Linus Torvalds is now said to suspend (but not resume) key linux developers up to 10 times faster.

  10. parallelism by lkcl · · Score: 3, Interesting

    .... um, it's 2014, the linux kernel is a critical part of the planet's internet infrastructure, is used in TVs, routers and phones all over the world, and you're *seriously* telling me that its internals aren't fully parallelised? i thought the linux kernel was supposed to be a leading example of modern operating system design and engineering.

    1. Re:parallelism by epyT-R · · Score: 2

      You're assuming a lot there. How would you know if osx or windows NT kernels are 'fully parallelized'? Have you seen the source?

  11. WTF slashdot by Anonymous Coward · · Score: 2, Informative

    I'm in beta and I click classic which is on top it gets me to classic, hit the comments link and brings me back to beta and this is in a fucking loop. Stupid assholes, a website should be about the content itself not the bullshit eye candy which is taking space anyway. FUCKING RETARDS!!!

    1. Re:WTF slashdot by Janek+Kozicki · · Score: 3, Informative

      Just go to a new and better site: http://soylentnews.org/

      --
      #
      #\ @ ? Colonize Mars
      #