News for hackers. Stuff that matters.
Re:Booting Linux in One Second [pdf] by amelius on Wednesday November 25, 2015 @04:34AM (#10626289)
An OS is recomputing the same functions over and over again when booting, so why not cache all of this, and make it instant?
Re:Booting Linux in One Second [pdf] by psi-squared on Wednesday November 25, 2015 @04:59AM (#10626359)
How much do you cache? Hardware is difficult because you could add/remove/swap it at any time, and software information is already partly cached depending on your OS.

IIRC, Windows a) builds a list of files to pre-load from disk based on your usage, and b) doesn't actually fully shut down by default (it goes to hibernate mode: http://blogs.msdn.com/b/olivnie/archive/2012/12/14/windows-8...). I don't know if any Linux distros do either of those by default, but it is certainly possible.

Also, some BIOSes already have a "quick boot" setting which caches some hardware information, particularly about memory. It usually comes with a warning that you need to disable the setting for at least one boot when installing RAM.

Re:Booting Linux in One Second [pdf] by cm2187 on Wednesday November 25, 2015 @06:21AM (#10626621)
But an embedded system wouldn't change between two reboots.
Re:Booting Linux in One Second [pdf] by i336_ on Wednesday November 25, 2015 @04:59AM (#10626360)
Hardware requires specific handshaking to get it to initialize, the kernel cannot assume that the hardware that was present last time is available this time, and orchestrating everything is not an easy process.

The holy grail would be a kernel organized and designed to cache everything to disk related to its own configuration, and only re-execute/rerun the hardware reinitialization code.

Admittedly, Windows' current approach to bootup is very close: it closes all applications then pseudo-hibernates the kernel. Bootup simply reads the hibernated kernel state from disk and reloads userspace.

This is of course besides traditional full ACPI hibernation, which is pretty cool but isn't a perfect art. (I'm typing this on a ThinkPad T23, a fairly old (and thus well-tested) hardware configuration; its hibernation/resume is usually rock-solid, but this morning my WLAN decided to get all stupid with dhcpcd, and USB decided that while it could see my external HDD, there wasn't a disk inside it. From-scratch boot is still the only way to get a reasonably predictable system state.)

Re:Booting Linux in One Second [pdf] by rejschaap on Wednesday November 25, 2015 @05:42AM (#10626512)
The biggest problem with caching things during the boot process is that turning our devices off and on again will not magically solve our problems any more.
Re:Booting Linux in One Second [pdf] by i1281159 on Wednesday November 25, 2015 @01:23PM (#10628652)
That's why there's always a seperate reboot option which tells the fairy to do her job.
Re:Booting Linux in One Second [pdf] by caf on Wednesday November 25, 2015 @04:47AM (#10626324)
I think you'll find that boot time is entirely dominated by time waiting for hardware devices to do various things rather than CPU bound.
Re:Booting Linux in One Second [pdf] by creshal on Wednesday November 25, 2015 @04:46AM (#10626319)
Also known as "suspend to disk"?
Re:Booting Linux in One Second [pdf] by akie on Wednesday November 25, 2015 @05:21AM (#10626443)
After which you'd have to load 8Gb from disk/SSD in under 1 second...
Re:Booting Linux in One Second [pdf] by vidarh on Wednesday November 25, 2015 @06:14AM (#10626608)
No, you don't. You need to load kernel space, and then demand page in the rest as it's being accessed.
Re:Booting Linux in One Second [pdf] by kalleboo on Wednesday November 25, 2015 @05:47AM (#10626527)
I wonder if there are any disk suspend systems that are smart enough to tie into the VM system... instead of a specific monolithic RAM-sized suspend file, just flush everything to virtual memory on suspend, and on awake only restore the minimum needed for the OS and accounting, then start swapping everything else in lazily as the user needs it (or in advance in the background if the user is idle)
Re:Booting Linux in One Second [pdf] by bnegreve on Wednesday November 25, 2015 @06:14AM (#10626609)
Given that the disk is several orders of magnitude slower that the RAM, lazily re-loading pages from the disk to the memory can induce very visible and annoying loading delays everywhere (e.g. change tab in browser takes 3 sec).

I'd rather wait 10 extra second than having a slow computer for the next 10 minutes.

Re:Booting Linux in One Second [pdf] by vidarh on Wednesday November 25, 2015 @06:32AM (#10626658)
Or you could go for the hybrid, of having 10 seconds of reduced performance while the system keeps aggressively loading pages.
Re:Booting Linux in One Second [pdf] by fulafel on Wednesday November 25, 2015 @06:56AM (#10626734)
Linux does approximately this.
Re:Booting Linux in One Second [pdf] by jmtd on Wednesday November 25, 2015 @05:39AM (#10626499)
If you need 8G of resident memory to have the apps you want running then you need 8G... no shortcuts. That is a pretty high figure, though. Afaik things like disk caches aren't restored during a suspend/resume.
Re:Booting Linux in One Second [pdf] by blab3 on Wednesday November 25, 2015 @04:56AM (#10626348)
Maybe something has changed since last boot.

In the embedded hardware environment if something has changed and if this change is out of specs, then what you say can be adopted.

Re:Booting Linux in One Second [pdf] by voltagex_ on Wednesday November 25, 2015 @08:01AM (#10626940)
Isn't that what hibernate / suspend / hybrid sleep is?