LCA13: Memory Hotplug on Android
Upcoming SlideShare
Loading in...5
×
 

LCA13: Memory Hotplug on Android

on

  • 410 views

Resource: LCA13

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

Statistics

Views

Total Views
410
Views on SlideShare
410
Embed Views
0

Actions

Likes
0
Downloads
4
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

LCA13: Memory Hotplug on Android LCA13: Memory Hotplug on Android Presentation Transcript

  • Memory Hotplug on Android
  • Memory Hotplug ● Increase/decrease the amount of memory at runtime ○ Two modes ■ Logical Memory Hotplug ■ Physical Memory Hotplug
  • 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 memory hotplug
  • Memory Hotplug Mobile Challenges ● Userspace driven ○ echo offline > /sys/devices/system/memory/memoryX XX/state ● Minutes to offline ● Can fail
  • RAM Power Management ● Temperature Compensated Self Refresh (TCSR) ● Partial Array Self Refresh (PASR) ● Deep Power-Down (DPD)
  • 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
  • RAM Power Management [1] ● Manual ○ Partial Array Self Refresh (PASR) ■ Can power down chunks (64 MB) ■ Works with interleaved ○ Deep Power-Down (DPD)
  • 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
  • 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
  • Hack Approach ● Set aside a buffer apart from the kernel on PASR boundary ● On suspend, activate PASR ○ Assumes buffer contents not important
  • 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 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)
  • 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
  • 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?
  • 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] ○ In progress
  • 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