Performance directed energy management using BOS technique

42
Performance directed energy management using BOS technique Pratap Ramamurthy Ramanathan Palaniappan University of Wisconsin-Madison

description

Performance directed energy management using BOS technique. Pratap Ramamurthy Ramanathan Palaniappan University of Wisconsin-Madison. Outline. Introduction BOS Mechanisms Policies Results Conclusion. Introduction. Introduction. Energy consumption in mobile devices and laptops - PowerPoint PPT Presentation

Transcript of Performance directed energy management using BOS technique

Page 1: Performance directed energy management using  BOS technique

Performance directed energy management using

BOS technique

Pratap Ramamurthy

Ramanathan Palaniappan

University of Wisconsin-Madison

Page 2: Performance directed energy management using  BOS technique

Outline

Introduction BOS Mechanisms Policies Results Conclusion

Page 3: Performance directed energy management using  BOS technique

Introduction

Page 4: Performance directed energy management using  BOS technique

Introduction Energy consumption in mobile devices and laptops

Memory could consume 50% more power than processors

Is there hardware support ?

RAMBUS devices provide capability

Page 5: Performance directed energy management using  BOS technique

Problem Statement How to save power in memory without

hurting performance ? Solution: BOS

Estimating the optimal amount of memory based on paging activity.

Dynamic resizing of memory !

Page 6: Performance directed energy management using  BOS technique

What is BOS ? BOS – Ballooning in-OS technique Tracks current memory requirements Tracks chip access pattern Powers down memory chips Minimizes power consumption

Page 7: Performance directed energy management using  BOS technique

BOS Mechanisms Ballooning in-OS technique

Power Down Page Migration Page Reservation Invisible Buddy

Chip recovery (Power up) Chip selection

Intercept memory accesses

Page 8: Performance directed energy management using  BOS technique

BOS policies Power decision

Disk activity, # chips powered on Epoch

Time interval between two decisions Chip selection

Access pattern

Page 9: Performance directed energy management using  BOS technique

Inferences Operating point balances disk accesses and memory

power consumption Cost of thrashing offsets the power saved from a

single chip Most media applications do not need the entire RAM Least allocated chips are not the least accessed ones

Page 10: Performance directed energy management using  BOS technique

BOS Architecture

Get systemparameters

Decide to Power off/on

Select Chip

Loop all pages in chip

If occupied

MigrateIf page is free

Pin the page

If Locked or reserved

Wait & Pounce

Recover PowerPages

Clear flags & unPin

Update

Chip Power Table(CPT)

Wait an Epoch

OFF

Do NothingON

Wake up

Kpower_d

Page 11: Performance directed energy management using  BOS technique

BOS Mechanisms

Page 12: Performance directed energy management using  BOS technique

Mechanisms In-OS Ballooning Techniques

Page Migration Page Reservation Invisible Buddy Chip Recovery

Chip Selection Intercept Memory Accesses

No Actual Power Down

Page 13: Performance directed energy management using  BOS technique

Power down

101010101010101000101010001010

101010101010101000101010001010

101010101010101000101010001010

101010101010101000101010001010

101010101010101000101010001010

101010101010101000101010001010

101010101010101000101010001010

101010101010101000101010001010

101010101010101000101010001010

101010101010101000101010001010

Under Memory pressure ???

So replace page using LRU…

And Migrate! DISK

Selected Chip

101010101010101000101010001010

101010101010101000101010001010

101010101010101000101010001010

101010101010101000101010001010

Page 14: Performance directed energy management using  BOS technique

Page Migration When to migrate ? Kinds of pages

File pages Anonymous pages

Swap cache pages

Free Pages

Page 15: Performance directed energy management using  BOS technique

Page Migration Mechanism Mechanism

Data Transfer Reverse map (thanks to Linux Kernel 2.6) Remap Dependant data structures

Page Table Active LRU and Inactive LRU Page cache Swap cache Buffers Flags

Page 16: Performance directed energy management using  BOS technique

101010101010101000101010001010

101010101010101000101010001010

101010101010101000101010001010

101010101010101000101010001010

Processes

Buffers

Page MigrationMajor Data Structures Updated while Migrating

LRU lists

1. Memcopy2. Remapping using rmap3. Update buffers4. Remove from LRU lists

101010101010101000101010001010

Page 17: Performance directed energy management using  BOS technique

Page Reservation Ways to Pin pages

Remove from LRU Lists Reserve Page Lock Page Page count

Page 18: Performance directed energy management using  BOS technique

Free Pages Buddy allocator

List of free pages Buddy Order (0-11) Locality

How to deal with already free pages?

Page 19: Performance directed energy management using  BOS technique

2

1

Request for a free page of order 0Make the ‘power’ pages invisibleRequest for a page of order 1 (Invisibility in action)

Invisibility in Action (Buddy allocator)

0

Page 20: Performance directed energy management using  BOS technique

Invisible Buddy Power Bit Invisibility – divert page allocation Other methods?

Why not always remove the page completely from the buddy allocator? Because the free pages are not necessarily in the

buddy

Page 21: Performance directed energy management using  BOS technique

Recovery Page in the buddy

Clear power bit That’s it !

Pages that were migrated Clear Power bit Add to the buddy

Reverse Recovery Recover the last pinned page and move backwards

Page 22: Performance directed energy management using  BOS technique

Partial Recovery Why would you abort a chip?

Locked pages Reserved pages IO activity

Easy solution Abort chip

Better solution Wait and Pounce

Page 23: Performance directed energy management using  BOS technique

Policies

Page 24: Performance directed energy management using  BOS technique

Policy Epoch

Time interval between two decisions Power decision

Disk activity, # chips powered on Chip select

Access pattern

Page 25: Performance directed energy management using  BOS technique

Chip Selection Mechanism Chip pattern table Access history over 32 epochs Form a number with the bits

and Select the minimum ! How to monitor chip access ?

Referenced bit in h/w Clear bits Examine every epoch

1

1

0 0

0

1

0

0

0

1

0 0

1

1

0

0

1

1

1 0

1

1

0

0

1

1

0 1

1

1

1

0

0

1

0 0

1

1

0

1The least accessed chip is # 7

The least accessed chip is # 6

Page 26: Performance directed energy management using  BOS technique

Results

Page 27: Performance directed energy management using  BOS technique

ResultsPage Distribtuion

0

500

1000

1500

2000

2500

3000

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Chip Number

# P

ag

es

Allo

ca

ted

rhn-applet-gui

kiconedit

kolourpaint

Page 28: Performance directed energy management using  BOS technique

Chip access pattern

Page 29: Performance directed energy management using  BOS technique

ResultsFile access time (vs) Power down

0

200000

400000

600000

800000

1000000

1200000

1400000

1600000

1800000

OFF = 0 OFF = 10 OFF = 15 OFF =20

# chips powered OFF

Tim

e(m

icro

seco

nd

s)

100

200

300

400

# Off Available Memory (MB)

0 512

10 352

15 272

20 192

Page 30: Performance directed energy management using  BOS technique

Results

ram
A small
Page 31: Performance directed energy management using  BOS technique

BOS architecture

Get systemparameters

Decide to Power off/on

Select Chip

Loop all pages in chip

If occupied

MigrateIf page is free

Pin the page

If Locked or reserved

Wait & Pounce

Recover PowerPages

Clear PowerBit & unPin

Update

Chip Power Table(CPT)

Wait an Epoch

OFF

Do NothingON

Wake up

Kpower_d

Page 32: Performance directed energy management using  BOS technique

Power down/up decisionIf ( # disk_access < α )

power_down()

elseif ( # disk_access > β )

power_up()

elseif (α < # disk_access < β )

take_no_action()

α, β – thresholds, α < β

Page 33: Performance directed energy management using  BOS technique

Results

Page 34: Performance directed energy management using  BOS technique

Results Other workloads

Application # chips ON Memory used

Xmms Mp3 player 7 112 MB

Totem media player (X-server) 25 400 MB

Mozilla,X-server, Open-office (together)

12 192 MB

ram
why did we select media applications mainly?
Page 35: Performance directed energy management using  BOS technique

Conclusion

Page 36: Performance directed energy management using  BOS technique

Conclusion

BOS technique is feasible

BOS helps us to vigorously control memory size

Chip allocation and access pattern have no correlation

Several applications do not require the full memory

Threshold based policy gives reasonable performance

An incorrect chip select could increase migration overhead

Page 37: Performance directed energy management using  BOS technique

Summary BOS philosophy Implementation of BOS

Mechanism Page migration Invisible buddy Chip recovery Chip access pattern

Policy Study of sample workloads Threshold based policy

Page 38: Performance directed energy management using  BOS technique

Acknowledgements lxr.linux.no We would like to thank the following people for

their valuable time and for the immensely helpful discussions in the course of this project Remzi H. Arpaci-Dusseau Muthian Sivathanu Vijayan Prabhakaran Lakshmi Bairavasundaram

Amit Jhawar for resources

Page 39: Performance directed energy management using  BOS technique

?

Page 40: Performance directed energy management using  BOS technique

References1. Huang et.al. “Design and Implementation of Power-Aware

Virtual Memory”, USENIX 2003.

2. Lebeck et.al. “ Power Aware Page Allocation”, ASPLOS 2000.

3. Li et.al. “Performance directed energy management for main memory and disks”, ASPLOS 2004.

4. Delaluz et.al. “Scheduler-Based DRAM Energy Management”, DAC 2002.

Page 41: Performance directed energy management using  BOS technique

Related Work Power Aware Virtual Memory [1]

Per process chip select Localized per process page allocation Performance not considered

Execution Time based energy management [ref] Hardware support for energy management

Various power modes in RAMBUS Various power modes in disks

Page 42: Performance directed energy management using  BOS technique

Tough nuts to crack Absolutely no Documentation for Linux 2.6 memcpy() Alternate recovery mechanism Multiple chip select policy Alternate Allocator mechanism Removing from LRU