Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu...

21
Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu Purdue University Ming Zhang, Paramvir Bahl, Yi-Min Wang Microsoft Research 2011 EuroSys

Transcript of Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu...

Page 1: Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu Purdue University Ming Zhang, Paramvir Bahl, Yi-Min.

Fine-Grained Power Modeling for Smartphones Using System Call TracingAbhinav Pathak, Y. Charlie HuPurdue University

Ming Zhang, Paramvir Bahl, Yi-Min WangMicrosoft Research

2011 EuroSys

Page 2: Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu Purdue University Ming Zhang, Paramvir Bahl, Yi-Min.

MotivationAccurate, fine-grained online

energy estimation of mobile devices.◦Understanding and debugging the

energy consumption of mobile applications.

Current utilization-based power modeling is insufficient for modeling the power consumption of mobile devices.

Page 3: Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu Purdue University Ming Zhang, Paramvir Bahl, Yi-Min.

Utilization-Based Power ModelingThe power state of a device is

correlated to the utilization of its hardware components.◦Ex: CPU utilization 0% => 150W

CPU utilization 50% => 250W CPU utilization 90% => 340W

This model can be used to perform online estimation of power consumption.◦Collects the utilization of each

components and feeds them into the model.

Page 4: Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu Purdue University Ming Zhang, Paramvir Bahl, Yi-Min.

New ChallengesSeveral components have tail

power states.◦Tail power: a component stays at

high power state for a period of time after active I/O activities.

System calls that do not imply utilization can change power states◦Could be due to power optimizations

programmed in device drivers.

Page 5: Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu Purdue University Ming Zhang, Paramvir Bahl, Yi-Min.

New Challenges(cont.)Several components do not have

quantitative utilization.◦“Exotic” components such as GPS

and camera.

Page 6: Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu Purdue University Ming Zhang, Paramvir Bahl, Yi-Min.

System-Call-Based Power ModelingBased on the following observations:

◦System calls is the only way an app can access hardware (I/O) components.

◦System calls can trigger power state transition.

◦System calls that turn on/off “exotic” components trigger power state change immediately.

◦Using system calls as triggers naturally suggests using a FSM to model state transitions.

◦System calls can be easily related back to the calling subroutine.

Page 7: Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu Purdue University Ming Zhang, Paramvir Bahl, Yi-Min.

System-Call-Based Power Modeling(Cont.)Model the power state of a

device using FSM.◦Each state of the FSM is a power

state of the device. Can be easily annotated with timing and

workload of recent events.

◦The state transition is triggered by system call.

Page 8: Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu Purdue University Ming Zhang, Paramvir Bahl, Yi-Min.

Construction Step IModeling single system call

power consumption

Page 9: Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu Purdue University Ming Zhang, Paramvir Bahl, Yi-Min.

Construction Step IIModeling Multiple System Calls(to

the same component)◦Concurrent system calls

The second system call is invoked before the component is out of the productive or tail state due to the first system call.

◦Power states of a component Take the union of all power states

discovered by modeling individual system calls.

Page 10: Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu Purdue University Ming Zhang, Paramvir Bahl, Yi-Min.

Construction Step II(Cont.)◦Modeling state transition

A system call arrives after the previous one is out of its productive power state.=> superimposing the FSM of the second on top of the first.

A system call arrives while the previous one is still in its productive power state.=>

Workload-based system call (ex: read/write) workload_first => workload_first +

workload_second Initialization-based system call (ex:

open) Productive state => Tail state =>

Superimposing

Page 11: Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu Purdue University Ming Zhang, Paramvir Bahl, Yi-Min.

Construction Step IIIModeling Multiple Components

◦Android The total power consumption is the

summation of those of individual components when active in isolation.

◦Windows Phone Tail states of different components

interfere with each other. Try out all possible combinations of the

sets of conditions, each set for driving one component into all possible states, and measure the corresponding total power consumption.

Page 12: Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu Purdue University Ming Zhang, Paramvir Bahl, Yi-Min.

CTester ApplicationsA testing benchmark suite.

◦An application for each component carefully designed to exercise all the relevant system calls.

◦A wrapper application that invokes individual applications at predetermined timing .

Run CTester and measure the power dissipated through an external power meter.

Page 13: Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu Purdue University Ming Zhang, Paramvir Bahl, Yi-Min.

ImplementationTracing System Calls

◦Windows Mobile 6.5 with Windows CE 5.2 kernel

◦Android 2.2 running Linux Kernel 2.6.34

Flash Customized kernel Images

Page 14: Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu Purdue University Ming Zhang, Paramvir Bahl, Yi-Min.

Hardware Platform

Phone is connected to a power supply with power monitor.

Power monitor samples every 200 ms.

Name

Handset HTC-

CPU (MHz)

OS (kernel) BasePower

Magic Magic 528 Android 2.0 (Linux 2.6.34)

160mA

Touch Touch 528 WM6.1 (CE5.2) 250mA

Tytn2 Tytn II 400 WM6.1 (CE5.2) 130mA

Page 15: Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu Purdue University Ming Zhang, Paramvir Bahl, Yi-Min.
Page 16: Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu Purdue University Ming Zhang, Paramvir Bahl, Yi-Min.
Page 17: Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu Purdue University Ming Zhang, Paramvir Bahl, Yi-Min.

Energy Consumption EstimationCompare the accuracy of fine-

grained and whole-application energy consumption estimation.◦System-call-based◦Utilization-based

LR model

◦Only consider LCD, CPU, sacard, and wifi NIC.

Page 18: Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu Purdue University Ming Zhang, Paramvir Bahl, Yi-Min.
Page 19: Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu Purdue University Ming Zhang, Paramvir Bahl, Yi-Min.

Fine-grainedInterval: 50ms

Page 20: Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu Purdue University Ming Zhang, Paramvir Bahl, Yi-Min.

Whole-application

Page 21: Fine-Grained Power Modeling for Smartphones Using System Call Tracing Abhinav Pathak, Y. Charlie Hu Purdue University Ming Zhang, Paramvir Bahl, Yi-Min.

ConclusionThis paper presents the design

and implementation of a system-call-based power modeling approach.

The experimental results on Android and Windows Mobile using a diverse set of applications show that the new model drastically improves the accuracy of fine-grained energy estimation as well as whole application energy estimation.