Upload
emma-macgregor
View
218
Download
3
Tags:
Embed Size (px)
Citation preview
Fast boot and Fast boot and suspend/resumesuspend/resume
Zhang RuiZhang [email protected]@intel.com
Beijing October 18Beijing October 18thth 2008 2008
2
AgendaAgenda Fast bootFast boot
– Current State of the Art Current State of the Art
– Splash ScreensSplash Screens
– Budget & Resource SchedulingBudget & Resource Scheduling
– KernelKernel
– Early UserspaceEarly Userspace
– X.orgX.org
Fast suspend/resumeFast suspend/resume– Driver optimizationDriver optimization
– Device asynchronous resumeDevice asynchronous resume
–More aggressive attemptsMore aggressive attempts
3
Current state Current state
boot to be completely done in 5 secondsboot to be completely done in 5 seconds
4
We hate splash screensWe hate splash screensBy the time you see it.... we want to be done!By the time you see it.... we want to be done!
23/4/104
Splash screens
5
Time budgets, Resource Time budgets, Resource schedulingscheduling
boot to be completely done in 5 secondsboot to be completely done in 5 seconds
ComponentComponent Allocated timeAllocated time
KernelKernel 1 second1 second
Early bootEarly boot 1 second1 second
XX 1 second1 second
GUI/DesktopGUI/Desktop 2 seconds2 seconds
6
sReadAheadsReadAhead read used portions of files in read used portions of files in
"use order" as early as possible "use order" as early as possible to prime the pagecacheto prime the pagecache
"idle" IO scheduler class"idle" IO scheduler class
7
KernelKernelBudget: 1 secondBudget: 1 second All system components built into the All system components built into the
kernel imagekernel image
–Modules are slow, synchronous, and not Modules are slow, synchronous, and not needed for core componentsneeded for core components
No initrdNo initrd
–All key drivers are in the kernelAll key drivers are in the kernel
– /dev is populated with the fixed device /dev is populated with the fixed device nodesnodes
– initrd management just plain takes too initrd management just plain takes too longlong
8
KernelKernelBudget: 1 secondBudget: 1 second Asynchronous initialization of non-Asynchronous initialization of non-
essential components with a new, essential components with a new, asynchronous initcall asynchronous initcall levellevel
Reference: Reference: git://git.kernel.org/pub/scm/linux/kernel/git/arjan/linux-git://git.kernel.org/pub/scm/linux/kernel/git/arjan/linux-2.6-fastboot.git2.6-fastboot.git
9
Early boot / InitEarly boot / InitBudget: 1 secondBudget: 1 second sysvinitsysvinit, not , not upstartupstart: :
Asynchronous, not ParallelAsynchronous, not Parallel UdevUdev–Persistent /dev reduces overhead Persistent /dev reduces overhead
enormouslyenormously
10
Early boot / InitEarly boot / InitBudget: 1 secondBudget: 1 second Asynchronous for non-critical path
11
X.orgX.orgBudget: 1 secondBudget: 1 second xorg-x11-drv-intel driverxorg-x11-drv-intel driver–Program everything during probingProgram everything during probing– ... then restore it to standard... then restore it to standard– ... then program it again for final use... then program it again for final use–Various "extra" delays trimmed (after Various "extra" delays trimmed (after
fixing PCI posting bugs)fixing PCI posting bugs) XKBXKB–Calling CPP ??? <explicit language Calling CPP ??? <explicit language
removed>removed>–Caching the result – Compute once, use Caching the result – Compute once, use
foreverforever
12
13
Fast suspend/resumeFast suspend/resume Not as complex as fast bootNot as complex as fast boot–BIOS + kernel + X/applicationBIOS + kernel + X/application
–No critical disk I/O requestNo critical disk I/O request
Time budgetTime budget–Resume Kernel + X/application in 1 Resume Kernel + X/application in 1
secondsecond
14
Driver optimizationDriver optimization non-critical work can be non-critical work can be
deferred during device resumedeferred during device resume–SerioSerio– offload resume to kseriodoffload resume to kseriod
Fix driver poor/wrong behaviorFix driver poor/wrong behavior–AHCIAHCI– HBA reset speed upHBA reset speed up
15
Device asynchronous resumeDevice asynchronous resume Resume devices asynchronouslyResume devices asynchronously Sync before resume Sync before resume
X/applicationsX/applications
X/app
SCSI
ACPI
USB
…
… ACPI … ……SCSI USB X/app
16
More aggressive attemptsMore aggressive attempts Device deferred resume instead Device deferred resume instead
of asynchronous resumeof asynchronous resume–don’t sync before resuming don’t sync before resuming
X/applicationsX/applications
–Screen is back before all the devices are Screen is back before all the devices are resumedresumed–works but may bring potential risksworks but may bring potential risks
X/app
SCSI
ACPI
USB
…
17
More aggressive attemptsMore aggressive attempts Resume X with the highest Resume X with the highest
prioritiespriorities–Resume drm driver first to light the Resume drm driver first to light the
screenscreen
–Resume X process before the other Resume X process before the other kernel driverskernel drivers
–Works but not for upstream yetWorks but not for upstream yet
18
S3 resume time MoblinS3 resume time Moblin
BIOS kernel X/app.
1.65s 0.25s0.20s
1.65s 0.25s 0.36s
1.65s 1.19s 0.36s
1.65s 1.78s 0.37sCurrent state
Asynchronous resume
deferred resume
resume X first
19
TODOTODO push “deferred resume” push “deferred resume”
mechanism upstreammechanism upstream Fast suspendFast suspend Fast shutdownFast shutdown
20
Acknowledgements Arjan van de Ven Auke Kok Li, Shaohua Zhao Yakui
21