Computer Organization & Design 计算机组成与设计

Slides:



Advertisements
Similar presentations
Computer-System Structures Er.Harsimran Singh
Advertisements

IT253: Computer Organization
Lecture 21Comp. Arch. Fall 2006 Chapter 8: I/O Systems Adapted from Mary Jane Irwin at Penn State University for Computer Organization and Design, Patterson.
1  1998 Morgan Kaufmann Publishers Interfacing Processors and Peripherals.
CSCE 212 Chapter 8 Storage, Networks, and Other Peripherals Instructor: Jason D. Bakos.
Lecture Objectives: 1)Explain the limitations of flash memory. 2)Define wear leveling. 3)Define the term IO Transaction 4)Define the terms synchronous.
EE30332 Ch8 DP – 1 Ch 8 Interfacing Processors and Peripherals Buses °Fundamental tool for designing and building computer systems divide the problem into.
Interfacing Processors and Peripherals Andreas Klappenecker CPSC321 Computer Architecture.
1  1998 Morgan Kaufmann Publishers Chapter 8 Storage, Networks and Other Peripherals.
Processor Design 5Z0321 Processor Design 5Z032 Chapter 8 Interfacing Processors and Peripherals Henk Corporaal.
1  1998 Morgan Kaufmann Publishers Chapter 8 Interfacing Processors and Peripherals.
1 Interfacing Processors and Peripherals I/O Design affected by many factors (expandability, resilience) Performance: — access latency — throughput — connection.
I/0 devices.
Storage & Peripherals Disks, Networks, and Other Devices.
I/O – Chapter 8 Introduction Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6.
I/O 1 Computer Organization II © McQuain Introduction I/O devices can be characterized by – Behavior: input, output, storage – Partner:
1 (Based on text: David A. Patterson & John L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, 3 rd Ed., Morgan Kaufmann,
CHAPTER 2: COMPUTER-SYSTEM STRUCTURES Computer system operation Computer system operation I/O structure I/O structure Storage structure Storage structure.
I/O Example: Disk Drives To access data: — seek: position head over the proper track (8 to 20 ms. avg.) — rotational latency: wait for desired sector (.5.
Lecture 35: Chapter 6 Today’s topic –I/O Overview 1.
I/O Computer Organization II 1 Interconnecting Components Need interconnections between – CPU, memory, I/O controllers Bus: shared communication channel.
August 1, 2001Systems Architecture II1 Systems Architecture II (CS ) Lecture 9: I/O Devices and Communication Buses * Jeremy R. Johnson Wednesday,
CS2100 Computer Organisation Input/Output – Own reading only (AY2015/6) Semester 1 Adapted from David Patternson’s lecture slides:
Csci 136 Computer Architecture II – IO and Storage Systems Xiuzhen Cheng
Chapter 6 Storage and Other I/O Topics. Chapter 6 — Storage and Other I/O Topics — 2 Introduction I/O devices can be characterized by Behaviour: input,
Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.
1 Ó1998 Morgan Kaufmann Publishers Chapter 8 I/O Systems.
1 Lecture 14 Buses and I/O Data Transfer Peng Liu
Mohamed Younis CMCS 411, Computer Architecture 1 CMCS Computer Architecture Lecture 26 Bus Interconnect May 7,
1 Lecture 13 Architectural Support for OS I/O Peng Liu
1  2004 Morgan Kaufmann Publishers Page Tables. 2  2004 Morgan Kaufmann Publishers Page Tables.
Computer Organization & Design 计算机组成与设计 Weidong Wang ( 王维东 ) College of Information Science & Electronic Engineering 信息与通信工程研究所 Zhejiang.
CSCE 385: Computer Architecture Spring 2014 Dr. Mike Turi I/O.
Computer Organization & Design 计算机组成与设计
Computer System Structures Storage
Lecture 2. A Computer System for Labs
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
Chapter 2: Computer-System Structures(Hardware)
Chapter 2: Computer-System Structures
Chapter 2: Computer-System Structures
Lecture 13 Architectural Support for OS I/O
Operating Systems (CS 340 D)
Computer Organization & Design 计算机组成与设计
CS703 - Advanced Operating Systems
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Computer Architecture
Virtual Memory Main memory can act as a cache for the secondary storage (disk) Advantages: illusion of having more physical memory program relocation protection.
Computer Organization & Design 计算机组成与设计
CSCI 315 Operating Systems Design
Introduction I/O devices can be characterized by I/O bus connections
Lecture 14 Architectural Support for OS I/O
Input-output I/O is very much architecture/system dependent
Computer-System Architecture
Module 2: Computer-System Structures
Operating Systems Chapter 5: Input/Output Management
Computer Organization & Design 计算机组成与设计
Overview of Computer Architecture and Organization
EE 108B Review Session Friday, March 9th, 2007.
Lecture 14 Buses and I/O Data Transfer
Peng Liu Lecture 14 I/O Peng Liu
Lecture 13 Architectural Support for OS I/O
Persistence: hard disk drive
Persistence: I/O devices
Module 2: Computer-System Structures
CSC3050 – Computer Architecture
Chapter 2: Computer-System Structures
Chapter 2: Computer-System Structures
Module 2: Computer-System Structures
Module 2: Computer-System Structures
Chapter 13: I/O Systems.
Presentation transcript:

Computer Organization & Design 计算机组成与设计 Weidong Wang (王维东) wdwang@zju.edu.cn College of Information Science & Electronic Engineering 信息与通信网络工程研究所(ICAN) Zhejiang University

Course Information Instructor: Weidong WANG TA: Email: wdwang@zju.edu.cn Tel(O): 0571-87953170; Office Hours: TBD, Yuquan Campus, Xindian (High-Tech) Building 306 Mobile: 13605812196 TA: mobile,Email: 陈 彬彬 Binbin CHEN, 13071888906; 15091831397@163.com; 陈 佳云 Jiayun CHEN,13161700140; chenjy93@outlook.com; Office Hours: Wednesday & Saturday 14:00-16:30 PM. Xindian (High-Tech) Building 308.(也可以短信邮件联系) 微信号-“2017计组群”

Lecture 14 I/O Design & Bus

Input/Output

----Input/Output 5

Diversity多样性of Devices 6

Typical x86 PC I/O System 7

Somewhat Different Now 9

I/O System Design Goals Performance measures Latency (response time) Throughput (bandwidth) Dependability可靠性is important Resilience in the face of failures Particularly for storage devices Expandability Computer classes Desktop: response time and diversity of devices Server: throughput, expandability, failure resilience Embedded: cost and response time 11

Throughput吞吐量vs. Response Time Aggregate总计的measure of amount of data moved per unit time, averaged over a window Measure in bytes/sec or transfers/sec Sometimes referred to as bandwidth Examples: Memory bandwidth, disk bandwidth Response time Response time to do a single I/O operation Measured in seconds or cycles Sometimes referred to as latency延迟 Example: Write a block of bytes to disk Example: Send a data packet over the network 12

Throughput - Response Time Tradeoffs 13

Throughput vs. Response Time 14

----Magnetic Hard Disks 长效 15

Disk Storage 柱;柱面 磁道 扇区 16

Hard Disk Basic operation Features of hard disks Rotating platter coated with magnetic surface Moving read/write head used to access the disk Features of hard disks Platters are rigid (ceramic or metal) High density since head can be controlled more precisely High data rate with higher rotational speed Can include multiple platters Incredible improvements Examples of I/O device performance being technology driven Capacity: 2x every year Transfer rate: 1.4x every year Price approaching 1$/GB = 109 bytes 硬式的 17

Hard Disk Organization 转盘 柱;柱面 18

Measuring Disk Access Time Each read or write has three major components Seek time is the time to position the arm over the proper track Rotational latency is the wait for the desired sector to rotate under the read/write head Transfer time is the time required to transfer a block of bits (sector) under the read/write head Note that these represent only the “raw performance” of the disk Other components: I/O bus, controllers, other caches, interleaving, etc. 19

Seek Time Seek time is the time to position the arm over the proper track Average seek time is the time it takes to move the read/write head from its current position to a track on the disk Industry definition is that seek time is the time for all possible seeks divided by the number of possible seeks In practice, locality reduces this to 25-33% of this number Note that some manufacturers report minimum seek times rather average seek times 20

Rotational Latency 21

Transfer Time Transfer time is the time required to transfer a block of bits A factor of the transfer size, rotational speed, and recording density Transfer size is usually a sector Most drives today use caches to help buffer the effects of seek time and rotational latency 22

Typical Hard Disk Drive Rotation speed: 3600,5200,7200, or 15000 RPM Tracks per surface: 500-2000 tracks Sectors per track: 32-128 sectors Sectors size: 512B-1024KB Minimum seek time is often approximately 0.1ms Average seek time is often approximately 5-10ms Access time is often approximately 9-10ms Transfer rate is often 50-200MB/s 23

Average Access Example 24

Important Footnote 25

I/O System Design 30

Buses

Review: Typical x86 PC I/O System

Buses A bus is a shared communication link that connects multiple devices Single set of wires connects multiple “subsystems” as opposed to a point to point link which only two components together Wires connect in parallel, so 32 bit bus has 32 wires of data

Advantages/Disadvantages Broadcast capability of shared communication link Versatility New device can be added easily Peripherals can be moved between computer systems that use the same bus standard Low Cost A single set of wires is shared multiple ways Disadvantages Communication bottleneck Bandwidth of bus can limit the maximum I/O throughput Limited maximum bus speed Length of the bus Number of devices on the bus Need to support a range of devices with varying latencies and transfer rates 多样性, 多功能

Bus Organization

Types of Buses Processor-memory bus or front-side bus or system bus Short, high-speed bus Connects memory and processor directly Designed to match the memory system and achieve the maximum memory-to-processor bandwidth (cache transfers) Designed specifically for a given processor/memory system (proprietary) I/O Bus (or peripheral bus) Usually long and slow Connect devices to the processor-memory bus Must match a wide range of I/O device performance characteristics Industry standard

Review: Typical x86 PC I/O System

Synchronous versus Asynchronous Synchronous Bus Includes a clock in control lines Fixed protocol for communication relative to the clock Advantages Involves very little logic and can therefore run very fast Disadvantages Every decision on the bus must run at the same clock rate To avoid clock skew, bus cannot be long if it is fast Processor-memory bus Asynchronous Bus No clock control line Can easily accommodate a wide range of devices No clock skew problems, so bus can be quite long Requires handshaking protocol

Increasing Bus Bandwidth

Increasing Bus Bandwidth

Increasing Bus Bandwidth

Accessing the Bus

Trends for Buses Logical Bus and Physical Switch

Operating System Tasks

OS Communication The operating system should prevent user program from communicating with I/O device directly Must protect I/O resources to keep sharing fair Protection of shared I/O resources cannot be provided if user programs could perform I/O directly Three types of communication are required OS must be able to give commands to I/O devices I/O device must be able to notify OS when I/O device has completed and operation or has encountered an error Data must be transferred between memory and an I/O device

I/O Commands: A method for addressing a device

I/O Commands I/O devices are managed by I/O controller hardware Transfers data to/from device Synchronizes operation with software Command registers Cause device to do something Status registers Indicate what the device is doing and occurrence of errors Data registers Write: transfer data to a device Read: transfer data from a device

Communication with the CPU Method #1: Polling轮询 I/O device places information in a status register The OS periodically checks the status register Whether polling is used dependent upon whether the device can initiate I/O independently For instance, a mouse works well since it has a fixed I/O rate and initiates its own data (whenever it is moved) For others, such as disk access, I/O only occurs under the control of the OS, so we poll only when the OS knows it is active Advantages Simple to implement Processor is in control and does the work Disadvantage Polling overhead and data transfer consume CPU time

Polling and Programmed I/O

I/O Notification

I/O Interrupts 中断服务程序 中断向量

Data transfer North Bridge北桥

Delegating授权委派I/O: DMA Direct Memory Access (DMA) Transfer blocks of data to or from memory without CPU intervention Communication coordinated by the DMA controller DMA controllers are integrated in memory or I/O controller chips DMA controller acts as a bus master, in bus-based systems DMA steps Processor sets up DMA by supplying Identify识别确定of the device and the operation (read/write) The memory address for source/destination The number of bytes to transfer DMA controller starts the operation by arbitrating仲裁for the bus and then starting the transfer when the data is ready Notify the processor when the DMA transfer is complete or on error Usually using an interrupt

Reading a Disk Sector (1)

Reading a Disk Sector (2)

Reading a Disk Sector (3)

DMA Problems: Virtual vs. Physical Addresses If DMA uses physical addresses Memory access across physical page boundaries may not correspond to contiguous邻近的virtual pages (or even the same application) Solution1: <1 page per DMA transfer Solution1+: chain a series of 1-page requests provided by the OS Single interrupt at the end of the last DMA request in the chain Solution2: DMA engine uses virtual addresses Multi-page DMA requests are now easy A TLB is necessary for the DMA engine For DMA with physical addresses: pages must be pinned in DRAM用针别住/钉在 OS should not page to disks pages involved with pending挂起的I/O

I/O: Bus & Software Issues

Review: Hard Disks 72

Flash Storage 73

Flash Types 74

Another Example: Rack-Mounted Servers

Sun Fire x4150 1U server

I/O System Design Example

Design Example

Design Example (cont) 充足的净空高度

I/O Summary I/O performance has to take into account many variables Response time and throughput CPU, memory, bus, I/O device Workload e.g. transaction processing I/O devices also span a wide spectrum Disks, graphics, and networks Buses Bandwidth Synchronization Transactions OS and I/O Communication: Polling轮询and Interrupts Handling I/O outside CPU: DMA

HomeWork Readings: HomeWork Read Book; Read Parallel Processors from Client to Cloud.pdf; HomeWork HW5 Project 2 Computer Organization and Design (COD) (Fifth Edition)

Acknowledgements These slides contain material from courses: UCB CS152 Stanford EE108B Also MIT course 6.823