144 deview-2013-smartphone pm


Published on

Published in: Technology, Business
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

144 deview-2013-smartphone pm

  1. 1. Energy  Management  for  Mobile  Devices:   Power  Es8ma8on  Technique     for  Modern  Smartphones   연세대학교 컴퓨터과학과   모바일 임베디드 시스템 연구실     윤찬민 (cmyoon@yonsei.ac.kr)     DEVIEW  2013   2013.10.14  
  2. 2. Mobile  Pla@orms FM  Radio Proximity GPS Camera Light Mic. Accel Compass Gyroscope Thermometer Barometer Gesture   Feature  Phone   GSM   240x320  Display Cellular Bluetooth Galaxy   S Galaxy  S2 Galaxy  S3 1GHz  Single  core   GSM/HSDPA   480x800  Display,  4.0  inch                       1500  mAh  baWery 1.2GHz  Dual  core   GSM/HSDPA   480x800  Display,  4.3  inch       1650  mAh  baWery 1.4GHz  Quad  core   GSM/HSDPA/LTE   720x1280  Display,  4.8  inch   2100  mAh  baWery WiFi Galaxy  S4 1.6GHz  Octa  core   GSM/WCDMA/LTE   1080x1920  Display(Full  HD),  5.0  inch   2600  mAh  baWery NFC IrDA Mobile  Embedded  System  Lab.,  Yonsei  University   2  
  3. 3. Energy  Management  for  Mobile  Devices 𝛼 Mobile Embedded System Lab., Yonsei University 3
  4. 4. Energy  Management  Techniques Application; Energy Anomaly; Energy Bug; Energy Hog; Energy Leakage; Wakelock; Non-Sleep; Anomaly Detection; Debugging; Anomaly Reporting, … Battery Lifetime; User Interaction; Requirement; User Experience; Personalization; Quality of Service; User Context; Spatiotemporal Context, … •  단말/응용 가용시간 예측 •  사용자 요구 및 컨텍스트 반영 •  사용자중심 Energy-aware UX •  응용프로그램의 전력 소모 특성 정보 수집 관리 기술 •  가상 배터리 관리 기법 •  Energy-aware OS 사용자 시스템 소프 트웨어 Energy Usage; Application Energy Estimation; Process Energy Estimation; Virtualization; Battery Segmentation; Resource Management, … 응용 프로그램 •  실시간 응용프로그램 에너지 bug/ hog 감지 •  응용프로그램의 에너지 특성에 따른 에너지 bug 및 hog 원인 분 석 및 리포팅 시스템 •  하드웨어 전력프로파일링 및 모델링 •  하드웨어 컴포넌트 전력 최적화 •  DevFreq를 이용한 종합적 전력관리 하드웨어 Hardware Component; Homogeneous; Heterogeneous; Multicore System; Dynamic Voltage and Frequency; Devfreq Framework; Component Power Management, … Mobile  Embedded  System  Lab.,  Yonsei  University   4  
  5. 5. Researches  
  6. 6. Hardware-­‐level  Power  Management  (1) CPU Display Dynamic  Voltage  &  Frequency  Scaling Brightness  Level  Control Frequency  Scaling RGB  Level  Conversion GPU Network Sensors Adapave  Clock  Rate  Control Opportunisac  Sensing  Scheduling Mobile  Embedded  System  Lab.,  Yonsei  University   6  
  7. 7. Hardware-­‐level  Power  Management  (2) •  DVFS  (Dynamic  Voltage  and  Frequency  Scaling)   –  Voltage  and  frequency  scaling  are  oden  used  together  to  save  power  in  mobile   devices  including  cell  phones.     •  DVFS  in  Android/Linux  (Power  Governor)   Ondemand Features ü  DVFS only Performance Powersave Hotplug PegasusQ ü  Set the CPU sta tically to the hig hest frequency ü  Set the CPU sta tically to the low est frequency ü  Dual-core ü  Based on Onde mand ü  Multi-core ü  Based on Onde mand Frequency C ontrol ü  Utilization ü  CPU Frequency ― ― ü  Utilization ü  CPU Frequency ü  Utilization ü  CPU Frequency Multi-core Ma nagement ― ― ― ü  Average CPU U tilization ü  CPU Frequency ü  # of Processes Mobile  Embedded  System  Lab.,  Yonsei  University   7  
  8. 8. Hardware-­‐level  Power  Management  (3) •  Is  DVFS  really  (or  always)  energy-­‐efficient?   –  “DVFS  scheme  reduces  power  consumpaon,  which  can  lead  to  significant   reducaon  in  the  energy  required  for  a  computaaon,  paracularly  for  memory-­‐ bound  (I/O-­‐bound)  workloads”  * CPU-­‐bound 2 8 5 10 10 8 900  J 2 1080  J 5 900  J 2 16 10 900  J I/O-­‐bound Inefficient 10 5 900  J ame CPU  jobs 4 18 15 8 720  J 12 ame Efficient I/O  (memory)  jobs Performance  loss  in  every  case *  Le  Sueur,  and  Heiser,  G.,  “Dynamic  Voltage  and  Frequency  Scaling:  the  Laws  of  Diminishing  Returns,”    HotPower’10   Mobile  Embedded  System  Lab.,  Yonsei  University   8  
  9. 9. Hardware-­‐level  Power  Management  (4) •  OLED   –  OLED  display  power  model  is  a  linear  funcaon  of  linear  RGB  intensity  levels.   –  Different  OLED  displays  have  different  power  models   •  Chameleon*   25%ê 34%ê 72%ê 66%ê *  M.  Dong  and  L.  Zhong,  “Chameleon:  a  color-­‐adapave  web  browser  for  mobile  OLED  displays”,  MobiSys    2011. Mobile  Embedded  System  Lab.,  Yonsei  University   9  
  10. 10. Hardware-­‐level  Power  Management  (5) •  LCD  (and  OLED)   –  Reducing  brightness  level  without  UX-­‐loss   About  21%  reducaon  of  power  consumpaon     with  almost  same  UX  as  original  image B.  Anand  et  al.,  “Adapave  display  power  management  for  mobile  games”,  MobiSys  2011.   Mobile  Embedded  System  Lab.,  Yonsei  University   10  
  11. 11. Energy  Bugs/Hogs  (1)   Energy   Bugs   •  Some  running  instance  of  the  app   drain  the  baWery  significantly  faster   than  other  instance  of  the  same   app   •  Cause   -­‐  Coding  error   -­‐  Rare  configuraaon   -­‐  Unusual  user  behavior   •  Remedy   -­‐  Restart  the  energy  bug  app   -­‐  Kill  the  energy  bug  app   Energy   Hogs   •  The  app  drains  the  baWery     significantly  faster  than  the  average   app   •  Cause   -­‐  Coding  error   -­‐  Using  large  amounts  of        energy  to  serve  its  funcaon        (ex,  device  resources..)   •  Remedy   -­‐  Kill  the  energy  hog  app A.  J.  Oliner,  A.  Iyer,  E.  Lagerspetz,  S.  Tarkoma  and    I.  Stoica,  “Collaboraave  Energy  Debugging  for  Mobile  Devices,”  in  Proc.  of  the  8th   USENIX  conference  on  Hot  Topics  in  System  Dependability,  Berkeley,  CA,  USA,  October  2012.   Mobile  Embedded  System  Lab.,  Yonsei  University   11  
  12. 12. Energy  Bugs/Hogs  (2) •  Diverse  causes  of  Energy  Bugs   –  An  error  in  the  system,  either  applicaaon,  OS,  hardware,  firmware  or  external  that   causes  an  unexpected  amount  of  high  energy  consumpaon  by  the  system  as  a   whole   A.  Pathak,  Y.  C.  Hu  and  M.  Zhang,  “Bootstrapping  energy  debugging  on  smartphones:  a  first  look  at  energy  bugs  in  mobile  devices,”  in   Proc.  of  the  10th  ACM  Workshop  on  Hot  Topics  in  Networks,  Cambridge,  MA,  USA,  November  2012.   Mobile  Embedded  System  Lab.,  Yonsei  University   12  
  13. 13. Energy  Bugs/Hogs  (3) •  Managing  Energy  Bugs/Hogs   –  Diagnose:  compare  normal  baWery  drain  and  abnormal  baWery  drain   –  Suggest  appropriate  repair  soluaons  based  on  the  diagnosis  results   Diagnosis  Engine Informa8on  Collector Anomaly   Detecaon User   Changes Resource   Usage   Suspicious   Resource  Usage Repair  Advisor Suspicious   Events eDoctor*  :  Phase  Analysis Delete   Apps Revert   Apps Terminate   Apps Revert   Configs Data  Analyzer Phase   Idenaficaaon Per-­‐applicaaon  usage  paWerns System  wide  usage  paWerns Configuraaon  paWerns Sampling   during  discharging Compare   reference  and  subject Carat  :  Comparison  Analysis *  X.  Ma,  P.  Huang,  X.  Jin,  P.  Wang,  S.  Park,  D.  Shen,  Y.  Zhou,  L.  K.  Saul,  and  G.  M.  Voelker,  “eDoctor  :  Automaacally  Diagnosing  Abnormal   BaWery  Drain  Issues  on  Smartphones,”  in  Proc.  of  the  10th  USENIX  Symposium  on  NSDI’  13,  Berkeley,  CA,  USA,  April  2013.   Mobile  Embedded  System  Lab.,  Yonsei  University   13  
  14. 14. Energy  Bugs/Hogs  (4) •  Default  power  management  policy  for  mobile  device  (new  paradigm)     –  OS  uses  aggressive  sleeping  policies   –  Every  component,  including  the  CPU,  stays  off  or  in  an  idle  state,  unless  the  app   explicitly  instructs  the  OS  to  keep  it  on!   •  “No-­‐sleep”  Energy  Management   –  Aggressive  sleeping  may  severely  impacts  smartphone  apps   –  Power  encumbered  programming  :  Androids  “Wakelock”  API     New  Energy  Bug*  à  “No-­‐sleep”  bug  :  70%  (applica8on)   *  Pathak,  Abhinav,  et  al,  “What  is  keeping  my  phone  awake?:  characterizing  and  detecang  no-­‐sleep  energy  bugs  in  smartphone   apps,”  in  Proc.  of  the  10th  internaRonal  conference  on  Mobile  systems,  applicaRons,  and  services  (MobiSys  2012),  ACM,  2012.   Mobile  Embedded  System  Lab.,  Yonsei  University   14  
  15. 15. Energy  Bugs/Hogs  (5) •  WakeScope  (mobed.yonsei.ac.kr/wakescope)   –  A  runame  WakeLock  anomaly  management  scheme  for  Android  plauorm WakeLock  Behavior  Tracker Applica8on WakeLock  Anomaly  Detector Android  System PARTIAL PARTIAL SCREEN PARTIAL SCREEN Android  Framework WakeLock  behavior  tracking Applicaaon FULL FULL Binder PARTIAL SCREEN FULL … WakeScope  Applica8on Applicaaon  &  Android  system   stop  state  checking CPU   Usage Process   Running  State Android  System SCREEN FULL WakeLock  release  checking PowerManagerService Android  Power  Management WakeLock  behavior  tracking Android  System PARTIAL “PowerManagerService”   PARTIAL … WakeLock  Anomaly  checking PARTIAL Screen  state SCREEN FULL Light  off  ame “…..”   PARTIAL Linux  Power  Management WakeLock  Anomaly Mobile  Embedded  System  Lab.,  Yonsei  University   Handling  of  WakeLock  Anomaly Applica8on Android   System Kill   Applicaaon Reboot     Smartphone 15  
  16. 16. Energy-­‐aware  UX  (1) •  Beder  energy-­‐related  understandings  à  energy-­‐efficient  behavior   1.6  Donut     Android  BaWery  Informaaon   4.1.1  Jellybean   TCBI*   •  Task-­‐centered  Badery  Interface*   –  Support  users’  mental  models  on  fully  understanding  what  is  happening  on   their  devices   *K.  N.  Truong,  et  al.  "The  Design  and  Evaluaaon  of  a  Task-­‐Centered  BaWery  Interface,“  UbiComp  2010. Mobile  Embedded  System  Lab.,  Yonsei  University   16  
  17. 17. Energy-­‐aware  UX  (2) •  HCI-­‐based  Display  Control   –  Reduce  display  power  by  dimming  the  parts  of  an  applicaaon  or  game  that  are  of   low  interest Brighten  user-­‐ interest  area   Dim  less   important  area   Wee,  Tan  Kiat,  et  al.  "DEMO  of  Focus:  A  Usable  &  Effecave  Approach  to  OLED  Display  Power  Management,“  HotMobile  2013. Mobile  Embedded  System  Lab.,  Yonsei  University   17  
  18. 18. Energy-­‐aware  UX  (3) •  Ac8ve  User  Involvement   –  User  is  a  main  actor  for  energy  management M.  Marans  and  R.  Fonseca  "Applicaaon  Modes:  A  Narrow  Interface  for  End-­‐User  Power  Management  in  Mobile  Devices,“  HotMobile  2013. Mobile  Embedded  System  Lab.,  Yonsei  University   18  
  19. 19. Energy-­‐aware  UX  (4) •  Badery  Virtualiza8on   –  Virtualizaaon  of  the  baWery  resource  across  applicaaon  classes Virtual  BaWery  1 Physical  Badery Virtual  BaWery  2 Virtual  BaWery  3 App  Class  1 App  Class  2 App  Class  3 N.  Zhang  et  al.  “PowerVisor:  a  baWery  virtualizaaon  scheme  for  smartphones,“  MCS  2012. Mobile  Embedded  System  Lab.,  Yonsei  University   19  
  20. 20. Energy-­‐aware  UX  (5) •  Context-­‐based  Badery  Management:  BaderyGuru  (Qualcomm)   –  Extends  baWery  performance  and  improves  overall  user  experience  by   intelligently  making  changes  that  opamize  device  funcaonality Preferred  Applicaaons Preferred/Available  WiFi  regions Automaac  learning •  Manage  applicaaon’s  update  points   •  Control  WiFi  on/off Badery  Saving Mobile  Embedded  System  Lab.,  Yonsei  University   20  
  21. 21. Es8ma8on  
  22. 22. Power  Modeling  &  Energy  Es8ma8on  (1) •  Why  applica8on/component  energy  informa8on  is  valuable?   App.  Developer System  Developer Applica8on/Hardware  Energy  Metering End  User Mobile  Embedded  System  Lab.,  Yonsei  University   22  
  23. 23. Power  Modeling  &  Energy  Es8ma8on  (2) Ualizaaon Challenges:  how  to  estimate   application’s  energy  consumption?   CPU Display Acave  cores … ​ 𝑃↓𝐶𝑃𝑈 =​ 𝛽↓𝑓 ​⋅ 𝑈↓𝐶𝑃𝑈 +​ 𝛽↓𝑖𝑑𝑙𝑒 ⋅(1−​ 𝑈↓𝐶𝑃𝑈 ) GPU ​ 𝑃↓𝑂𝐿𝐸𝐷 = 𝑓(𝑅, 𝐺, 𝐵) ⋅ ​ 𝑃↓𝐺𝑃𝑈 =​↓𝑅 ​ 𝑅⋅↓𝑖 ↓𝐺𝑃𝑈 +​ ↓𝑖 +WiFi 𝐵↓𝑖 ) (​ 𝛽 𝛽↓𝑓  ​ 𝑈 +​ 𝛽↓𝐺 ​ 𝐺 𝛽↓𝑏𝑎𝑠𝑒  ​ 𝛽 ↓𝐵 ​ ​ 𝑃↓3 𝐺 =​ 𝛽↓3 𝐺 ,  3 𝐺={ 𝑈𝑀𝑇𝑆, 𝐻𝑆𝑈𝑃𝐴, 𝐻𝑆𝑃𝐴𝑃} GPS ​ 𝑃↓𝐺2 𝐷𝑋 =​ 𝛽↓𝐺2 𝐷𝑋 ⋅​ 𝑃 𝑖𝑥𝑒𝑙𝑠↓𝐺2 𝐷𝑋 +​ 𝛽↓𝑏𝑎𝑠𝑒  Cell Frequency Colors/   Brightness Display  occupancy  ame Connected   ame 3G/LTE High/low   Power  state TRX   packets RRC  state Mobile  Embedded  System  Lab.,  Yonsei  University   23  
  24. 24. Device  Power  Modeling  (1) Base Power Component Power GPU DISPLAY CPU ​ 𝑃↓𝑡↑𝑡𝑜𝑡𝑎𝑙 =​ 𝑃↓𝑏𝑎𝑠𝑒  +∑𝑖=1↑𝑛▒​ 𝑃↓𝑡↑𝑖  +​ 𝜖↓𝑡    Total Power Error, Leakage Maximum power consumption of 𝑖 component ​ 𝑃↓𝑡↑𝑖 =​ 𝛽↓𝑖 ⋅​ 𝑥↓𝑖↑𝑡  Component behavior and usage Mobile  Embedded  System  Lab.,  Yonsei  University   24  
  25. 25. Device  Power  Modeling  (2) •  Issues   –  Component-­‐specific  ualizaaon  metric   •  uame/same,  cores,  frequency,  color/brightness,  packet,  tail  state,  temp,  …   –  Base  power  esamaaon   •  System  base  power,  component  base  power   –  Isolated  control  of  hardware  component   •  Isolaang  CPU  influence  from  component  power  monitoring   Base power ? Colors/Brightness TRX   packets   Ualizaaon Power  of  component   Acave  cores How to fix the 𝐶 ​ 𝑷↓𝒄𝒑𝒖  ? Frequency Mobile  Embedded  System  Lab.,  Yonsei  University   25  
  26. 26. Device  Power  Model:  Example Mobile  Embedded  System  Lab.,  Yonsei  University   26  
  27. 27. Power  Analysis  
  28. 28. Conven8onal  Power  Measurement acave  core? base? Job  2   triggering? Job  3 Job  3   temperature? Job  2 governor? Job  1 frequency? Job  1   External  Power  Monitor Mobile  Embedded  System  Lab.,  Yonsei  University   28  
  29. 29. Nonintrusive  Power  Measurement  (1) … CPU Display Wi-­‐Fi Cellular GPS Fuel-gauge IC H/W  Components Battery DevScope Component   Controller Timing Controller Fuel-­‐gauge  IC   Event   Monitor Component Power Model Power   Model   Generator •  Concepts   –  Use  built-­‐in  fuel-­‐gauge  IC   –  Assume  specific  H/W  power   model   –  Online  and  non-­‐intrusive  power   modeling   •  Power  modeling  process   –  Component-­‐specific  training  set   generaaon   •  Workload,  Control  scenario   –  Probe  OS,  H/W  component   –  Monitor  fuel-­‐gauge  IC   Mobile  Embedded  System  Lab.,  Yonsei  University   29  
  30. 30. Nonintrusive  Power  Measurement  (2) •  Badery  Monitoring  Unit  (BMU,  BMIC,  Fuel-­‐gauge  IC,  SBS,  …)   –  Internal  measurement  device  for  supply  voltage,  baWery  capacity,  discharge   current,  temperature,  ...   •  BMIC  types   Type Current + voltage Voltage only IC Maxim DS2760, Maxim DS278X, TI UCC3926, … Ti BQ27X00, WM97XX, … Model Sony-Ericsson Xperia Series, HTC NexusOne/Desire Series, Samsung Galaxy S3/S4(?) Samsung Galaxy Series, LG Optimus Series(?), … •  Example:  Maxim  DS2784  (HTC  Nexus  One)   –  Measuring  voltage,  current,  and  temperature       –  Current  sensing   •  Resoluaon:  104uA   •  Sensing  range:  -­‐3430mA  ~  3430mA  (±1%)   •  Sampling  rate:  18.6KHz  /  Update  rate:  0.28Hz   Mobile  Embedded  System  Lab.,  Yonsei  University   BaWery  Monitoring  Unit  (Maxim  DS2784) 30  
  31. 31. Nonintrusive  Power  Measurement  (3)  DevScope Coefficient Values Workload   Genera8on 𝑝=​ 𝛽↓𝑓𝑟𝑒𝑞 × 𝑢   -­‐  WiFi:   𝑝=​ 𝛽↓𝑇𝑋 × 𝑝𝑝𝑠+​ 𝛽↓𝑖𝑑𝑙𝑒    Ini8aliza8on Component  P ​ 𝛽↓𝑝𝑜𝑤𝑒𝑟_ 𝑠𝑡𝑎𝑡𝑒    -­‐  3G/GPS:   𝑝=ower  Models -­‐  LCD:   𝑝=​ 𝛽↓𝑏𝑟𝑖𝑔ℎ𝑡𝑛𝑒𝑠𝑠    -­‐  CPU:   Workload   Tuning   &   Probing CPU LCD WiFi 3G GPS 245 368 238 268 0 998 854 247 519 354 Power  behavior  analysis  Android -­‐  CPU  frequencies   -­‐  BMU  types   -­‐  Hardware  component  types   -­‐  Network  se|ngs Reporang   Rate Measurement  Data BMU  Ac8vity System  Configura8on -­‐  CPU  control   -­‐  3G/LTE/WiFi  networking   -­‐  Display  control   -­‐  GPS  control Android  API BMU  Report  Hardware CPU BMU Mobile  Embedded  System  Lab.,  Yonsei  University   LCD WiFi Cellular GPS Hardware  Components 31  
  32. 32. U8liza8on  
  33. 33. Applica8on  Energy  Es8ma8on  (1) Challenges:  how  to  estimate   application’s  energy  consumption?   •  Conven8onal  methods   ​ 𝐸↑𝐴𝑝𝑝 =∑𝑖=0↑# 𝑜𝑓𝐶𝑜𝑚𝑝▒(​ 𝛽↓𝑖 ×​ 𝑥↓𝑖↑𝐴𝑝𝑝 )×​ 𝑑↓𝑖↑𝐴𝑝𝑝   –  HPC  (hardware  performance  counter)   –  Linux  “procfs/sysfs”   ​ 𝛽↓𝑖↑  ​ 𝑥↓𝑖↑𝐴𝑝𝑝  Power  coefficient   value Utilization –  Android  “BaYeryStats”   –  Basically  “polling”   •  Problems   –  Dependency  on  processor   –  Update  rate  problem   –  Granularity  problem  (per-­‐process  info)   ​ 𝑑↓𝑖↑𝐴𝑝𝑝  Activated  duration Hardware  component  usage   Limitations   Accuracy/Granularity/Real-­‐time   Mobile  Embedded  System  Lab.,  Yonsei  University   33  
  34. 34. Applica8on  Energy  Es8ma8on  (2) •  How  to  detect  hardware  component  opera8on?   –  Event-­‐driven  kernel  acavity  monitoring   Event  of  component  opera8on Dura8on/U8liza8on  of  opera8on t Mobile  Embedded  System  Lab.,  Yonsei  University   34  
  35. 35. Applica8on  Energy  Es8ma8on  (3) Android API call Application binder ... process 2 c/c++ libraries process n Kernel Activity Monitoring Event Detector Kernel Binder IPC data Android process 1 1 𝑖   binder driver Request to use H/W by system call Energy Consumption H/W drivers binder_ioctl(), ioctl(), socket(), read(), write(), ... 2 Hardware Component Usage Analyzer … CPU Display Wi-Fi Cellular GPS 3 Application Energy Estimator Component Power Models Fuel-gauge IC Estimation Result External Devices Device    power  model   Mobile  Embedded  System  Lab.,  Yonsei  University   35  
  36. 36. Component  Usage  Monitoring  (1) “Kprobes” Kernel  path Instrumentaaon  rouane •  System  calls   •  Kernel  funcaons   •  Binder  calls    Hooking  Point 0x81808c144   Probe  Handler Hardware  Component     Usage  Analyzer   INT03:Break