Memory Hotplug on
Android
Memory Hotplug
● Increase/decrease the amount of memory
at runtime
○ Two modes
■ Logical Memory Hotplug
■ Physical Memory ...
Server Memory Hotplug
● Change the amount of memory
● Install/remove DIMMs or NUMA-nodes
Mobile Memory Hotplug
● Increase/decrease the amount of memory
at runtime
○ Power down memory to save power
■ logical memo...
Memory Hotplug Mobile
Challenges
● Userspace driven
○ echo offline >
/sys/devices/system/memory/memoryX
XX/state
● Minutes...
RAM Power Management
● Temperature Compensated Self Refresh
(TCSR)
● Partial Array Self Refresh (PASR)
● Deep Power-Down (...
RAM Power Management [1]
● Automatic
○ Temperature Compensated Self
Refresh (TCSR)
■ When a RAM is cold the refresh
interv...
RAM Power Management [1]
● Manual
○ Partial Array Self Refresh (PASR)
■ Can power down chunks (64 MB)
■ Works with interle...
RAM Power Management [1]
● Does this matter?
○ 5% savings [2] (50 mW out of 1 W)
■ This is at runtime
■ Can ship devices w...
RAM Power Management [1]
● If big.LITTLE save 150 mW
○ Assumptions
■ A9 core uses 300 mW
■ A15 of this order
■ A7 cores us...
Hack Approach
● Set aside a buffer apart from the kernel
on PASR boundary
● On suspend, activate PASR
○ Assumes buffer con...
Linux Approach
● Use a balloon that allocates from a
Contiguous Memory Allocation (CMA)
region during suspend
Mel Gorman's Idea (from
Maxime)
1. Declare CMA big enough for PASR or
DPD
2. At runtime, no CMA allocations
a. Linux uses ...
Mel Gorman's Idea Cont...
4. If there's memory pressure during balloon
inflation Android's low memory killer kills
lower r...
Issues
1. QoS
a. Some apps that need huge memory
allocations can't fail (Camera)
2. Latency
a. Some apps that need huge me...
Future
1. SMMU's coming, will help
Maxime Coquelin, ST-E
● First RFC
○ http://lwn.net/Articles/478049/
○ https://lkml.org/lkml/2012/1/30/215
● Second RFC [3]...
Docs
1. TN-46-12: Mobile DRAM Power-Saving Features/Calculations Introduction
2. TECHNICAL NOTE Low Power Function of Mobi...
Upcoming SlideShare
Loading in...5
×

LCA13: Memory Hotplug on Android

606
-1

Published on

Resource: LCA13
Name: Memory Hotplug on Android
Date: 08-03-2013
Speaker: Zach Pfeffer

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
606
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
16
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

LCA13: Memory Hotplug on Android

  1. 1. Memory Hotplug on Android
  2. 2. Memory Hotplug ● Increase/decrease the amount of memory at runtime ○ Two modes ■ Logical Memory Hotplug ■ Physical Memory Hotplug
  3. 3. Server Memory Hotplug ● Change the amount of memory ● Install/remove DIMMs or NUMA-nodes
  4. 4. Mobile Memory Hotplug ● Increase/decrease the amount of memory at runtime ○ Power down memory to save power ■ logical memory hotplug
  5. 5. Memory Hotplug Mobile Challenges ● Userspace driven ○ echo offline > /sys/devices/system/memory/memoryX XX/state ● Minutes to offline ● Can fail
  6. 6. RAM Power Management ● Temperature Compensated Self Refresh (TCSR) ● Partial Array Self Refresh (PASR) ● Deep Power-Down (DPD)
  7. 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. 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. 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. 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. 11. Hack Approach ● Set aside a buffer apart from the kernel on PASR boundary ● On suspend, activate PASR ○ Assumes buffer contents not important
  12. 12. Linux Approach ● Use a balloon that allocates from a Contiguous Memory Allocation (CMA) region during suspend
  13. 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. 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. 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?
  16. 16. Future 1. SMMU's coming, will help
  17. 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. 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
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×