rethinking os design

28
Rethinking OS Design Metrics Workload Hardware Resources Services & API Internal Structure Policies / Mechanisms Energy efficiency Processor, Memory, Disks (?), Wireless & IR Keyboard(?), Display(?), Mic & Speaker, Motors & Sensors, GPS, Camera, Batteries Productivity applications Process control Personal (PDAs Embedded You are here

Upload: caitir

Post on 11-Feb-2016

73 views

Category:

Documents


0 download

DESCRIPTION

Rethinking OS Design. Productivity applications Process control Personal (PDAs), Embedded. Workload. Services & API. Internal Structure. You are here. Metrics. Policies / Mechanisms. Energy efficiency. Hardware Resources. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Rethinking OS Design

Rethinking OS Design

Metrics

Workload

Hardware Resources

Services & APIInternal Structure

Policies / MechanismsEnergy efficiency

Processor, Memory, Disks (?), Wireless & IR,Keyboard(?), Display(?), Mic & Speaker,Motors & Sensors, GPS, Camera, Batteries

Productivity applications Process control Personal (PDAs), Embedded

You are here

Page 2: Rethinking OS Design

Energy/Power-related APIs

• OnNow and ACPI• Odyssey

Page 3: Rethinking OS Design

ACPIAdvanced Computer Power Initiative

Brought to you by Intel, Microsoft, and Toshiba and designed to enable OS Directed Power Management (OSPM).

• Goal is to be able to move power management into software for more sophisticated policies

• Abstract OS-HW interface

Page 4: Rethinking OS Design

Power States

G: global states apply to entire system and are visible to user

D: states of individual devices

S: sleeping states within the G1 state

C: CPU states G2-S5Soft off

LegacyG0-S0

working

G3mech off

G1Sleep

S1S2 S3

S4

Dxmodem x DxHDD xDxcdrom x Cxcpu

wakeup

Page 5: Rethinking OS Design

Transmeta Crusoe ACPI Power States

Page 6: Rethinking OS Design

Transmeta Crusoe Power

Page 7: Rethinking OS Design

OSDM: OnNow

Applications

OS

HW

OnNow WIN32 ext

ACPI Spec

SetSystemPowerState– initiate sleep state, query apps(?)

SetThreadExecutionState– specifies level of support needed

(e.g. display required)WM_POWERBROADCAST

– a message notifying of power state changes to which applications can respond

SetWaitableTimer– ensure PC is awake at scheduled time

RequestDeviceWakeup

RequestWakeupLatency - to specify latency requirementsGetSystemPowerStatus and GetDevicePowerState

Page 8: Rethinking OS Design

Measuring Energy

• Similar problems of relating timings to states (non-intrusively).– idle loop in [Endo] isn’t “idle” in power sense

• Additionally, need power costs of states

Page 9: Rethinking OS Design

PowerScope [Flinn]• Statistical sampling approach

– Program counter/process (PC/PID) + correlated current readings.

– Off-line analysis to generate profile• Causality

– Goal is to assign energy costs to specific application events / program structure

– Mapped down to procedure level– System-wide.

Includes all processes, including kernel

Page 10: Rethinking OS Design

Experimental SetupData Gathering

Multimeter’sclock drivessampling at period of 1.6ms

TriggerProfilingcomputer

TakescurrentsampleInterrupt

causesPC/PIDsample tobe buffered

User-level daemonwrites to disk when buffer 7/8 full

Trigger next sample

Page 11: Rethinking OS Design

System Monitor Kernel Mods

• NetBSD• recording of PC and PID• fork(), exec(), exit() instrumented to record

pathname associated with process• new system calls to control profiling• pscope_init(), pscope_start(), pscope_stop(),

pscope_read() (user-level daemon, to disk)

Page 12: Rethinking OS Design

• Voltage essentially constant, only current recorded.

• Each sample is binned into process bucket and procedure within process bucket.

• Energy calculated by summing each bucket

E Vmeas It t

Energy Analyzer

t=0

n

Page 13: Rethinking OS Design
Page 14: Rethinking OS Design

Framework for Adaptation

• Odyssey project - Satya (CMU)• Odyssey is an attempt to incorporate application-

aware adaptation• Noble et al, Agile application-aware adaptation

for mobility, SOSP 97 (network bandwidth examples)

• Flinn and Satya, Energy-aware adaptation for mobile applications, SOSP 99 (energy usage examples)

Page 15: Rethinking OS Design

Odyssey Provides

• API - new syscalls to register a window of tolerance for a variable resource (e.g. network bandwidth)

• Notifications of change (upcalls)– Implies detection of changes.

Mechanisms needed.• Typing - Wardens which handle type-specific

functionality– Type awareness necessary to evaluate tradeoffs

• Viceroy – centralized resource coordination

Page 16: Rethinking OS Design

Architecture of Odyssey Client

Kernel

WardenVic

eroy

Application Cache Mgt

Warden

Page 17: Rethinking OS Design

Notion of Fidelity

• Defined as the degree to which data presented to the client matches the original copy at the server.

• Trading fidelity for performance.

• Adaptation involves supporting multiple and diverse levels of fidelity.

Low JPEGQuality10 KB

Thumbnail2KB

Grayscale85KB

Original116 KB

Page 18: Rethinking OS Design

API

Page 19: Rethinking OS Design

Example

• Each movie in multiple tracks at different fidelity levels

• Warden can switch between tracks to fit bandwidth requirements

Page 20: Rethinking OS Design

Energy Resource

• Monitoring to detect resource availabilityPowerscope

• Using Odyssey for adaptation in this domain.

Page 21: Rethinking OS Design

Fidelity for Energy?

• Before investing in incorporating energy into Odyssey for adaptation, first determine whether Odyssey’s model of fidelity as the way to adapt has potential for energy savings.

• Experiments showing that potential, hand-tuned based on Powerscope information.

Page 22: Rethinking OS Design

Case Study

Video applicationoriginal 12.1MB

• Step 1lossy compressionB: 7MB, C: 2.8MB

• Step 2: display size reduced from 320x240 to 160x120Asmall: 4.9MB, Csmall: 1MB

• Step 3: WaveLAN put into standby mode when not used• Step 4: Disk powered off

Page 23: Rethinking OS Design

Base caseEvery optimization

Page 24: Rethinking OS Design
Page 25: Rethinking OS Design

Conclusions about Fidelity as Energy Saving Adaptation

• Significant variation in effectiveness of fidelity reduction among objects

• And among applications• Combining hardware power management

with fidelity reductions is good.

Page 26: Rethinking OS Design

Can Odyssey Automate This?

• User specifies target battery lifetime.• Odyssey is to monitor energy supply and

demand• Notify applications to change fidelity if

estimate future demand and supply don’t match to achieve desired lifetime.

Page 27: Rethinking OS Design

Goal-directed Energy Adaptation• On-line version of Powerscope(assume this will be built-in)• Smoothed observations of pastconsumption as estimate of future.• Odyssey’s own criteria for notification

EstDemand = ((1-)(sample) + ()(old)) * time_remaining

Page 28: Rethinking OS Design

Results

• Goals:– Meet specified battery lifetime– Highest fidelity within that constraint– Infrequent adaptations– Small leftover battery capacity at end of period.