inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 26 IO Basics, Storage & Performance I ! HACKING THE SMART GRID!

Similar documents
Goals for today:! Recall : 5 components of any Computer! ! What do we need to make I/O work?!

Motivation for Input/Output

UCB CS61C : Machine Structures

Computer Science 61C Spring Friedland and Weaver. Input/Output

CS 61C: Great Ideas in Computer Architecture. Input/Output

www-inst.eecs.berkeley.edu/~cs61c/

UCB CS61C : Machine Structures

CS61C : Machine Structures

CS61C - Machine Structures. Week 7 - Disks. October 10, 2003 John Wawrzynek

CS61C : Machine Structures

CS61C : Machine Structures

Recap of Networking Intro. Lecture #28 Networking & Disks Protocol Family Concept. Protocol for Networks of Networks?

Review. Motivation for Input/Output. What do we need to make I/O work?

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 38: IO and Networking

ECE232: Hardware Organization and Design

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

UCB CS61C : Machine Structures

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

Review. Manage memory to disk? Treat as cache. Lecture #26 Virtual Memory II & I/O Intro

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 36: IO Basics. Instructor: Dan Garcia h<p://inst.eecs.berkeley.

CS61C : Machine Structures

Storage Systems. Storage Systems

61C In the News. Review. Memory Management Today. Impact of Paging on AMAT

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

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 36: IO Basics

Administrivia. CMSC 411 Computer Systems Architecture Lecture 19 Storage Systems, cont. Disks (cont.) Disks - review

CS2410: Computer Architecture. Storage systems. Sangyeun Cho. Computer Science Department University of Pittsburgh

Chapter 6. Storage & Other I/O

COMP283-Lecture 3 Applied Database Management

ECE331: Hardware Organization and Design

Computer Science 146. Computer Architecture

I/O CANNOT BE IGNORED

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

CPS104 Computer Organization and Programming Lecture 18: Input-Output. Outline of Today s Lecture. The Big Picture: Where are We Now?

I/O CANNOT BE IGNORED

Where We Are in This Course Right Now. ECE 152 Introduction to Computer Architecture Input/Output (I/O) Copyright 2012 Daniel J. Sorin Duke University

Storage systems. Computer Systems Architecture CMSC 411 Unit 6 Storage Systems. (Hard) Disks. Disk and Tape Technologies. Disks (cont.

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 24: More I/O: DMA, Disks, Networking

High-Performance Storage Systems

Reading and References. Input / Output. Why Input and Output? A typical organization. CSE 410, Spring 2004 Computer Systems

Lecture 23: Storage Systems. Topics: disk access, bus design, evaluation metrics, RAID (Sections )

Database Management Systems, 2nd edition, Raghu Ramakrishnan, Johannes Gehrke, McGraw-Hill

CSCI-GA Database Systems Lecture 8: Physical Schema: Storage

CS61C : Machine Structures

Readings. Storage Hierarchy III: I/O System. I/O (Disk) Performance. I/O Device Characteristics. often boring, but still quite important

CS152 Computer Architecture and Engineering Lecture 19: I/O Systems

Topics. Lecture 8: Magnetic Disks

Introduction to I/O. April 30, Howard Huang 1

UCB CS61C : Machine Structures

CS61C : Machine Structures

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

CS61C : Machine Structures

Lecture 13. Storage, Network and Other Peripherals

Appendix D: Storage Systems

Storage System COSC UCB

Computer System Architecture

Lecture 23: I/O Redundant Arrays of Inexpensive Disks Professor Randy H. Katz Computer Science 252 Spring 1996

! CS61C : Machine Structures. Lecture 22 Caches I. !!Instructor Paul Pearce! ITʼS NOW LEGAL TO JAILBREAK YOUR PHONE!

CSE 120. Overview. July 27, Day 8 Input/Output. Instructor: Neil Rhodes. Hardware. Hardware. Hardware

Storage. CS 3410 Computer System Organization & Programming

Lecture #28 I/O, networks, disks

Most important topics today. I/O bus (computer bus) Polling vs interrupts Switch vs shared network Network protocol layers Various types of RAID

Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted from Hennessy & Patterson / 2003 Elsevier

Chapter 6. Storage and Other I/O Topics

CSE325 Principles of Operating Systems. Mass-Storage Systems. David P. Duggan. April 19, 2011

Storage. Hwansoo Han

Today: Secondary Storage! Typical Disk Parameters!

And in Review! ! Locality of reference is a Big Idea! 3. Load Word from 0x !

Chapter 6 Storage and Other I/O Topics

Lecture 23. Finish-up buses Storage

Mass-Storage Structure

Truth Table! Review! Use this table and techniques we learned to transform from 1 to another! ! Gate Diagram! Today!

Concepts Introduced. I/O Cannot Be Ignored. Typical Collection of I/O Devices. I/O Issues

UC Santa Barbara. Operating Systems. Christopher Kruegel Department of Computer Science UC Santa Barbara

INPUT/OUTPUT DEVICES Dr. Bill Yi Santa Clara University

Performance evaluation. Performance evaluation. CS/COE0447: Computer Organization. It s an everyday process

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

Disks and RAID. CS 4410 Operating Systems. [R. Agarwal, L. Alvisi, A. Bracy, E. Sirer, R. Van Renesse]

Lecture 25: Interconnection Networks, Disks. Topics: flow control, router microarchitecture, RAID

CSE 380 Computer Operating Systems

Lectures More I/O

ECE331: Hardware Organization and Design

Input/Output. Chapter 5: I/O Systems. How fast is I/O hardware? Device controllers. Memory-mapped I/O. How is memory-mapped I/O done?

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

CSE 120. Operating Systems. March 27, 2014 Lecture 17. Mass Storage. Instructor: Neil Rhodes. Wednesday, March 26, 14

Mass-Storage. ICS332 - Fall 2017 Operating Systems. Henri Casanova

V. Mass Storage Systems

Review. Lecture #25 Input / Output, Networks II, Disks ABCs of Networks: 2 Computers

Chapter 6. I/O issues

ECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017

Database Systems II. Secondary Storage

Secondary storage. CS 537 Lecture 11 Secondary Storage. Disk trends. Another trip down memory lane

CS61C : Machine Structures

Chapter 8. A Typical collection of I/O devices. Interrupts. Processor. Cache. Memory I/O bus. I/O controller I/O I/O. Main memory.

Storage Technologies and the Memory Hierarchy

Announcement. Computer Architecture (CSC-3501) Lecture 23 (17 April 2008) Chapter 7 Objectives. 7.1 Introduction. 7.2 I/O and Performance

Key Points. Rotational delay vs seek delay Disks are slow. Techniques for making disks faster. Flash and SSDs

Physical Storage Media

CENG3420 Lecture 08: Memory Organization

Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted from Hennessy & Patterson / 2003 Elsevier

Transcription:

inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 26 IO Basics, Storage & Performance I 2010-08-04!!!Instructor Paul Pearce! HACKING THE SMART GRID! With the rapid deployment of Smart Grid technology, such as the smart meters PG&E is currently deploying throughout all of Berkeley, questions are being raised as to the safety and security and such devices.! http://www.technologyreview.com/computing/25920/ CS61C L26 IO & Performance I (1)!

Goals for today:! Today weʼre going to be giving you a VERY high level overview of system input/output. The goal is not to make you experts in any one area, but simply to give you brief exposure in a number of areas.! Weʼll also start talking about system performance, which weʼll finish up tomorrow.! Weʼre going to start with:!!!!!i/o Basics! CS61C L26 IO & Performance I (2)!

Recall : 5 components of any Computer! Earlier Lectures! Current Lecture! Computer! Processor! (active)! Control! ( brain )! Datapath! ( brawn )! Memory! (passive)! (where " programs, " data live " when" running)! Devices! Input! Output! Keyboard, Mouse" Disk,! Network " Display, Printer" CS61C L26 IO & Performance I (3)!

What do we need to make I/O work?! A way to connect many types of devices to the Proc-Mem! A way to control these devices, respond to them, and transfer data! A way to present them to user programs so they are useful! Files" APIs" Operating System! Proc" SCSI Bus" PCI Bus" Mem" cmd reg." data reg." CS61C L26 IO & Performance I (4)!

Memory Mapped I/O! Certain addresses are not regular memory! Instead, they correspond to registers in I/O devices! address" 0xFFFFFFFF" 0xFFFF0000" cntrl reg." data reg." 0" CS61C L26 IO & Performance I (5)!

Processor Checks Status before Acting! Path to device generally has 2 registers:! Control Register, says itʼs OK to read/write (I/O ready) [think of a flagman on a road]! Data Register, contains data! Processor reads from Control Register in loop, waiting for device to set Ready bit in Control reg (0 1) to say its OK! Processor then loads from (input) or writes to (output) data register! Load from or Store into Data Register resets Ready bit (1 0) of Control Register! This is called Polling! CS61C L26 IO & Performance I (6)!

What is the alternative to polling?! Wasteful to have processor spend most of its time spin-waiting for I/O to be ready if events are infrequent! 1GHz microprocessor can execute 1 billion load or store instructions per second, or 4,000,000 KB/s data rate! I/O devices data rates range from 0.01 KB/s to 125,000 KB/s! Note: When discussing transfer rates, use 10 x! Would like an unplanned procedure call that would be invoked only when I/O device is ready! Solution: use exception mechanism to help I/O. Interrupt program when I/O ready, return when done with data transfer! CS61C L26 IO & Performance I (7)!

I/O Interrupt! An I/O interrupt is like overflow exceptions except:! An I/O interrupt is asynchronous! More information needs to be conveyed! An I/O interrupt is asynchronous with respect to instruction execution:! I/O interrupt is not associated with any instruction, but it can happen in the middle of any given instruction! I/O interrupt does not prevent any instruction from completion! CS61C L26 IO & Performance I (8)!

Interrupt-Driven Data Transfer! Memory! (1) I/O! interrupt! (2) save PC! (3) jump to interrupt! service routine! (5)! (4) perform transfer! add! sub! and! or! read! store!...! jr! user! program! interrupt! service! routine! CS61C L26 IO & Performance I (9)!

disks! CS61C L26 IO & Performance I (10)!

Magnetic Disk common I/O device! A kind of computer memory! Information stored by magnetizing ferrite material on surface of rotating disk! Nonvolatile storage! retains its value without applying power to disk.! Two Types! Floppy disks slower, less dense, removable, non-existent today! Hard Disk Drives (HDD) faster, more dense, nonremovable.! Purpose in computer systems (Hard Drive):! Long-term, inexpensive storage for files! Backup for main-memory. Large, inexpensive, slow level in the memory hierarchy (virtual memory)! CS61C L26 IO & Performance I (11)!

Photo of Disk Head, Arm, Actuator! Arm" Spindle" Actuator" Head" { Platters (1-12)" CS61C L26 IO & Performance I (12)!

Administrivia! Project 2 graded under way, if you havenʼt signed up for a slot. You should get on that.! Project 3 out now! No partners for this project!! Grading underway for rest of the assignments. Will get them done ASAP! Donʼt forget to register your iclicker! http://www.iclicker.com/registration/! Final Thursday August 12 th from 8am to 11am in 10 Evans.! CS61C L26 IO & Performance I (13)!

Disk Device Terminology! Arm Head Sector Platter Inner Track Outer Track Actuator Several platters, with information recorded magnetically on both surfaces (usually)! Bits recorded in tracks, which in turn divided into sectors (e.g., 512 Bytes)! Actuator moves head (end of arm) over track ( seek ), wait for sector rotate under head, then read or write! CS61C L26 IO & Performance I (14)!

Disk Device Performance (1/2)! Outer Track Inner Track Sector Head Spindle Arm Controller Platter Actuator Disk Latency = Seek Time + Rotation Time + Transfer Time + Controller Overhead Seek Time? depends on no. tracks to move arm, speed of actuator! Rotation Time? depends on speed disk rotates, how far sector is from head! Transfer Time? depends on data rate (bandwidth) of disk (f(bit density,rpm)), size of request! CS61C L26 IO & Performance I (15)!

Disk Device Performance (2/2)! Average distance of sector from head?! 1/2 time of a rotation! 7200 Revolutions Per Minute 120 Rev/sec! 1 revolution = 1/120 sec 8.33 milliseconds! 1/2 rotation (revolution) 4.17 ms! Average no. tracks to move arm?! Disk industry standard benchmark:! Sum all time for all possible seek distances from all possible tracks / # possible! Assumes average seek distance is random! Size of Disk cache can strongly affect perf!! Cache built into disk system, OS knows nothing! CS61C L26 IO & Performance I (16)!

Where does Flash memory come in?! Microdrives and Flash memory (e.g., CompactFlash) are going head-to-head! Both non-volatile (no power, data ok)! Flash benefits: durable & lower power (no moving parts, need to spin µdrives up/down)! Flash limitations: finite number of write cycles (wear on the insulating oxide layer around the charge storage mechanism). Most 100K, some 1M W/erase cycles.! How does Flash memory work?! NMOS transistor with an additional conductor between gate and source/drain which traps electrons. The presence/absence is a 1 or 0.! en.wikipedia.org/wiki/flash_memory CS61C L26 IO & Performance I (17)!

What does Apple put in its ipods?! Toshiba flash 1, 2GB shuffle, Samsung flash Toshiba 1.8-inch HDD Toshiba flash 4, 8GB 80, 160GB 8, 16, 32GB nano, CS61C L26 IO & Performance I (18)! classic, touch

RAID : Redundant Array of Inexpensive Disks! Invented @ Berkeley (1989) by Patterson, Katz, et al.! A multi-billion industry 80% non-pc disks sold in RAIDs! Idea:! Files are striped across multiple disks in a redundant manor! Redundancy yields high data availability! Disks will still fail! Contents reconstructed from data redundantly stored in the array! Capacity penalty to store redundant info! Bandwidth penalty to update redundant info! CS61C L26 IO & Performance I (19)!

Performance! CS61C L26 IO & Performance I (20)!

Why Performance? Faster is better!! Purchasing Perspective: given a collection of machines (or upgrade options), which has the! best performance?! least cost?! best performance / cost?! Computer Designer Perspective: faced with design options, which has the! best performance improvement?! least cost?! best performance / cost?! All require basis for comparison and metric for evaluation!! Solid metrics lead to solid progress!! CS61C L26 IO & Performance I (21)!

Two Notions of Performance! Plane DC to Paris Top Speed Passengers Throughput (pmph) Boeing 747 6.5 hours 610 mph 470 286,700 BAD/Sud Concorde 1350 3 hours 132 178,200 mph Which has higher performance?! Interested in time fly one plane?! Interested in delivering as many passengers per day as possible?! In a computer, time for one task called Latency or Response Time or Execution Time! In a computer, tasks per unit time called Throughput or Bandwidth! CS61C L26 IO & Performance I (22)!

Definitions! Performance is in units of things per sec! bigger is better! If mostly concerned with response time! performance(x) =! 1!!!! execution_time(x)!! F(ast) is n times faster than S(low) means:!!performance(f)!execution_time(s)! n =!!! =!!performance(s)!execution_time(f)! CS61C L26 IO & Performance I (23)!

Example of Response Time v. Throughput! Time of Concorde vs. Boeing 747?! Concord is [6.5 hours / 3 hours = 2.2] times faster than the Boeing! Concord is 2.2 times ( 120% ) faster in terms of flying time (response time)! Throughput of Boeing vs. Concorde?! Boeing 747: 286,700 pmph / 178,200 pmph = 1.6 times faster! Boeing is 1.6 times ( 60% ) faster in terms of throughput! We will focus primarily on response time.! CS61C L26 IO & Performance I (24)!

What is Time?! Straightforward definition of time:! Total time to complete a task, including disk accesses, memory accesses, I/O activities, operating system overhead,...! real time, response time or elapsed time Alternative: just time processor (CPU) is working only on your program (since multiple processes running at same time)! CPU execution time or CPU time! Often divided into system CPU time (in OS) and user CPU time (in user program)! CS61C L26 IO & Performance I (25)!

How to Measure Time?! Real Time Actual time elapsed! CPU Time: Computers constructed using a clock that runs at a constant rate and determines when events take place in the hardware! These discrete time intervals called clock cycles (or informally clocks or cycles)! Length of clock period: clock cycle time (e.g., ½ nanoseconds or ½ ns) and clock rate (e.g., 2 gigahertz, or 2 GHz), which is the inverse of the clock period; use these!! CS61C L26 IO & Performance I (26)!

Measuring Time using Clock Cycles (1/2)! CPU execution time for a program! Units of [seconds / program] or [s/p]! = Clock Cycles for a program x Clock Period! Or! Units of [s/p] = [cycles / p] x [s / cycle] = [c/p] x [s/c]! = Clock Cycles for a program [c / p] Clock Rate [c / s]! CS61C L26 IO & Performance I (27)!

Measuring Time using Clock Cycles (2/2)! One way to define clock cycles:! Clock Cycles for program [c/p]! = Instructions for a program [i/p]!!(called Instruction Count )! x Average Clock cycles Per Instruction [c/i]!!(abbreviated CPI )! CPI one way to compare two machines with same instruction set, since Instruction Count would be the same! CS61C L26 IO & Performance I (28)!

Peer Instruction! 1) Processors must communicate with I/O devices via special instructions.! 2) For devices with low I/O event frequency polling is a better choice than interrupts.! 12 a) FF b) FT c) TF d) TT CS61C L26 IO & Performance I (29)!

And in conclusion! I/O gives computers their 5 senses! Vast I/O speed range! Processor speed means must synchronize with I/O devices before use! Polling works, but expensive! processor repeatedly queries devices! Interrupts works, more complex! devices causes an exception, causing OS to run and deal with the device! Latency v. Throughput! Real Time: time user waits for program to execute: depends heavily on how OS switches between tasks! CPU Time: time spent executing a single program: depends solely on design of processor (datapath, pipelining effectiveness, caches, etc.)! CS61C L26 IO & Performance I (31)!

Bonus slides! These are extra slides that used to be included in lecture notes, but have been moved to this, the bonus area to serve as a supplement.! The slides will appear in the order they would have in the normal presentation! CS61C L26 IO & Performance I (32)!

The Internet (1962)! Founders! www.computerhistory.org/internet_history JCR Licklider, as head of ARPA, writes on intergalactic network! 1963 : ASCII becomes first universal computer standard! 1969 : Defense Advanced Research Projects Agency (DARPA) deploys 4 nodes @ UCLA, SRI, Utah, & UCSB! 1973 Robert Kahn & Vint Cerf invent TCP, now part of the Internet Protocol Suite! Internet growth rates! Exponential since start!! Lick Revolutions like this don't come along very Vint Cerf often www.greatachievements.org/?id=3736 en.wikipedia.org/wiki/internet_protocol_suite CS61C L26 IO & Performance I (33)!

Why Networks?! Originally sharing I/O devices between computers! E.g., printers! Then communicating between computers! E.g., file transfer protocol! Then communicating between people! E.g., e-mail! Then communicating between networks of computers! E.g., file sharing, www,! CS61C L26 IO & Performance I (34)!

The World Wide Web (1989)! System of interlinked hypertext documents on the Internet! History! en.wikipedia.org/wiki/history_of_the_world_wide_web 1945: Vannevar Bush describes hypertext system called memex in article! 1989: Tim Berners-Lee proposes, gets system up ʼ90! ~2000 Dot-com entrepreneurs rushed in, 2001 bubble burst! Wayback Machine! Snapshots of web over time! Today : Access anywhere!! Tim Berners- Lee www.archive.org World s First web server in 1990 CS61C L26 IO & Performance I (35)!

Shared vs. Switched Based Networks! " Switched: pairs ( point-topoint connections) communicate at same time" Shared: 1 at a time (CSMA/ Node" CD)" Shared vs. Switched:! Aggregate bandwidth (BW) in switched network is many times shared:! Node" point-to-point faster since no arbitration, simpler interface" Shared" Node" Node" Node" Node" Crossbar! Switch Node" CS61C L26 IO & Performance I (36)!

What makes networks work?! links connecting switches to each other and to computers or devices! Computer" switch" switch" network" interface" switch" ability to name the components and to route packets of information - messages - from a source to a destination! Layering, redundancy, protocols, and encapsulation as means of!abstraction (61C big idea)! CS61C L26 IO & Performance I (37)!

RAID 0 : No redundancy = AID! Assume have 4 disks of data for this example, organized in blocks! Large accesses faster since transfer from several disks at once! This and next 5 slides from RAID.edu, http://www.acnc.com/04_01_00.html http://www.raid.com/04_00.html also has a great tutorial CS61C L26 IO & Performance I (38)!

RAID 1: Mirror data! Each disk is fully duplicated onto its mirror! Very high availability can be achieved! Bandwidth reduced on write:! 1 Logical write = 2 physical writes! Most expensive solution: 100% capacity overhead! CS61C L26 IO & Performance I (39)!

RAID 3: Parity! Parity computed across group to protect against hard disk failures, stored in P disk! Logically, a single high capacity, high transfer rate disk! 25% capacity cost for parity in this example vs. 100% for RAID 1 (5 disks vs. 8 disks)! CS61C L26 IO & Performance I (40)!

Inspiration for RAID 5 (RAID 4 block-striping)! Small writes (write to one disk):! Option 1: read other data disks, create new sum and write to Parity Disk (access all disks)! Option 2: since P has old sum, compare old data to new data, add the difference to P: 1 logical write = 2 physical reads + 2 physical writes to 2 disks! Parity Disk is bottleneck for Small writes: Write to A0, B1 both write to P disk! A0! B0! C0! D0! P! A1! B1! C1! D1! P! CS61C L26 IO & Performance I (41)!

RAID 5: Rotated Parity, faster small writes! Independent writes possible because of interleaved parity! Example: write to A0, B1 uses disks 0, 1, 4, 5, so can proceed in parallel! Still 1 small write = 4 physical disk accesses" en.wikipedia.org/wiki/redundant_array_of_independent_disks CS61C L26 IO & Performance I (42)!

Words, Words, Words! Will (try to) stick to n times faster ; its less confusing than m % faster! As faster means both decreased execution time and increased performance, to reduce confusion we will (and you should) use improve execution time or!! improve performance! CS61C L26 IO & Performance I (43)!