boot time: benefits & drawbacks of linux sleep and hibernate · easier to maintain than custom...

19
Boot Time: benefits & drawbacks of Linux sleep and hibernate Tom Dohmen Logic Technology BV 1

Upload: others

Post on 17-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Boot Time: benefits & drawbacks of Linux sleep and hibernate · Easier to maintain than custom tuning Consistently fast at any size e Memory size Hibernation method Because of monolithic

Boot Time: benefits & drawbacks of Linux sleep

and hibernate

Tom Dohmen

Logic Technology BV

1

Page 2: Boot Time: benefits & drawbacks of Linux sleep and hibernate · Easier to maintain than custom tuning Consistently fast at any size e Memory size Hibernation method Because of monolithic

Logic Technology BV 2

○ Founded in 1993 – 25 years of Logic Solutions!

○ Located in Panningen (The Netherlands)

○ Strong position in Europe

○ Product Manager and European Sales Partner for

Page 3: Boot Time: benefits & drawbacks of Linux sleep and hibernate · Easier to maintain than custom tuning Consistently fast at any size e Memory size Hibernation method Because of monolithic

Introduction

○ Instant-on experience desired

○ Linux longer boot than RTOS

• Android longer than stock Linux

○ Google targets faster boot time with Oreo

○ Application on top

3

Page 4: Boot Time: benefits & drawbacks of Linux sleep and hibernate · Easier to maintain than custom tuning Consistently fast at any size e Memory size Hibernation method Because of monolithic

Description of the boot process

○ Device must go through a series of stages

○ People focusing on reducing startup time

• Hardware and kernel get most attention

4

Page 5: Boot Time: benefits & drawbacks of Linux sleep and hibernate · Easier to maintain than custom tuning Consistently fast at any size e Memory size Hibernation method Because of monolithic

Techniques to identify problems

○ Hardware and kernel through bootgraph.pl

○ NAND startup particularly pernicious

○ Cost of maintaining kernel changes

5

Page 6: Boot Time: benefits & drawbacks of Linux sleep and hibernate · Easier to maintain than custom tuning Consistently fast at any size e Memory size Hibernation method Because of monolithic

Application adds to the problem

○ Application must start up;

○ Before that, the environment;

• Database common in Android.

○ Graphics libraries and external communications.

6

Page 7: Boot Time: benefits & drawbacks of Linux sleep and hibernate · Easier to maintain than custom tuning Consistently fast at any size e Memory size Hibernation method Because of monolithic

Virtual Machines - and snapshots

○ Suspended application – called snapshot

○ Virtual machine - simulated processor and hardware

○ Embedded designs don’t have total control

7

Page 8: Boot Time: benefits & drawbacks of Linux sleep and hibernate · Easier to maintain than custom tuning Consistently fast at any size e Memory size Hibernation method Because of monolithic

Startup draws power

○ Power drain at start time:

• Screen on (status update)

• Reading from the media

• Environment and application

8

Page 9: Boot Time: benefits & drawbacks of Linux sleep and hibernate · Easier to maintain than custom tuning Consistently fast at any size e Memory size Hibernation method Because of monolithic

Sleep mode uses less, but not zero, power

○ Processor suspended

○ Requires constant power (DRAM refresh)

○ Some indication (heartbeat)

○ Power lost = data lost

9

Page 10: Boot Time: benefits & drawbacks of Linux sleep and hibernate · Easier to maintain than custom tuning Consistently fast at any size e Memory size Hibernation method Because of monolithic

Hibernation

○ Commits all of DRAM to media

○ Suspend operation needs to be power safe

○ Suspend and resume can take time

○ Application and drivers must support hibernation

○ Power can be completely off

10

Page 11: Boot Time: benefits & drawbacks of Linux sleep and hibernate · Easier to maintain than custom tuning Consistently fast at any size e Memory size Hibernation method Because of monolithic

Restoring from hibernation

○ Quicker than a full cold boot

○ Require support in BSP and drivers

○ Amount of data a disadvantage

○ Additional time for commit and restore

11

Page 12: Boot Time: benefits & drawbacks of Linux sleep and hibernate · Easier to maintain than custom tuning Consistently fast at any size e Memory size Hibernation method Because of monolithic

Improving hibernation

○ Skip unused portions of DRAM

○ Restore will allocate and blank

○ Reduces I/O requirements

○ Requires knowledge of drivers and kernel

12

Page 13: Boot Time: benefits & drawbacks of Linux sleep and hibernate · Easier to maintain than custom tuning Consistently fast at any size e Memory size Hibernation method Because of monolithic

Further improvements

○ Programs highly compressible

○ Further reduces I/O requirements

13

Page 14: Boot Time: benefits & drawbacks of Linux sleep and hibernate · Easier to maintain than custom tuning Consistently fast at any size e Memory size Hibernation method Because of monolithic

Restoring from advanced hibernation

○ Prioritize load process

○ Ready for input achieved earlier

○ Fastest result from a complete powered off state

14

Page 15: Boot Time: benefits & drawbacks of Linux sleep and hibernate · Easier to maintain than custom tuning Consistently fast at any size e Memory size Hibernation method Because of monolithic

Remove time to suspend application

○ Same restoration each time

○ Use a factory image

○ Can be enhanced to read some configuration

○ Ideal for an appliance

15

Page 16: Boot Time: benefits & drawbacks of Linux sleep and hibernate · Easier to maintain than custom tuning Consistently fast at any size e Memory size Hibernation method Because of monolithic

Fastest time to application-ready for embedded Linux systems

System Configuration

NXP iMX6DL SabreSDP; OS: Linux 4.1.15 with Wayland Desktop

Initialized devices: IOMUX/GPIO, UART, I2C, eMMC (SD Card), USB HOST, Ethernet, LCD (TouchPanel), HDMI, Audio

Snapshot image size: 144 MB (compressed); 221.5 MB (uncompressed)

16

Page 17: Boot Time: benefits & drawbacks of Linux sleep and hibernate · Easier to maintain than custom tuning Consistently fast at any size e Memory size Hibernation method Because of monolithic

Conclusion 17

○ Moving to Linux/Android from RTOS or bare metal negatively impacts first impressions

○ Hibernation offers nearly instant-on with minimal power impact

○ Techniques to speed up hibernation available to further shorten time to application ready!

Page 18: Boot Time: benefits & drawbacks of Linux sleep and hibernate · Easier to maintain than custom tuning Consistently fast at any size e Memory size Hibernation method Because of monolithic

Boot time solution from Datalight called NitroBoot

○ Faster time-to-first-response

○ Easier to maintain than custom tuning

○ Consistently fast at any size

Bo

ot

tim

e

Memory size

Hibernation method Because of monolithic memory restore, boot time increases in proportion to memory size.

NitroBoot method Boot time is independent of memory size, enabling high speed booting regardless of memory size

18

Page 19: Boot Time: benefits & drawbacks of Linux sleep and hibernate · Easier to maintain than custom tuning Consistently fast at any size e Memory size Hibernation method Because of monolithic

Questions? 19

Thank you for your attention!