4. Mobile Memory Hotplug
● Increase/decrease the amount of memory
at runtime
○ Power down memory to save power
■ logical memory hotplug
5. Memory Hotplug Mobile
Challenges
● Userspace driven
○ echo offline >
/sys/devices/system/memory/memoryX
XX/state
● Minutes to offline
● Can fail
6. RAM Power Management
● Temperature Compensated Self Refresh
(TCSR)
● Partial Array Self Refresh (PASR)
● Deep Power-Down (DPD)
7. RAM Power Management [1]
● Automatic
○ Temperature Compensated Self
Refresh (TCSR)
■ When a RAM is cold the refresh
interval can be extended (saving
power) [2]
■ Automatic
8. RAM Power Management [1]
● Manual
○ Partial Array Self Refresh (PASR)
■ Can power down chunks (64 MB)
■ Works with interleaved
○ Deep Power-Down (DPD)
9. RAM Power Management [1]
● Does this matter?
○ 5% savings [2] (50 mW out of 1 W)
■ This is at runtime
■ Can ship devices with less memory
● Yes Tim Bird, I can ship a 32 MB
Android device
10. RAM Power Management [1]
● If big.LITTLE save 150 mW
○ Assumptions
■ A9 core uses 300 mW
■ A15 of this order
■ A7 cores use 150 mW (look at the
radio usage)
■ This is 15% power savings
11. Hack Approach
● Set aside a buffer apart from the kernel
on PASR boundary
● On suspend, activate PASR
○ Assumes buffer contents not important
12. Linux Approach
● Use a balloon that allocates from a
Contiguous Memory Allocation (CMA)
region during suspend
13. Mel Gorman's Idea (from
Maxime)
1. Declare CMA big enough for PASR or
DPD
2. At runtime, no CMA allocations
a. Linux uses the memory (cache,
userspace i.e. movable) (Questions)
3. On idle, inflate the balloon
a. Allocate CMA buffers in the region
b. Pages are migrated (userspace) or
dropped (cache)
14. Mel Gorman's Idea Cont...
4. If there's memory pressure during balloon
inflation Android's low memory killer kills
lower rated processes or balloon inflation
can stop
5. On wake-up deflate the balloon or wait
until there's memory pressure to deflate it
15. Issues
1. QoS
a. Some apps that need huge memory
allocations can't fail (Camera)
2. Latency
a. Some apps that need huge memory
allocations need to launch "fast."
3. Hand of God
a. Two level VM scheme in Linux?
17. Maxime Coquelin, ST-E
● First RFC
○ http://lwn.net/Articles/478049/
○ https://lkml.org/lkml/2012/1/30/215
● Second RFC [3]
○ In progress
18. Docs
1. TN-46-12: Mobile DRAM Power-Saving Features/Calculations Introduction
2. TECHNICAL NOTE Low Power Function of Mobile RAM Auto Temperature Compensated Self Refresh (ATCSR)
Technical Note E0599E20 (Ver.2.0)
3. http://elinux.org/images/f/f3/Lf_elc12_pallardy.pdf