16 ms·
Booting Linux in One Second [pdf]
- dharma1 11y agoWas looking to boot to Qt under a couple of seconds for a camera use case a few months back, and came across similar demos. Can work well for very specific applications/products. Here's a video of a talk by the author of this particular pdf https://www.youtube.com/watch?v=KTRA1PRJWH8 https://www.youtube.com/watch?v=KTRA1PRJWH8 Will be interesting to see what impact Intel's 3D Xpoint will have on boot times too.
- amelius 11y agoAn OS is recomputing the same functions over and over again when booting, so why not cache all of this, and make it instant?
- creshal 11y agoAlso known as "suspend to disk"?
- akie 11y agoAfter which you'd have to load 8Gb from disk/SSD in under 1 second...
- jmtd 11y agoIf 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.
- kalleboo 11y agoI 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)
- bnegreve 11y agoGiven 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.
- vidarh 11y agoOr you could go for the hybrid, of having 10 seconds of reduced performance while the system keeps aggressively loading pages.
- fulafel 11y agoLinux does approximately this.
- vidarh 11y agoNo, you don't. You need to load kernel space, and then demand page in the rest as it's being accessed.
- caf 11y agoI think you'll find that boot time is entirely dominated by time waiting for hardware devices to do various things rather than CPU bound.
- blab3 11y agoMaybe 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.
- psi-squared 11y agoHow 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-fast-boot.aspx 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.
- cm2187 11y agoBut an embedded system wouldn't change between two reboots.
- i336_ 11y agoHardware 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.)
- rejschaap 11y agoThe 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.
- i1281159 11y agoThat's why there's always a seperate reboot option which tells the fairy to do her job.
- voltagex_ 11y agoIsn't that what hibernate / suspend / hybrid sleep is?
- nileshtrivedi 11y agoLinux can be so amazing when configured especially for some tasks. For example, Jack on linux can deliver audio latencies under 2ms! The problem is that configuring Linux like this almost requires a CS degree.
- i336_ 11y agoI once had a brief conversation (via Reddit) with a guy using JACK for a commercial (embedded Linux) networked audio system. I wasn't aware of the exact specifics but I understand it was Sonos-style, embedded boards inside speakers. He wasn't particularly interested in talking about the work his team had done :P I think that proves your point.
- golergka 11y ago> He wasn't particularly interested in talking about the work his team had done :P As in, he tried to keep the secrets secret, or it seemed to be trivial and uninteresting to him?
- anentropic 11y agomore likely the former
- cpach 11y agoThis is a quite paradoxal phenomen that happens to some open source projects. The code is open and free, but some of the experts hold their knowledge very close to their chest. It's totally understandable since they of course need to make a living somehow, but it kind of defeats some of the benefits with open source.
- eitland 11y agoRoughly speaking it levels the playing field. With Open Source smart people and companies that attract smart people get an edge.
- i336_ 11y agoHere's another example of the same sort of idea: http://elinux.org/images/f/f7/RightApproachMinimalBootTimes.pdf http://elinux.org/images/f/f7/RightApproachMinimalBootTimes.... Also under 1 second, and the approaches this guy took are seriously impressive. Lots of educational tidbits and "good-to-know"s in here even for non-embedded types. Reads very quickly too.
- ww520 11y agoThat's very impressive. Great for embedded devices, where the hardware profile doesn't change from boot to boot.
- legulere 11y ago1 seconds seems a rather arbitrary measure. In HCI 100ms seems to be the value that's generally taken under which an action seems to be happening instantaneously [1] It's quite sad to see how we hardly use the computing power offered by our modern computers to actually speed up common tasks, but instead bloat it up with all kinds of stuff. [1] http://cogsci.stackexchange.com/questions/1664/what-is-the-threshold-where-actions-are-perceived-as-instant http://cogsci.stackexchange.com/questions/1664/what-is-the-t...
- cm2187 11y agoBut 1s is sufficiently small so that you don't notice that the system is loading between the time you switch on the engine of a car and the time you start using it.
- sharpneli 11y agoI completely agree with the general idea. Bloat is too high and has far reaching consequences. And it's actually even worse than that. 100ms is nowhere near enough to be sufficient for all applications. For audio applications you need 10ms [http://superpowered.com/androidaudiopathlatency http://superpowered.com/androidaudiopathlatency] which incidentally is the reason why Android is unusable for any interactive audio applications. Same applies to Virtual Reality. You need sub 20ms latency for head tracking to eyes latency or you will feel sick (effectively less than 10ms from the cpu side. Display scanning is summed on top). The 100ms figure applies mostly to traditional UI workflow. Whenever you need a realtime interaction that's 10x too high.
- jahnu 11y ago> which incidentally is the reason why Android is unusable for any interactive audio applications. Everybody says this and yet programs like Caustic seem to do a fine job in my experience.
- hrnnnnnn 11y agoHave you tried performing using an android app? I used a drum-pad app the other week and the latency makes it unplayable. There's a great explanation here as to why it's so bad: http://superpowered.com/androidaudiopathlatency http://superpowered.com/androidaudiopathlatency
- smcl 11y agoHere's a video the same talk by the author - https://www.youtube.com/watch?v=KTRA1PRJWH8 https://www.youtube.com/watch?v=KTRA1PRJWH8
- listic 11y agoWhy isn't any phone doing it? (either smart or feature variety)
- kalleboo 11y agoProbably because phones are rebooted so rarely - it only happens on an OS update or if your battery runs out.
- currysausage 11y agoWith my Nexus 4, rebooting every other day is a pretty good idea. Usually fixes my Wi-Fi, 3G, and all sorts of weird bugs for the moment. Don't know how representative this is for Android phones in general, but most Nexus 4 owners I know tell me this is normal. Oh, usually once a week, sometimes twice a day, the phone will do the rebooting for me. Sometimes when it's in my pocket, sometimes when I try to watch a video that's just too long. Maybe some kind kind of memory error?
- badpenny 11y agoI used to have a Nexus 4 and had the same problem. I now have a Samsung Galaxy S3 and still have the same kinds of issues, just not as frequently. From what I've heard from other people I think it's fair to say it's a general problem with Android-based smart phones.
- cpach 11y agoI reboot my iPhone 5s every two or four weeks or so. Sometimes that just the easiest way to deal with some bugs (e.g. Airplay issues). Since it happens so infrequently I don't really mind the boot times that much. But all else being equal, of course faster is better than slow :)
- zyrthofar 11y agoI have a Galaxy S3, and it was rebooting randomly more and more often. At the time, I lived in an apartment. I bought a house earlier this year, and to my knowledge (and memory) this hasn't happened again since. What you said reminded me of this, because I had forgotten this infuriating rebooting. I wonder if this was related to the building or something else? This is weird.
- estomagordo 11y agoHas anyone booted the pdf in a minute?
- weland 11y agoIf you use an actual pdf reader instead of the JS-based in-browser crap, it's quite instantaneous.
- johansch 11y agoBut javascript is so cool! https://bugzilla.mozilla.org/show_bug.cgi?id=1049218 https://bugzilla.mozilla.org/show_bug.cgi?id=1049218
- robin_reala 11y agoJS is also sandboxed, which seems to be a particular problem for traditional readers. I’d trust PDF.JS to get faster more than I trust PDFium to not have security issues.
- nickpsecurity 11y agoYeah, that's what I've been having to do on a lot of things lately. I told them what would happen when they first started pushing it. Looked at the person next to me to say, with all the things Win98 on a PII did, the modern era chokes a Core Duo 2 trying to look at a document in a browser. Unreal...
- Drdrdrq 11y agoInteresting - in my experience pdf.js is faster than adobe reader... Didn't measure it though.
- pass-word 11y agofsk
- daw___ 11y agoand you signed up to say this?
- PinguTS 11y agoPresented by Montavista already in 2009: https://youtu.be/-l_DSZe8_F8 https://youtu.be/-l_DSZe8_F8 There is also some documentation from Montavista from that time. EDIT: The presentation by Montavista from 2008: http://www.freescale.com/files/training_pdf/VFTF09_MONTAVISTA_LINUXBOOT.pdf?lang_cd=en http://www.freescale.com/files/training_pdf/VFTF09_MONTAVIST...
- nickpsecurity 11y agoAnd QNX before that. But, that's a well-engineered, UNIX-like microkernel rather than Linux. Oh well...
- dman 11y agoQNX was open source for a while, what is surprising is that there doesnt appear to be an easily searcable version of the code available on google.
- nickpsecurity 11y agoThat was a bait and switch by management that I could tell. They got a bunch of contributions from the community then pulled it. Or just felt that it wasn't worthwhile after little contributions. I can't be sure. Nonetheless, underlying technology is solid with that showing in Blackberry Playbook.
- dman 11y agoI regret not downloading the source code while it was available.
- nickpsecurity 11y agoI lost my copy. Regrets here, too. Minix 3 is fortunately coming along nicely and already resilient against driver faults.
- 11y ago
- csn 11y agoPeople are OK with frequently booting their mobile devices to temporarily "fix bugs", which can take up to tens of seconds, but waiting a moment to boot a desktop device? Nuh uh. Of course there might be some market advantage to be had with faster booting and it's a plus for the whole UX. And optimisation is definitely cool, though I think many more problems would be solved if people were forced to think once in a while, whether it's while waiting for the bootup sequence to complete or a train to arrive.
- Gys 11y agoThe problem with a desktop is that most people have at least one and mostly several applications running. Those need maybe saving as well, before quitting. The mobile phones are better in that way: all apps are required to save their state at any time. So rebooting can be a mindless procedure.
- geon 11y agoWho is OK with frequently booting their phone? I know I wouldn't be.
- xanderstrike 11y agoSeems like this is more about car computers, embedded systems, and replacing "suspend" than just improving the desktop experience. The slowest booting machine I own is my windows Steambox, and it's still faster to boot than my TV or receiver (5-10 seconds) just by virtue of having an SSD.
- asah 11y agoWhat about shutdown time? (the steady state is that computers are running, so if it takes 30sec to cleanly shutdown then your cycle time is 31secs... obviously, this doesn't apply to stateless servers or that use write-through caching...)
- cnvogel 11y agoThe kind of device this kind of optimization applies to typically runs with readonly flash, maybe only writing some config rarely... So, just pull the plug.
- digi_owl 11y agoHad to once more flog systemd as it that is the only fast alternative to systemv...
- vessenes 11y ago[deleted]
- titomc 11y agoOur team was working on a vehicle telmatics platform ( connected cars ). We had a requirement in which the remote engine start time should be within 15 seconds from the time the customer clicked the start button on his phone. For this the QNX running in the vehicle had a fastboot mode , which came up within that timeframe , brought up the interfaces & established network connection to our server and started the car. Once the car is started , the system will go down and come back up in normal boot. Now I know !