SmartSaver: Turning Flash Drive into a Disk Energy Saver for Mobile Computers

Similar documents
SmartSaver: Turning Flash Drive into a Disk Energy Saver for Mobile Computers

Flash Memory Based Storage System

Feng Chen and Xiaodong Zhang Dept. of Computer Science and Engineering The Ohio State University

FlexFetch: A History-Aware Scheme for I/O Energy Saving in Mobile Computing

PS-BC: Power-saving Considerations in Design of Buffer Caches Serving Heterogeneous Storage Devices

Caching for Bursts (C-Burst): Let Hard Disks Sleep Well and Work Energetically

L9: Storage Manager Physical Data Organization

Caching for Bursts (C-Burst): Let Hard Disks Sleep Well and Work Energetically

Operating Systems Design Exam 2 Review: Spring 2011

A Comparison of File. D. Roselli, J. R. Lorch, T. E. Anderson Proc USENIX Annual Technical Conference

CS 416: Opera-ng Systems Design March 23, 2012

STORING DATA: DISK AND FILES

File System Internals. Jo, Heeseung

Presented by: Nafiseh Mahmoudi Spring 2017

Disks & Files. Yanlei Diao UMass Amherst. Slides Courtesy of R. Ramakrishnan and J. Gehrke

CS 3733 Operating Systems:

6.033 Computer System Engineering

CS 4284 Systems Capstone

ASEP: An Adaptive Sequential Prefetching Scheme for Second-level Storage System

Database Systems. November 2, 2011 Lecture #7. topobo (mit)

Virtual Memory. Reading. Sections 5.4, 5.5, 5.6, 5.8, 5.10 (2) Lecture notes from MKP and S. Yalamanchili

Computer Systems Laboratory Sungkyunkwan University

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 18: Naming, Directories, and File Caching

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 18: Naming, Directories, and File Caching

Operating Systems. Lecture File system implementation. Master of Computer Science PUF - Hồ Chí Minh 2016/2017

Operating Systems Design Exam 2 Review: Spring 2012

Disk Scheduling COMPSCI 386

Disks, Memories & Buffer Management

Chapter-6. SUBJECT:- Operating System TOPICS:- I/O Management. Created by : - Sanjay Patel

Memory Management. Chapter 4 Memory Management. Multiprogramming with Fixed Partitions. Ideally programmers want memory that is.

Memory management. Last modified: Adaptation of Silberschatz, Galvin, Gagne slides for the textbook Applied Operating Systems Concepts

Storing Data: Disks and Files. Storing and Retrieving Data. Why Not Store Everything in Main Memory? Database Management Systems need to:

CHAPTER 8: MEMORY MANAGEMENT. By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

EECS 482 Introduction to Operating Systems

Memory Management. Dr. Yingwu Zhu

Chapter 4 Memory Management. Memory Management

Disks and Files. Storage Structures Introduction Chapter 8 (3 rd edition) Why Not Store Everything in Main Memory?

CS252 S05. Main memory management. Memory hardware. The scale of things. Memory hardware (cont.) Bottleneck

Storing and Retrieving Data. Storing Data: Disks and Files. Solution 1: Techniques for making disks faster. Disks. Why Not Store Everything in Tapes?

File Systems. ECE 650 Systems Programming & Engineering Duke University, Spring 2018

Storing Data: Disks and Files. Storing and Retrieving Data. Why Not Store Everything in Main Memory? Chapter 7

Chapter 8: Memory-Management Strategies

Storing and Retrieving Data. Storing Data: Disks and Files. Solution 1: Techniques for making disks faster. Disks. Why Not Store Everything in Tapes?

Cache Performance (H&P 5.3; 5.5; 5.6)

Background. 20: Distributed File Systems. DFS Structure. Naming and Transparency. Naming Structures. Naming Schemes Three Main Approaches

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Memory Management

Computer Architecture and System Software Lecture 09: Memory Hierarchy. Instructor: Rob Bergen Applied Computer Science University of Winnipeg

CS 525M Mobile and Ubiquitous Computing Seminar. Michael Theriault

Storing Data: Disks and Files

Basic Memory Management

CHAPTER 8 - MEMORY MANAGEMENT STRATEGIES

Chapter 8: Main Memory

Multimedia Streaming. Mike Zink

Quiz for Chapter 6 Storage and Other I/O Topics 3.10

Virtual Memory Design and Implementation

UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering. Computer Architecture ECE 568

Chapter 8: Main Memory. Operating System Concepts 9 th Edition

UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering. Computer Architecture ECE 568

!! What is virtual memory and when is it useful? !! What is demand paging? !! When should pages in memory be replaced?

Basic Memory Management. Basic Memory Management. Address Binding. Running a user program. Operating Systems 10/14/2018 CSC 256/456 1

ECE331: Hardware Organization and Design

File System Internals. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Chapter 8: Main Memory

Performance of Various Levels of Storage. Movement between levels of storage hierarchy can be explicit or implicit

OS and Hardware Tuning

Chapter 9 Memory Management

Chapter 17: Distributed-File Systems. Operating System Concepts 8 th Edition,

A Simulation: Improving Throughput and Reducing PCI Bus Traffic by. Caching Server Requests using a Network Processor with Memory

2. PICTURE: Cut and paste from paper

Review 1-- Storing Data: Disks and Files

Deploy a High-Performance Database Solution: Cisco UCS B420 M4 Blade Server with Fusion iomemory PX600 Using Oracle Database 12c

Principles of Data Management. Lecture #2 (Storing Data: Disks and Files)

Storing Data: Disks and Files

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

OS and HW Tuning Considerations!

CS510 Operating System Foundations. Jonathan Walpole

Topics: Memory Management (SGG, Chapter 08) 8.1, 8.2, 8.3, 8.5, 8.6 CS 3733 Operating Systems

Systems Architecture II

CS6401- Operating System UNIT-III STORAGE MANAGEMENT

Chapter 8: Memory- Management Strategies. Operating System Concepts 9 th Edition

ECE 650 Systems Programming & Engineering. Spring 2018

I/O Device Controllers. I/O Systems. I/O Ports & Memory-Mapped I/O. Direct Memory Access (DMA) Operating Systems 10/20/2010. CSC 256/456 Fall

CMSC 424 Database design Lecture 12 Storage. Mihai Pop

Conoscere e ottimizzare l'i/o su Linux. Andrea Righi -

CS 31: Intro to Systems Caching. Kevin Webb Swarthmore College March 24, 2015

Chapter 8 & Chapter 9 Main Memory & Virtual Memory

L7: Performance. Frans Kaashoek Spring 2013

Topics. File Buffer Cache for Performance. What to Cache? COS 318: Operating Systems. File Performance and Reliability

Operating Systems. Week 9 Recitation: Exam 2 Preview Review of Exam 2, Spring Paul Krzyzanowski. Rutgers University.

Outlines. Chapter 2 Storage Structure. Structure of a DBMS (with some simplification) Structure of a DBMS (with some simplification)

Embedded Systems Dr. Santanu Chaudhury Department of Electrical Engineering Indian Institute of Technology, Delhi

Operating Systems. Operating Systems Professor Sina Meraji U of T

The Google File System

SRM-Buffer: An OS Buffer Management SRM-Buffer: An OS Buffer Management Technique toprevent Last Level Cache from Thrashing in Multicores

Introduction to OpenMP. Lecture 10: Caches

APP: MINIMIZING INTERFERENCE USING AGGRESSIVEPIPELINED PREFETCHING IN MULTI-LEVEL BUFFER CACHES

FILE SYSTEMS, PART 2. CS124 Operating Systems Fall , Lecture 24

UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering. Computer Architecture ECE 568

Parser. Select R.text from Report R, Weather W where W.image.rain() and W.city = R.city and W.date = R.date and R.text.

Virtual Memory Management

Transcription:

SmartSaver: Turning Flash Drive into a Disk Energy Saver for Mobile Computers Feng Chen 1 Song Jiang 2 Xiaodong Zhang 1 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 Energy Consumption (W) 2.0 1.6 0.15 0.0 Active State Idle State Receive request #1 Standby State 0 1 2 Disk is idle for 20 seconds, spin it down Disk sleeps Receive and energy request is saved #2, spin up disk Standby State 22 38 39 Time (second) Active State Idle 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 Our goal --- using the low-cost and low energy flash drive to save disk energy 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.

Main idea SmartSaver uses flash memory to cache and prefetch disk data to be reused and used later. Two-fold goals Effectively extend disk idle periods and save disk energy Optimize flash drive usage by effectively caching and prefetching the useful data.

Outline Issues and Challenges Scheme Design Performance Evaluation Conclusion

Issues and Considerations Two characteristics of the flash drive Low 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

Related work Disk energy-saving schemes Selecting good timeout threshold Fixed[4] / adaptive[5,6] timeout threshold Cons Only passively monitor disk I/O operations w/o extending disk idle time on purpose Extending disk idle time by customizing system or application software for energy saving [3][7] Cons significant changes to existing buffer cache management New hardware design DRPM[8] Tunable disk rotational speed on the fly Cons inavailable in mainstream commercial market.

Related work Flash memory for energy saving Using flash memory as a new layer between main memory and the hard disk[9] Cons inefficiently cache every byte transferred between main memory and the hard disk Using flash memory as a write only cache when disk is idle[10] Only deals with write-back traffic to avoid spinning up standby disk, no prefetching and caching. Some other work[11][12] also notices the low-power features of flash memory, but no further discussion on how to save disk energy w/ efficient use of flash.

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 Flash drive Disk Disk

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

Two principles Always keep the two specific characteristics of the flash drive in mind during our scheme design low write bandwidth limited erasure cycles Always identify and store only the most valuable data in the flash drive for energy saving Benefit how much energy could be saved Cost how much flash space would be demanded

SmartSaver Design A flash drive is into three areas for: Main memory Caching Prefetching Writeback Caching Prefetching writeback The data allocations to the areas are balanced and adaptive. Disk read write

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 Busy period quiet period Energy Consumption (W) 2.0 1.6 0.15 0.0 0 Active State 1 2 Idle State Active State Idle State Standby State 22 38 39 Time (second)

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. Busy period quiet period quiet period Energy Consumption (W) 2.0 1.6 0.15 0.0 0 Active State 1 2 Idle State Active State Idle State Standby State 22 38 39 Time (second)

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) E s = Energy (Jr) that could be saved if one busy period is avoided (proportional to the thinking time) B d = Data bytes accessed during the busy period ESR = E s / B d (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 Busy period quiet period Busy period Logic Block Number 10 5 0 0 12 1 2 11 12 12 11 Envelope 5 22 50 80 Time (second) 4 2 1 4 2 1 Envelope 6 LRU LRU

Flash Drive Replacement Energy-saving-oriented Replacement A 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.

43 9 Envelope (ESR=25) 9 L=40 55 17 Envelope (H=85, ESR=45, L=40) 15 8 11 10 Envelope (H=75, ESR=50, L=25) 5 7 4 2 Envelope (H=70, ESR=60, L=10) 6 1 12 11 Envelope (H=55, ESR=50, L=5) 5 A global inflation value w/ initial value 0 and keeps inflated, (the H value of the last replaced envelop). Step 1: use the H value of Envelop 5 Envelope Stack H = ESR + Envelope s L Global ESR value inflation value L Envelopes (how sorted much in (how energy likely could the envelope ascending Replace be order saved) Envelope of H could 5 be reaccessed) at the stack bottom to inflate L value

Step 4: insert envelope 9 into the envelope stack according to its H value 43 9 Envelope (ESR=25) 9 H= ESR+L=80 L=55 Step 3: Calculate H value of new envelope 9 using the up-to-date L 55 17 Envelope (H=85, ESR=45, L=40) 15 8 11 43 10 Envelope (H=75, ESR=50, L=25) 95 9 (H=80, ESR=55, L=55) 7 4 2 Envelope (H=70, ESR=60, L=10) 6 1 12 Envelope (H=55, ESR=50, L=5) 11 5 Step 2: reclaim envelope 5 Envelope Stack

SmartSaver Task 2: Prefetching Goal Preload long sequential disk accesses (such as video streams) in the beginning of the sessions. Issues Enlarge the disk quiet periods. How to identify sequential access patterns How to avoid inefficient prefetching decisions How to coordinate prefetching with other concurrent disk events

Identifying Sequential Access Patterns Objective Avoid intrusive changes to existing performancecritical 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 pages), initiate a prefetching stream If windows are shrunk, terminate a prefetching stream

Avoiding Inefficient Prefetching Goal Considering the low write bandwidth and limited erasure cycles, we have to avoid inefficient prefetching to reduce the amount of data written to the flash drive Rate-based applications Applications holding a steady rate of data consumption, such as xmms and mplayer.

How to avoid inefficient prefetching Two factors Data consumption rate (DCR) DCR < flash write bandwidth DCR < Size prefetching-area / Time break-even Prefetching time Lower bound disk break-even time Upper bound too aggressive prefetching brings diminishing benefits

Coordinating with Concurrent Disk Events Long disk idle period created by prefetching could be foiled by concurrent disk events. For example, Prefetching 4 minutes movie clips Running virus-scanning program on background We must coordinate our prefetching mechanism with other concurrent disk events to avoid overshooting prefetching

How to coordinate with concurrent disk events Two types of disk events spinning up a standby disk Bumps when a stream uses up its prefetched data blocks Holes other disk events, such as cold misses Coordinating bumps and holes If one bump appears, it means prefetching is too conservative. Double current prefetching time to make it more aggressive If one hole appears, it means prefetching is overshot. Reduce current prefetching time to the interval of two most recent holes. Double prefetching time = 20*2=40 Disk Events Bumps Holes Shrink prefetching time = 10 0.0 0 1 21 30 40 Time (second)

Task 3: Writeback via Flash Drive Goal In most OS kernels, dirty blocks are periodically flushed back to the 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 utility Modified strace utility can intercept all fileoperation related system calls, e.g. read(). Collected info: PID, file descriptor, inode number, 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 collected. 5 single-application traces 2 multi-application traces 2 typical mobile computing senarios are generated by concatenating individual application traces one by one Programming Networking Table 2. Description of traces

Case-1 : programming The Programming scenario is composed of eight stages Make, Grep, xmms, make, grep, Scp-r, make, grep

Case-1 : programming Linux w/ 64MB memory Linux 89.1% w/ 128MB disk idle memory periods are -- 73.3% not long idle enough periods are (<16sec shorter than ) for 16 saving sec. disk energy Baseline w/ 64MB memory and 128MB flash 79.3% idle periods are shorter than 16 sec. SmartSaver w/ 64MB memory and 128MB flash drive only 30.8% disk idle periods are invalid for energy saving Disk break-even time (16 seconds) if disk is idle < 16 sec, NO energy could be saved. 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 breakeven time.

Case-1 : programming 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. SmartSaver achieves better energy conservation SmartSaver uses the flash drive more efficiently

Case-1 : programming Linux cannot accommodate the working-set in memory, thus, Linux has disk accesses at all eight stages Baseline flushes working-set of make and caches the working-set of scp-r in the flash drive. Baseline caches the working-set of make in the flash drive, thus, disk is idle for 822 seconds at stage 4 and 5. Disk has to be spun up for make again. Disk I/O activities of three schemes w/ 64MB memory and/or 128MB flash drive 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 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. Baseline cannot extend disk idle time, as the disk activities are dominated by one-time accesses. SmartSaver effectively extends disk idle time through prefetching

Case-2 : networking 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. SmartSaver achieves better energy conservation SmartSaver uses the flash drive more efficiently

Case-2 : networking 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. Disk I/O activities of three schemes w/ 64MB memory and/or 128MB flash drive 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 written 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.