you missed the fit that Linus threw in the last couple of weeks about the suspend process.
it's not merging tux on ice (I'm not sure that's a good thing anyway), but it is yet another case of him pointing out that this is not as complicated as it is being made out to be. If he does this enough something will snap (which may be Linus writing his own suspend code and merging it as on option, such things have happened before)
Posted Dec 16, 2009 3:01 UTC (Wed) by bojan (subscriber, #14302)
[Link]
The main point being the fact that people have argued _years_ ago that TuxOnIce should be merged (which was and still is a superior implementation), which would give us _better_ suspend/resume and hibernate/thaw then. And we wouldn't have to suffer through current blank-screen/slow/pick-up-app-memory-from-swap thing for all these years.
I'll also bet $5 that the whole thing would have been improved faster, had Linus decided to involve Nigel directly, by merging TuxOnIce.
Instead we have the uswsusp kludge (1000 moving parts or something?) and the old, slow and ugly swsusp. I hope Linus really gets annoyed one of these days :-)
The abrupt merging of...
Posted Dec 16, 2009 5:16 UTC (Wed) by cventers (subscriber, #31465)
[Link]
Somebody should give Linus a computer he thinks is neat but that fails horribly under the existing suspend code.
The abrupt merging of...
Posted Dec 16, 2009 6:56 UTC (Wed) by bojan (subscriber, #14302)
[Link]
Or, force him to do a quick and slick presentation in front of a lot of (to him) important people, using many apps with lots of state, after he arrived by plane that afternoon. Having a machine that can reliably, quickly and beautifully thaw and get into all the apps, while experiencing no lag due to page faults, would be a definite advantage :-)
The abrupt merging of...
Posted Dec 16, 2009 9:32 UTC (Wed) by michaeljt (subscriber, #39183)
[Link]
That gives me a chance to ask a really naive question I've been saving up :) What is so difficult
about doing suspend? Why is there more to suspend to RAM than just turning every piece of
hardware that you know that you reliably can to the lowest power setting that you know how to,
and if there is too much hardware that you don't know you can reliably suspend, just failing? Or
does the problem lie in deciding where a given piece of hardware lies? Or is it religious reasons of
wanting to use BIOS ACPI code at all costs?
For suspend to disk, I can see the difficulties - taking a clean snapshot of user space, where you
may have things like the X server doing things that user space shouldn't normally do, remembering
current kernel state and reconstructing it on next boot.
The abrupt merging of...
Posted Dec 16, 2009 10:46 UTC (Wed) by rsidd (subscriber, #2582)
[Link]
What you describe would not save much power I think. Switch off LCD, spin down disk, reduce CPU to lowest state, power down what peripherals you can -- would at most double your battery life. A suspended laptop can go days before it drains. And suspend-to-RAM works well on most laptops these days. Suspend-to-disk is the problem and it is what tuxonice is about.
On my current machine, suspend-to-RAM is all I need. Though suspend-to-disk (uswsusp, not tuxonice) works too.
The abrupt merging of...
Posted Dec 16, 2009 11:03 UTC (Wed) by michaeljt (subscriber, #39183)
[Link]
What is missing then that is drawing power? (Obviously I realise something must be, or people
would already be doing what I said...)
The abrupt merging of...
Posted Dec 16, 2009 13:33 UTC (Wed) by Cyberax (✭ supporter ✭, #52523)
[Link]
DRAM refresh and CPU, mostly.
The abrupt merging of...
Posted Dec 16, 2009 13:47 UTC (Wed) by michaeljt (subscriber, #39183)
[Link]
And are those components not sufficiently well known, or not sufficiently well identifiable (I know
that the last doesn't apply to the CPU, but I don't know much about DRAM) that this can't be done
by driver code without reading ACPI information?
The abrupt merging of...
Posted Dec 16, 2009 14:53 UTC (Wed) by mjg59 (subscriber, #23239)
[Link]
Suspending the CPU means that when power is reapplied it'll jump to its default start address. The
kernel can't put code there, so performing suspend to RAM on commodity x86 without firmware
assistance is impossible.
The abrupt merging of...
Posted Dec 17, 2009 18:39 UTC (Thu) by michaeljt (subscriber, #39183)
[Link]
> Suspending the CPU means that when power is reapplied it'll jump to its default start address.
> The kernel can't put code there, so performing suspend to RAM on commodity x86 without
> firmware assistance is impossible.
Is there really no known way to do this without assistance from the ACPI BIOS? I'm no expert, but
my understanding was that DOS extenders did this all the time to switch from protected back to
real mode at a time when there was no ACPI.
The abrupt merging of...
Posted Dec 17, 2009 18:49 UTC (Thu) by mjg59 (subscriber, #23239)
[Link]
In S3, the processor has no stored state. "Resume" is equivalent to the machine being turned on
from scratch as far as it's concerned. It's up to the BIOS to check a flag to determine whether it's a
cold power on or a resume.
Performing a full resume cycle is hard. You need to reprogram the memory controller, bring the
embedded controller up, dump values back into the thermal monitoring hardware and any number
of low-level initialisations. Only once that's been done does control get passed back to the OS,
which has absolutely no idea how any of that hardware works.
The abrupt merging of...
Posted Dec 16, 2009 11:59 UTC (Wed) by nhippi (subscriber, #34640)
[Link]
> Why is there more to suspend to RAM than just turning every piece of
> hardware that you know that you reliably can to the lowest power setting
> that you know how to
And that is how things are done in ARM land. Some machines go even further
and power on hardware only when they are under use, rather than only
powering them down on explicit "suspend" event.
> and if there is too much hardware that you don't know you can reliably
> suspend, just failing? Or is it religious reasons of wanting to use BIOS
> ACPI code at all costs?
Using VGA bios for display adapters was kinda mandatory before Kernel
Modesetting. I believe on X86 it is kinda tricky to suspend some devices
using ACPI BIOS and others from kernel drivers. To efficiently use driver-
based suspend the ACPI usage should be stopped completely.
The abrupt merging of...
Posted Dec 16, 2009 20:42 UTC (Wed) by mgedmin (subscriber, #34497)
[Link]
You also have to suspend everything in the right order (e.g. suspend USB
devices before you suspend the USB controller). And you have to make sure
userspace processes won't be trying to wake devices up behind your back.
IIRC Matthew Garrett had a very nice explanation on his blog, but I cannot
find it at the moment.