smartsaver: turning flash drive into a disk energy saver for mobile computers
Post on 01-Jan-2016
25 Views
Preview:
DESCRIPTION
TRANSCRIPT
SmartSaver: Turning Flash Drive into a Disk Energy Saver for Mobile Computers
Feng Chen1 Song Jiang2 Xiaodong Zhang1
The Ohio State University, USA Wayne State University, USA
Disks Cost High Energy in Mobile Computers
Battery life is always limited to mobile computers.
Hard disks account for a considerable amount of energy consumption in mobile computers, such as laptops.
Efforts to save disk energy is limited by its mechanics High disk energy consumption mainly stems from rotational disk
platters.
Hard Disk Energy Consumption States
Four power consumption states Active – reading/writing/seeking Idle – disk platters keep spinning, electricity is partially
powered down Standby – disk platters are spun down, and disk arms
are parked Sleep – remaining components powered off
How to save disk energy? Switch from high energy consumption state (Active/idle) to lower
energy consumption state (standby).
Energy Consuming Cycles Once the hard disk is idle for a specific period (timeout
threshold), disk is spun down to save energy Upon arrival of a request, disk is spun up to serve the requests. Spin up/down disk raises substantial energy and time overhead
Time (second)
En
erg
y C
on
sum
ptio
n (
W)
0.15
1.6
2.0
1 200.0
22 38 39
Idle State
Standby State
Active State
Receive request #1
Disk is idle for 20 seconds, spin it down
Disk sleeps and energy is savedReceive request #2, spin up disk
Active State
Idle State
Standby State
Flash Drive is Low Energy Device
A portable storage device for almost every mobile computer user on the road
Features Low cost Compact size Nonvolatile storage – not as dynamic as main memory No mechanical components – not as slow as disk Low power consumption
E.g. Active Power: 0.024w (flash) vs. 0.624w (disk): 26 times! The power difference for standby mode is 2500 times.
Unfortunately, the flash drive is still mainly used for file transfer and temporary storage.
Our goal --- using the low-cost and low energy flash drive to save disk energy
Our goal --- using the low-cost and low energy flash drive to save disk energy
Main idea
SmartSaver uses flash memory to cache and prefetch disk data to be reused and used later.
Two-fold goalsEffectively extend disk idle periods and save disk en
ergy Optimize flash drive usage by effectively caching a
nd prefetching the useful data.
Issues and Considerations
Two characteristics of the flash driveLow write bandwidth
Only 8MB/sec for Transcend TS1GJF2A flash drive
Limited erasure/rewrite cycles Typically 100,000 overwrites
Design considerations These two specifics are in our design consideration
An Intuitive Idea “Baseline” (MarSh’94)
Insert the flash drive between main memory and the hard disk as a new layer in the storage hierarchy.
Cache every byte loaded from disk or evicted from main memory
Uses LRU to free space when the flash drive is full Accesses to disks are hoped to be absorbed by flash
drive
Main memory Main memory
Disk Disk
Flash drive
Four Ignored Issues in ``Baseline”
Flash drive does not fit well in the storage hierarchy. Flash drive w/ low write bandwidth would become a
bottleneck One-time access data should not be cached at all
It caches everything including one-time accessed data. Data should be selectively cached in flash drive
Data w/ good locality – frequently reused data Data w/ high energy consumption – data that move slowly
from/to the disk and keep disk active for a long period Data should be replaced carefully
Hold data w/ good locality or high energy consumption
SmartSaver Design A flash drive is into thr
ee areas for:
Caching Prefetching Writeback
The data allocations to the areas are balanced and adaptive.
Main memory
Disk
Caching Prefetching writeback
readwrite
Busy Period and Quiet Period Busy period
between the disk spin-up and its consecutive spin-down Quiet period
between the disk spin-down and its consecutive spin-up
Time (second)
En
erg
y C
on
sum
ptio
n (
W)
0.15
1.6
2.0
1 200.0
22 38 39
Active State
Idle State
Standby State
Active State
Idle State
Busy period quiet period
SmartSaver Extends Disk Quiet Period The goal is to minimize busy periods by serving requests using
data in the flash drive The longer busy periods are reduced, the more energy could be
saved.
Time (second)
En
erg
y C
on
sum
ptio
n (
W)
0.15
1.6
2.0
1 200.0
22 38 39
Standby State
Active State
Idle State
Active State
Idle State
Busy period quiet periodquiet period
SmartSaver Task 1: Caching
Caching two types of data in flash drive Frequently used data Disk data with high thinking time.
Comparisons of thinking times Gzip – 10 seconds to compress one file Glimpse – 1 minute to build index for the same file Caching the file generated by Glimpse can save more
energy than that by gzip.
Energy Saving Rate (ESR)
Es = Energy (Jr) that could be saved if one busy period is avoided (proportional to the thinking time)
Bd = Data bytes accessed during the busy period ESR = Es / Bd (energy consumption per Byte)
For example, ESR (Glimpse) > ESR (gzip)
ESR describes how much energy could be saved by caching one
chunk of data in flash drive by avoiding its busy period.
Envelope: A Mechanism to Monitor Disk Energy Usage
Envelope – a data structure to monitor accessed data blocks during a busy period.
An envelope is created in each completed busy period.
Upon a completion of a busy period, its ESR value is calculated for its envelope.
Blocks accessed during a busy period are recorded in its envelope in the LRU order.
If one envelope is selected based on two factors, all its data blocks are written to the flash drive.
Cached envelopes are placed in a queue, called envelope stack.
Enevelope
Time (second)
Lo
gic
Blo
ck N
um
be
r
1 200
22 80
quiet period
4
12
Busy periodBusy period
1211
12
50
5
10
4
1
2
Envelope6
12
11
Envelope5
LR
U
LR
U
Flash Drive Replacement
Energy-saving-oriented ReplacementA block’s value for energy saving
How much energy could be saved How likely it is to be reassessed
Challenge how to evaluate and compare two blocks’ values
for energy saving simultaneously using these two orthogonal metrics?
Envelope stack is used to achieve the goals.
4
10
5
55
17
15
11
1
2 Envelope6
Envelope7
Envelope8
12
11Envelope
5L=40
9
43
Envelope9
(ESR=25)
Envelope Stack
A global inflation value w/ initial value 0 and keeps inflated, (the H value of the last replaced envelop).
(H=55, ESR=50, L=5)
(H=70, ESR=60, L=10)
(H=75, ESR=50, L=25)
(H=85, ESR=45, L=40)
Envelope’s ESR value (how much energy could be saved)
Global inflation value L (how likely the envelope could be reaccessed)
H = ESR + LEnvelopes sorted in ascending order of H Replace Envelope5
at the stack bottom
Step 1: use the H value of Envelop5 to inflate L value
55
17
15
11
Envelope8
L=55
9
43
Envelope9
(ESR=25)
Envelope Stack
12
11Envelope
5(H=55, ESR=50, L=5)
4
10
5
1
2 Envelope6
Envelope7
(H=70, ESR=60, L=10)
(H=75, ESR=50, L=25)
(H=85, ESR=45, L=40)
Step 3: Calculate H value of new envelope
9
using the up-to-date L
Step 2: reclaim envelope5
Step 4: insert envelope9 into the
envelope stack according to its H value
9
43Envelope
9 (H=80, ESR=55, L=55)
H= ESR+L=80
Envelope9
(ESR=25)
SmartSaver Task 2: Prefetching
Goal Preload long sequential disk accesses (such as video
streams) in the beginning of the sessions. Enlarge the disk quiet periods.
Issues How to identify sequential access patterns How to avoid inefficient prefetching decisions How to coordinate prefetching with other concurrent di
sk events
Identifying Sequential Access Patterns Objective
Avoid intrusive changes to existing performance-critical buffer cache management in OS kernels
Existing Linux file-level prefetching mechanism Two read-ahead windows to detect the sequential file
accesses Windows are expanded, if accesses is sequential Windows are shrunk, if accesses become random
Indirect pattern detection mechanism Monitor changes of window sizes If windows are enlarged to its maximum size (32 page
s), initiate a prefetching stream If windows are shrunk, terminate a prefetching stream
Task 3: Writeback via Flash Drive
Goal In most OS kernels, dirty blocks are periodically flushed back to t
he disk to avoid losing data in volatile memory Linux writes dirty blocks older than 30 sec back every 5 sec.
Such periodical disk accesses conflict with disk energy saving Solutions:
If the disk is in the standby state, SmartSaver redirect writeback traffic to the flash drive; otherwise, dirty blocks are directly written to the disk.
If the disk is back to the active state and 90% of the writeback area is full, all the dirty blocks are written back to the disk.
If the writeback area is overflowed, the disk is spun up to write back all the dirty blocks.
Balancing the three areas
Goal As the flash drive is partitioned into three areas, tuning the sizes
of three areas on-line is desired to achieve optimal energy saving
Solution SmartSaver monitors accesses to each area and periodically
evaluates the amount of energy saved due to the addition of N blocks.
Each time N blocks are reclaimed from the least “productive” area, where adding N more blocks can achieve less increased energy saving than adding them to other areas, and allocated to the most “productive” one.
Trace-driven Simulation Evaluation
Simulating major linux kernel components 2Q-like memory page replacement algorithm Two-window file prefetching scheme I/O request clustering mechanism
Three disk energy-saving schemes are simulated Linux laptop mode (Linux) Baseline flash-memory-based scheme (Baseline) Our disk energy-saving scheme (SmartSaver)
Simulated disk
HITACHI-DK23DA hard disk 30GB 4200RPM 35MB/sec peak bandwidth Avg. seek time: 13.0 ms Avg. rotation time: 7.1 ms Timeout threshold: 20 sec
Table 1. Energy-related parameters
Simulated Flash drive
Transcend TS1GJF2A flash drive Read bandwidth: 12MB/sec Write bandwidth: 8MB/sec Active power consumption: 0.365W Sleep power consumption: 0.6mW
Traces
Strace utilityModified strace utility can intercept all file-ope
ration related system calls, e.g. read().Collected info: PID, file descriptor, inode num
ber, offset, size, type, timestamp, and duration
Blocks of traced files are sequentially mapped to a simulated disk with small random distance between files
Traces 8 traces of 7 typical applications used in a mobile computing environment are co
llected. 5 single-application traces 2 multi-application traces 2 typical mobile computing senarios are generated by concatenating individual a
pplication traces one by one Programming Networking
Table 2. Description of traces
Case-1 : programming
The Programming scenario is composed of eight stages
Make, Grep, Scp-r,xmms, make, grep, make, grep
Case-1 : programming
Unusable Idleness Percentage (UIP) the lower a UIP is, the more energy could be saved
SmartSaver can effectively extend disk idle time longer than the disk break-even time.
Disk break-even time (16 seconds) – if disk is idle < 16 sec, NO energy could be saved.
Linux w/ 64MB memory – 89.1% disk idle periods are not long enough (<16sec ) for saving disk energy
Linux w/ 128MB memory-- 73.3% idle periods areshorter than 16 sec.Baseline w/ 64MB memoryand 128MB flash – 79.3% idle periods are shorter than 16 sec.SmartSaver w/ 64MB memory and 128MB flashdrive – only 30.8% disk idleperiods are invalid for energysaving
Case-1 : programming
SmartSaver achieves better energy conservation SmartSaver uses the flash drive more efficiently
SmartSaver saves 41.0% more energy than Linux
SmartSaver writes 46.6% less data to the flash drive than Baseline, but reads 50% more data from the flash drive.
Case-1 : programming
Disk I/O activities of three schemes w/ 64MB memory and/or 128MB flash drive
Linux cannot accommodate the working-set in memory, thus, Linux has disk accesses at all eight stages
Baseline caches the working-set of “make” in the flash drive, thus, disk is idle for 822 seconds at stage 4 and 5.
Baseline flushes working-set of “make” and caches the working-set of “scp-r” in the flash drive.
Disk has to be spun up for “make” again.
SmartSaver starts prefetching for “xmms”.
SmartSaver caches the working-set of “make”.SmartSaver protects the working-set of “make” from being evicted by “scp-r”.
Disk is idle and “make” is satisfied in the flash drive.
Case-2 : networking
The networking scenario is composed of three stages
Thunderbird, Scp-mplayer, ftp-mplayer
Case-2 : networking
Baseline cannot extend disk idle time, as the disk activities are dominated by one-time accesses.
SmartSaver effectively extends disk idle time through prefetching
Linux & Baseline – around 73% disk idle times are too short to save disk energy
SmartSaver w 128MB flash drive – only 16.7% disk idle times are shorter than 16 sec.
Case-2 : networking
SmartSaver achieves better energy conservation SmartSaver uses the flash drive more efficiently
SmartSaver saves 41.8% more energy than Linux
SmartSaver writes 22.8% less data to the flash drive than Baseline, but reads 707.6% more data from the flash drive.
Case-2 : networking
Disk I/O activities of three schemes w/ 64MB memory and/or 128MB flash drive
Baseline cannot deal with the one-time access dominated workload.
SmartSaver does not prefetch for both “scp”, whose data consumption rate is 8MB/sec, and “mplayer”, since disk keeps active.
After “scp” completes, SmartSaver prefetches for mplayer.
In contrast, SmartSaver prefetches for “ftp” and mplayer”, both of which have a low consumption rate.
Implementation Related Discussion
Overhead of inserting envelope into the stack Only one insert sort operation per busy period, which is usually minutes
long. Overhead is amortized over all accessed data blocks
Wear-leveling SmartSaver does not conduct its own wear-leveling SmartSaver saves limited erasure cycles by reducing amount of data wr
itten to the flash drive, rather than creating even distribution of data written over the flash drive.
SmartSaver is complementary to existing wear-leveling techs Data integrity
Dirty blocks could be flushed back to the disk when disk is active Mandatory write back of dirty blocks before detaching flash drive
Conclusion
We identify some critical issues involved in using the flash drive for saving disk energy
We designed a comprehensive set of solutions to maintain an effective use of the flash drive to achieve three goals Accommodating the unique prosperities of the flash drive Minimizing intrusive OS kernel changes Significantly improving disk energy saving
Trace driven simulations for typical mobile computing scenarios show SmartSaver can save up to 41.8% disk energy compared with existing policies in Linux.
Reference [1] Intel. Intel mobile platform vision guide for 2003 [2] P.Cao and S. Irani. Cost-aware www proxy caching algorithms.USENIX’97 [3] A.E. Papathanasiou and M. L. Scott. Energy efficient prefetching and caching. USENIX’04 [4]F. Douglis, P. Krishnan, and B. Marsh. Thwarting the power-hungry disk. In Proc. of USENIX’94, Jan. 1994. [5]F. Douglis, P. Krishnan, and B. Bershad. Adaptive disk spin-down policies for mobile computers. In Computing
Systems, volume 8(4), pages 381–413, 1995. [6]D. P. Helmbold, D. D. E. Long, and B. Sherrod. A dynamic disk spin-down technique for mobile computing. In P
roc. of the 2nd Annual International Conference on Mobile Computing and Networking, 1996. [7]A. Weissel, B. Beutel, and F. Bellosa. Cooperative io – a novel io semantics for energy-aware applications. In P
roc. of OSDI’02, Dec. 2002. [8]S. Gurumurthi, A. Sivasubramaniam, M. Kandemir, and H. Franke. Drpm: Dynamic speed control for power ma
nagement in server class disks. In Proc. of ISCA’03, 2003. [9]B. Marsh, F. Douglis, and P. Krishnan. Flash memory file caching for mobile computers. In Proc. of the 27 th Ha
waii Conference on Systems Science, Hawaii, 1994. [10]T. Bisson and S. Brandt. Reducing energy consumption with a non-volatile storage cache. In Proc. of Internati
onal Workshop on Software Support for Portable Storage, San Francisco, CA, March 2005. [11]E. B. Nightingale and J. Flinn. Energy-efficiency and storage flexibility in the blue file system. In Proc. of OSDI’
04, SF, CA, Dec. 2004. [12]F. Zheng, N. Garg, S. Sobti, C. Zhang, R. E. Joseph, A. Krishnamurty, and R. Y. Wang. Considering the ener
gy consumption of mobile storage alternatives. In Proc. of MASOCTS’03, Oct. 2003.
4
10
5
55
17
15
11
1
2 Envelope6(H=70, ESR=60, L=10)
Envelope7(H=75, ESR=50, L=25)
Envelope8(H=85, ESR=45, L=40)
12
11Envelope
5(H=55, ESR=50, L=5)L=55
9
43
Envelope9
(ESR=55, L=55)
H= ESR+L=110
Step 1: Reclaim victim envelope5
Step 2: Update L value with H (55) of envelope
5
Step 3: Calculate H value of new envelope
9
Step 4: Insert envelope9 to envelope stack
Envelope Stack
Measurement of period length of active disk state Disk Active State
Transfer time – sizeof (request) / bandwidth
Rotation time – random(0-14.2ms)
Seek time – a seek profile generated from real disk trace
Figure 1. Seek profile
Case-2 : networking
The networking scenario is composed of eight stagesThunderbird, scp-mplayer, and ftp-mplayer
top related