ΔΙΑΛΕΞΕΙΣ 9-10: ΕΙΣΟΔΟΣ/ΕΞΟΔΟΣ ΚΑΙ ΑΠΟΘΗΚΕΥΣΗ ΔΕΔΟΜΕΝΩΝ

Σχετικά έγγραφα
ΔΙΑΛΕΞΕΙΣ 9-10: ΕΙΣΟΔΟΣ/ΕΞΟΔΟΣ ΚΑΙ ΑΠΟΘΗΚΕΥΣΗ ΔΕΔΟΜΕΝΩΝ

Προχωρηµένα Θέµατα Αρχιτεκτονικής Η/Υ. Storage Systems.. Λιούπης

Οργάνωση Υπολογιστών (IΙI)

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 6/5/2006

Modbus basic setup notes for IO-Link AL1xxx Master Block

Κεφ. 10: Δομές Αποθήκευσης

Εικονική Μνήμη (virtual memory)

[1] P Q. Fig. 3.1

Βασικές συσκευές Ε/Ε. Είσοδος Έξοδος στον υπολογιστή. Ένα τυπικό υπολογιστικό σύστημα σήμερα. Οργάνωση Υπολογιστών (IΙI) Μ.

Αρχιτεκτονική υπολογιστών

ΣΥΣΤΗΜΑΤΑ ΔΕΥΤΕΡΕΥΟΥΣΑΣ ΜΝΗΜΗΣ

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 19/5/2007

Απόδοση συσκευών Ε/Ε Κριτήρια απόδοσης σύνθετα

Instruction Execution Times

the total number of electrons passing through the lamp.

Λογικά σύμβολα των CPU, RAM, ROM και I/O module

Αρχιτεκτονική Υπολογιστών

Εθνικό Μετσόβιο Πολυτεχνείο Σχολή Ηλεκτρολόγων Μηχανικών - Μηχανικών Υπολογιστών. Αρχιτεκτονική Υπολογιστών Νεκτάριος Κοζύρης.

HOMEWORK 4 = G. In order to plot the stress versus the stretch we define a normalized stretch:

Αποθήκευση, δίκτυα και άλλα περιφερειακά. Αρχιτεκτονική Υπολογιστών

I/O: Λίγη θεωρία ουρών, RAID

CMOS Technology for Computer Architects

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 24/3/2007

EE512: Error Control Coding

TMA4115 Matematikk 3

Assalamu `alaikum wr. wb.

ΠΛΕ- 027 Μικροεπεξεργαστές 11ο μάθημα: Είσοδος- Εξοδος (Ε/Ε)

ΚΥΠΡΙΑΚΟΣ ΣΥΝΔΕΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY 21 ος ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ Δεύτερος Γύρος - 30 Μαρτίου 2011

Ενσωµατωµένα Υπολογιστικά Συστήµατα (Embedded Computer Systems)

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 11/3/2006

2 Composition. Invertible Mappings

Αρχιτεκτονική υπολογιστών

Main source: "Discrete-time systems and computer control" by Α. ΣΚΟΔΡΑΣ ΨΗΦΙΑΚΟΣ ΕΛΕΓΧΟΣ ΔΙΑΛΕΞΗ 4 ΔΙΑΦΑΝΕΙΑ 1

Physical DB Design. B-Trees Index files can become quite large for large main files Indices on index files are possible.

Τέτοιες λειτουργίες γίνονται διαμέσου του

Ιόνιο Πανεπιστήμιο Τμήμα Πληροφορικής Αρχιτεκτονική Υπολογιστών Κρυφές Μνήμες. (οργάνωση, λειτουργία και απόδοση)

Μηχανοτρονική. Τμήμα Μηχανικών Παραγωγής και Διοίκησης 7 ο Εξάμηνο,

Block Ciphers Modes. Ramki Thurimella

(C) 2010 Pearson Education, Inc. All rights reserved.

ΜΕΛΕΤΗ ΗΛΕΚΤΡΟΝΙΚΟΥ ΕΞΟΠΛΙΣΜΟΥ

CHAPTER 25 SOLVING EQUATIONS BY ITERATIVE METHODS

ΗΜΥ 210 ΣΧΕΔΙΑΣΜΟΣ ΨΗΦΙΑΚΩΝ ΣΥΣΤΗΜΑΤΩΝ. Χειµερινό Εξάµηνο 2016 ΔΙΑΛΕΞΗ 18: Διαδικασία Σχεδίασης Ψηφιακών Συστηµάτων - Επανάληψη

Phys460.nb Solution for the t-dependent Schrodinger s equation How did we find the solution? (not required)

Αποθήκευση εδομένων. ομή ενός Σ Β. Εισαγωγή Το «εσωτερικό» ενός ΜΕΡΟΣ Β : Η (εσωτερική) αρχιτεκτονική ενός Σ Β είναι σε επίπεδα

Capacitors - Capacitance, Charge and Potential Difference

Calculating the propagation delay of coaxial cable

Δίκτυα Δακτυλίου. Token Ring - Polling

derivation of the Laplacian from rectangular to spherical coordinates

Κεφάλαιο 7 Ιεραρχία Μνήμης (Memory Hierarchy)


The Simply Typed Lambda Calculus

Quick Installation Guide

Διασύνδεση Εισόδου-Εξόδου

Εικονική Μνήμη (Virtual Μemory)

Υλοποίηση Δικτυακών Υποδομών και Υπηρεσιών: OSPF Cost

Πρόβλημα 1: Αναζήτηση Ελάχιστης/Μέγιστης Τιμής

Ιεραρχία Μνήμης. Ιεραρχία μνήμης και τοπικότητα. Σκοπός της Ιεραρχίας Μνήμης. Κρυφές Μνήμες

(1) Describe the process by which mercury atoms become excited in a fluorescent tube (3)

Finite Field Problems: Solutions

ΔΙΑΛΕΞΗ 8: ΕΙΚΟΝΙΚΗ (Virtual) ΜΝΗΜΗ

Lecture 2: Dirac notation and a review of linear algebra Read Sakurai chapter 1, Baym chatper 3

Εικονική Μνήμη (Virtual Μemory)

Example Sheet 3 Solutions

The challenges of non-stable predicates

Homework 3 Solutions

Προηγμένοι Μικροεπεξεργαστές. Paging & Segmentation

ΤΕΧΝΙΚΕΣ ΑΥΞΗΣΗΣ ΤΗΣ ΑΠΟΔΟΣΗΣ ΤΩΝ ΥΠΟΛΟΓΙΣΤΩΝ I

Συστήματα Διαχείρισης Βάσεων Δεδομένων

5.4 The Poisson Distribution.

LESSON 14 (ΜΑΘΗΜΑ ΔΕΚΑΤΕΣΣΕΡΑ) REF : 202/057/34-ADV. 18 February 2014

Section 8.3 Trigonometric Equations

Συστήµατα Αποθήκευσης

ΤΕΧΝΙΚΕΣ ΠΡΟ ΙΑΓΡΑΦΕΣ ΕΞΟΠΛΙΣΜΟΥ

Οδηγίες Αγοράς Ηλεκτρονικού Βιβλίου Instructions for Buying an ebook

Σύστημα διασύνδεσης και. διαδικασία εισόδου-εξόδου

Approximation of distance between locations on earth given by latitude and longitude

ΗΜΥ 210 ΣΧΕΔΙΑΣΜΟΣ ΨΗΦΙΑΚΩΝ ΣΥΣΤΗΜΑΤΩΝ. Χειµερινό Εξάµηνο 2016 ΔΙΑΛΕΞΗ 13: Διαδικασία Σχεδιασµού Ακολουθιακών Κυκλωµάτων (Κεφάλαιο 6.

9.09. # 1. Area inside the oval limaçon r = cos θ. To graph, start with θ = 0 so r = 6. Compute dr

SMD Transient Voltage Suppressors

Εγκατάσταση λογισμικού και αναβάθμιση συσκευής Device software installation and software upgrade

ΙΑΤΜΗΜΑΤΙΚΟ ΠΡΟΓΡΑΜΜΑ ΜΕΤΑΠΤΥΧΙΑΚΩΝ ΣΠΟΥ ΩΝ ΣΤΑ ΠΛΗΡΟΦΟΡΙΑΚΑ ΣΥΣΤΗΜΑΤΑ "VIDEO ΚΑΤΟΠΙΝ ΖΗΤΗΣΗΣ" ΑΝΝΑ ΜΟΣΧΑ Μ 11 / 99

Στο εστιατόριο «ToDokimasesPrinToBgaleisStonKosmo?» έξω από τους δακτυλίους του Κρόνου, οι παραγγελίες γίνονται ηλεκτρονικά.

6.003: Signals and Systems. Modulation

3.4 SUM AND DIFFERENCE FORMULAS. NOTE: cos(α+β) cos α + cos β cos(α-β) cos α -cos β

Advanced Subsidiary Unit 1: Understanding and Written Response

Αρχιτεκτονική υπολογιστών

Kingston HyperX Predator Μ.2 PCIe 2.0 x4 240GB Solid State Drive Πραγματικό αρπακτικό δεδομένων!

Λειτουργικά Συστήματα Ι. Συστήματα Εισόδου/Εξόδου (I/O --- Input/Output)

CS 150 Assignment 2. Assignment 2 Overview Opening Files Arrays ( and a little bit of pointers ) Strings and Comparison Q/A

Test Data Management in Practice

38BXCS STANDARD RACK MODEL. DCS Input/Output Relay Card Series MODEL & SUFFIX CODE SELECTION 38BXCS INSTALLATION ORDERING INFORMATION RELATED PRODUCTS

ΑΝΙΧΝΕΥΣΗ ΓΕΓΟΝΟΤΩΝ ΒΗΜΑΤΙΣΜΟΥ ΜΕ ΧΡΗΣΗ ΕΠΙΤΑΧΥΝΣΙΟΜΕΤΡΩΝ ΔΙΠΛΩΜΑΤΙΚΗ ΕΡΓΑΣΙΑ

Προσομοίωση BP με το Bizagi Modeler

Μηχανική Μάθηση Hypothesis Testing

Εικονική Μνήμη (virtual memory)

DESIGN OF MACHINERY SOLUTION MANUAL h in h 4 0.

Διασυνδετικοί Δίαυλοι. Τι διασυνδέει ένας δίαυλος; Μεταφορά δεδομένων. Διασύνδεση Εισόδου-Εξόδου. Μ.Στεφανιδάκης

Πώς μπορεί κανείς να έχει έναν διερμηνέα κατά την επίσκεψή του στον Οικογενειακό του Γιατρό στο Ίσλινγκτον Getting an interpreter when you visit your

Monolithic Crystal Filters (M.C.F.)

Γιπλυμαηική Δπγαζία. «Ανθπυποκενηπικόρ ζσεδιαζμόρ γέθςπαρ πλοίος» Φοςζιάνηρ Αθανάζιορ. Δπιβλέπυν Καθηγηηήρ: Νηθφιανο Π. Βεληίθνο

Transcript:

ΗΜΥ 312 -- ΑΡΧΙΤΕΚΤΟΝΙΚΗ ΗΛΕΚΤΡΟΝΙΚΩΝ ΥΠΟΛΟΓΙΣΤΩΝ ΔΙΑΛΕΞΕΙΣ 9-10: ΕΙΣΟΔΟΣ/ΕΞΟΔΟΣ ΚΑΙ ΑΠΟΘΗΚΕΥΣΗ ΔΕΔΟΜΕΝΩΝ Διδάσκων: Χάρης Θεοχαρίδης, ΗΜΜΥ ttheocharides@ucy.ac.cy [Προσαρμογή από Computer Architecture, Hennessy & Patterson, 2005, UCB]

Επ: Κύρια Μέρη Υπολογιστή Processor Devices Control Memory Output Datapath Input Secondary Memory (Disk) Main Memory Cache ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.2

Traditionally Traditionally, I/O involves video/audio (screen, speakers, microphone), data input (scanner, keyboard, mouse), data output (printer) But ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.3

What happens when ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.4

Disk-based storage in computers qmemory/storage hierarchy Combining many technologies to balance costs/benefits Recall the memory hierarchy and virtual memory lectures qpersistence Storing data for lengthy periods of time - DRAM/SRAM is volatile : contents lost if power lost - Disks are non-volatile : contents survive power outages To be useful, it must also be possible to find it again later - this brings in many interesting data organization, consistency, and management issues ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.5

Storage (HDD Hard Disk Drive) ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.6

Inside a magnetic hard disk ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.7

What s Inside A Disk Drive? Arm Spindle Platters Actuator Electronics SCSI connector Image courtesy of Seagate Technology ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.8

Disk Electronics Just like a small computer processor, memory, network interface Connect to disk Control processor Cache memory Control ASIC Connect to motor ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.9

Disk Geometry q Disks contain platters: metal disks, each with two surfaces coated with magnetic material on each side q Each surface organized in concentric rings called tracks (there are usually 10,000-50,000 tracks per surface) q Each track consists of sectors separated by gaps (usual sector size is 512 bytes, 100-500 sectors per track) tracks surface track k gaps spindle platter sectors ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.10

Disk Operation (Single-Platter View) The disk surface spins at a fixed rotational rate The read/write head is attached to the end of the arm and flies over the disk surface on a thin cushion of air spindle spindle spindle spindle By moving radially, the arm can position the read/write head over any track ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.11

Disk Geometry (Muliple-Platter View) Aligned tracks form a cylinder cylinder k surface 0 surface 1 surface 2 surface 3 surface 4 surface 5 platter 0 platter 1 platter 2 spindle ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.12

Disk Operation (Multi-Platter View) Cylinder operation q there are multiple read/write heads (2 per platter) q all heads are connected together qà same tracks in different platters (= cylinder) are accessed simultaneously read/write heads move in unison from cylinder to cylinder arm spindle ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.13

Disk Capacity (Χωρητικότητα) Capacity: maximum number of bits that can be stored. n Vendors express capacity in units of gigabytes (GB), where 1 GB = 10 9, or terabytes (TB, 10 12 ) Capacity is determined by these technology factors: n Recording density (bits/in): number of bits that can be squeezed into a 1 inch segment of a track. n Track density (tracks/in): number of tracks that can be squeezed into a 1 inch radial segment. n Areal density (bits/in 2 ): product of recording and track density. ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.14

Computing Disk Capacity Capacity = (# bytes/sector) x (avg. # sectors/track) x (# tracks/surface) x (# surfaces/platter) x (# platters/disk) Example: n 512 bytes/sector n 300 sectors/track (on average) n 20,000 tracks/surface n 2 surfaces/platter n 5 platters/disk Capacity = 512 x 300 x 20000 x 2 x 5 = 30,720,000,000 = 30.72 GB ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.15

Disk Operation (Multi-Platter View) Read/Write Head Arm Upper Surface Platter Lower Surface Cylinder Track Sector Actuator ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.16

Πώς δουλεύει ο δίσκος q 3 βήματα για ανάκτηση δεδομένων (1 sector): Το Head εντοπίζει το track (seek) - Seek Time ο χρόνος που χρειάζεται να βρει το track Το cylinder (οι δίσκοι) γυρνάει για να φέρει το κατάλληλο sector στο head - Rotational Latency ο χρόνος που χρειάζεται για να περιστραφεί (spin) στο sector όπου βρίσκονται τα δεδομένα - RPM (Rotations Per Minute) οι δίσκοι γυρνάνε με κάποια ταχύτητα (RPM), συνήθως 5,400 15,000 rpm Μεταφορά δεδομένων Transfer Time ο χρόνος που χρειάζεται για να μεταφερθεί ένα μπλοκ δεδομένων ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.17

Disk Drive Seek and Rotation ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.18

Disk Drive Seek and Rotation Step 1: Seek to the Desired Track Time = Seek Time ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.19

Disk Drive Seek and Rotation Step 2: Wait for Sector to Rotate Time = Rotational Latency ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.20

q Χαρακτηριστικά Μαγνητικού Δίσκου Στοιχεία Ανάγνωσης/Εγγραφής 1. Χρόνος Έρευνας (Seek time): τοποθέτηση κεφαλής πάνω στο σωστό αυλάκι (track) (3 to 14 ms avg) - Λόγω τοπικότητας, ο πραγματικός μέσο χρόνος έρευνας μπορεί να είναι γύρω στο 25% με 33% του δηλωμένου. Controller + Cache Track Sector Head 2. Χρόνος/Αναμονή περιστροφής (Rotational latency): ο χρόνος που ο επιθυμητός τομέας (sector) χρειάζεται για να περιστραφεί κάτω από την κεφαλή (½ του 1/RPM μετατρέπεται σε ms) - από 0.5/5400RPM = 5.6ms μέχρι 0.5/15000RPM = 2.0ms 3. Χρόνος Μεταφοράς(Transfer time): μεταφορά ενός block of bits (ενός ή περισσότερου τομέα) κάτω από την κεφαλή στο disk controller s cache (30 με 80 MB/s είναι η συνηθισμένη ροή) - Το disk controller s cache εκμεταλλεύεται την τοπικότητα χώρου της προσπέλασης δίσκου cache transfer rates are much faster (e.g., 320 MB/s) 4. Χρόνος Ελέγχου (Controller time): ο χρόνος που χρειάζεται το disk controller για να τροχοδρομήσει μια I/O προσπέλαση στο δίσκο (συνήθως <.2 ms) Cylinder Platter ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.21

Disk Access Time Average time to access a specific sector approximated by: n Taccess = Tavg seek + Tavg rotation + Tavg transfer Seek time (Tavg seek) n Time to position heads over cylinder containing target sector n Typical Tavg seek = 3-5 ms Rotational latency (Tavg rotation) n Time waiting for first bit of target sector to pass under r/w head n Tavg rotation = 1/2 x 1/RPMs x 60 sec/1 min ne.g., 3ms for 10,000 RPM disk Transfer time (Tavg transfer) n Time to read the bits in the target sector n Tavg transfer = 1/RPM x 1/(avg # sectors/track) x 60 secs/1 min ne.g., 0.006ms for 10,000 RPM disk with 1,000 sectors/track ngiven 512-byte sectors, ~85 MB/s data transfer rate ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.22

Disk Performance qgetting First Byte Seek + Rotational latency = 7,000 19,000 µsec qgetting Successive Bytes ~ 0.06 µsec each - roughly 100,000 times faster than getting the first byte! qoptimizing Performance: Large block transfers are more efficient Try to do other things while waiting for first byte - switch context to other computing task - processor is interrupted when transfer completes ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.23

Τυπικός Χρόνος Προσπέλασης Δίσκου qο μέσος χρόνος για ανάγνωση/εγγραφή ενός 512B sector για ένα δίσκο στα 10,000RPM με μέσο χρόνο έρευνας 6ms, 50MB/sec ροή δεδομένων, και 0.2ms χρόνο controller Avg disk read/write = 6.0ms + 0.5/(10000RPM/(60sec/minute) )+ 0.5KB/(50MB/sec) + 0.2ms = 6.0 + 3.0 + 0.01 + 0.2 = 9.21ms Αν ο πραγματικός χρόνος έρευνας είναι 25% του δοσμένου, τότε Avg disk read/write = 1.5 + 3.0 + 0.01 + 0.2 = 4.71ms qο χρόνος περιστροφής είναι συνήθως το μεγαλύτερο μέρος του χρόνου προσπέλασης ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.24

Disk storage as array of blocks OS s view of storage device (as exposed by SCSI or IDE/ATA protocols) 5 6 7 12 23 n n n Common logical block size: 512 bytes Number of blocks: device capacity / block size Common OS-to-storage requests defined by few fields n R/W, block #, # of blocks, memory source/dest ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.25

Logical Disk Blocks qmodern disks present a simpler abstract view of the complex sector geometry: The set of available sectors is modeled as a sequence of b-sized logical blocks (0, 1, 2,...) qmapping between logical blocks and actual (physical) sectors Maintained by hardware/firmware device called disk controller Converts requests for logical blocks into (surface, track, sector) triples qallows controller to set aside spare cylinders for each zone Accounts for the difference in formatted capacity and maximum capacity ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.26

Page Faults A page fault is caused by a reference to a VM word that is not in physical (main) memory nexample: An instruction references a word contained in VP 3, a miss that triggers a page fault exception Virtual address Valid PTE 0 0 PTE 7 1 1 0 1 0 0 1 ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.27 Physical page number or disk address null null Memory resident page table (DRAM) Physical memory (DRAM) VP 1 VP 2 VP 7 VP 4 Virtual memory (disk) VP 1 VP 2 VP 3 VP 4 VP 6 VP 7 PP 0 PP 3

Page Faults A page fault is caused by a reference to a VM word that is not in physical (main) memory nexample: An instruction references logical a word block contained number in VP 3, can a miss be that triggers a page fault exception remembered in page table to identify disk location for pages not resident in main memory Physical memory Virtual address Valid PTE 0 0 PTE 7 1 1 0 1 0 0 1 ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.28 Physical page number or disk address null null Memory resident page table (DRAM) (DRAM) VP 1 VP 2 VP 7 VP 4 Virtual memory (disk) VP 1 VP 2 VP 3 VP 4 VP 6 VP 7 PP 0 PP 3

Looking back at the hardware CPU chip register file ALU bus interface main memory ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.29

Connecting I/O devices: the I/O Bus CPU chip register file ALU system bus memory bus bus interface I/O bridge main memory USB controller graphics adapter I/O bus disk controller Expansion slots for other devices such as network adapters mouse keyboard monitor disk ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.30

Reading from disk (1) CPU chip register file ALU CPU initiates a disk read by writing a READ command, logical block number, number of blocks, and destination memory address to a port (address) associated with disk controller bus interface main memory I/O bus USB controller mouse keyboard graphics adapter monitor disk controller disk ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.31

Reading from disk (2) CPU chip register file ALU Disk controller reads the sectors and performs a direct memory access (DMA) transfer into main memory bus interface main memory I/O bus USB controller mouse keyboard graphics adapter monitor disk controller disk ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.32

Reading from disk (3) CPU chip register file ALU When the DMA transfer completes, the disk controller notifies the CPU with an interrupt (i.e., asserts a special interrupt pin on the CPU) bus interface main memory I/O bus USB controller mouse keyboard graphics adapter monitor disk controller disk ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.33

Περιληπτικά qσκοπός Sector Μακροπρόθεσμη αποθήκευση δεδομένων χωρίς ηλεκτρ. ενέργεια Χαμηλότερο επίπεδο στην ιεραρχία - Πιο αργό, μεγάλο, χαμηλό κόστος Track qγενική Δομή Ένας περιστρεφόμενος δίσκος με μαγνητική επιφάνεια Κινούμενο κεφάλι για ανάγνωση/εγγραφή qσυνήθεις Παράμετροι 1 με 4 (1 ή 2 επιφάνειες) πιάτα ανά δίσκο, 1 με 5.25 διάμετρο (οι 3.5 μονιμοποιήθηκαν το 2004) Ταχύτητα ροπής από 5,400 έως και 15,000 RPM (~18000 σήμερα) 10,000 με 50,000 tracks ανά επιφάνεια - Κύλινδρος-cylinder όλα τα tracks κάτω από το κεφάλι σε μια δεδομένη στιγμή σε όλες τις επιφάνειες. 100 με 500 sectors ανά track - Το πιο μικρό κομμάτι ανάγνωσης/εγγραφής (συνήθως 512B) ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.34

Παραδείγματα Δίσκων (www.seagate.com) Characteristic Seagate ST37 Seagate ST32 Seagate ST94 Disk diameter (inches) 3.5 3.5 2.5 Capacity (GB) 73.4 200 40 # of surfaces (heads) 8 4 2 Rotation speed (RPM) 15,000 7,200 5,400 Transfer rate (MB/sec) 57-86 32-58 34 Minimum seek (ms) 0.2r-0.4w 1.0r-1.2w 1.5r-2.0w Average seek (ms) 3.6r-3.9w 8.5r-9.5w 12r-14w MTTF (hours@25 o C) 1,200,000 600,000 330,000 Dimensions (inches) 1 x4 x5.8 1 x4 x5.8 0.4 x2.7 x3.9 GB/cu.inch 3 9 10 Power: op/idle/sb (watts) 20?/12/- 12/8/1 2.4/1/0.4 GB/watt 4 16 17 Weight (pounds) 1.9 1.4 0.2 ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.35

Χρόνος Προσπέλασης & Εύρος - Ορόσημα CDC Wren SG ST41 SG ST15 SG ST39 SG ST37 RSpeed (RPM) 3600 5400 7200 10000 15000 Year 1983 1990 1994 1998 2003 Capacity (Gbytes) 0.03 1.4 4.3 9.1 73.4 Diameter (inches) 5.25 5.25 3.5 3.0 2.5 Interface ST-412 SCSI SCSI SCSI SCSI Bandwidth (MB/s) 0.6 4 9 24 86 Latency (msec) 48.3 17.1 12.7 8.8 5.7 Patterson, CACM Vol 47, #10, 2004 qο χρόνος προσπέλασης (latency) είναι ο μέσος χρόνος έρευνας (seek) συν τον χρόνο περιστροφής (rotation) qτο εύρος του δίσκου (bandwidth) είναι ο ψηλότερος αριθμός formatted data από το δίσκο (όχι από το cache). ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.36

Χρόνος Προσπέλασης & Εύρος: Βελτιώσεις qενώ το εύρος του δίσκου διπλασιάζεται (bandwidth doubles) η καθυστέρηση (latency) βελτιώνεται μεταξύ 1.2 με 1.4 φορές 100 80 Bandwidth (MB/s) Latency (msec) 60 40 20 0 1983 1990 1994 1998 2003 Year of Introduction ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.37

Σημ.: Απαιτήσεις Εύρους και Χρόνου για Πολυμέσα qbandwidth requirements Απαιτήσεις Εύρους High quality video (Υψηλής Ευκρίνειας) ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.38 - Digital data = (30 frames/s) (640 x 480 pixels) (24-b color/pixel) = 221 Mb/s (27.625 MB/s) High quality audio - Digital data = (44,100 audio samples/s) (16-b audio samples) (2 audio channels for stereo) = 1.4 Mb/s (0.175 MB/s) Η συμπίεση μειώνει (reduces) τις απαιτήσεις εύρους σε μεγάλο βαθμό qθέματα ανταπόκρισης (χρόνος latency) Πόσο ευαίσθητα είναι τα μάτια (αυτιά) σε μεταβολές σε video (audio) rates; Πώς εγγυόμαστε σταθερό ρυθμό παράδοσης δεδομένων; Πόσο σημαντικός είναι ο συγχρονισμός της εικόνας και του ήχου (audio and video streams); 15 to 20 ms early to 30 to 40 ms late is tolerable

Storage Dependability Reliability Availability q Αξιοπιστία (Reliability) Μέσος χρόνος μέχρι βλάβη -- mean time to failure (MTTF) Μέσος χρόνος επισκευής -- mean time to repair (MTTR) q Διαθεσιμότητα (Availability) Availability = MTTF/(MTTF + MTTR) q Για αύξηση του MTTF, είτε βελτιώνουμε την ποιότητα των υλικών ή σχεδιάζουμε ένα πιο αξιόπιστο σύστημα που λειτουργεί στην παρουσία βλαβών 1. Αποφυγή Βλάβης (Fault avoidance): αποφυγή βλάβης μέσω καλής κατασκευής 2. Ανοχή Βλάβης (Fault tolerance): χρήση επιπρόσθετων/περιττών συστημάτων/στοιχείων για λειτουργία στην παρουσία βλάβης Διόρθωση / Εύρεση βλάβης (Fault detection versus fault correction) Μόνιμες / Προσωρινές βλάβες (Permanent faults versus transient faults) ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.39

RAIDs: Disk Arrays / Συστήματα Δίσκων Redundant Array of Inexpensive Disks qσυστήματα μικρών και φθηνών δίσκων Αύξηση της παραγωγής (throughput) μέσω πολλών δίσκων - Τα δεδομένα εξαπλώνονται σε πολλούς δίσκους - Πολλαπλές αναφορές σε πολλούς δίσκους την ίδια ώρα (interleaving ή παράλληλα) qreliability / Αξιοπιστία χαμηλότερη από μονό δίσκο qμπορεί να βελτιωθεί μέσω χρήσης πολλαπλών δίσκων (RAID) όπου αντιγράφουμε τα δεδομένα (redundancy) Χαμένα δεδομένα ανακτώνται από τα αντίγραφα - MTTR (mean time to repair), τάξεως ωρών - MTTF (mean time to failure), τάξεως δεκάδων χρόνων ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.40

RAIDs: Disk Arrays / Συστήματα Δίσκων The term "RAID" was first defined by David Patterson, Garth A. Gibson, and Randy Katz at the University of California, Berkeley in 1987 ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.41

RAID: Level 0 (No Redundancy; Striping) blk1 blk2 blk3 blk4 qπολλαπλοί μικροί δίσκοι αντί ενός Εξάπλωση των block δεδομένων σε πολλούς δίσκους striping - means that multiple blocks can be accessed in parallel increasing the performance - A 4 disk system gives four times the throughput of a 1 disk system Ίδιο κόστος με ένα δίσκο (προϋπόθεση ότι το κόστος 4 μικρότερων δίσκων είναι το ίδιο με τον ένα μεγάλο) qχωρίς πλεόνασμα Τι γίνεται στην περίπτωση βλάβης; Failure of one or more disks is more likely as the number of disks in the system increases ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.42

RAID-0 Striping across disks No fault tolerance Use all of the disk space Best Performance Lose one disk and lose the data 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.43

RAID-1 Mirroring provides a copy or mirror Good fault tolerance Disk Space Available = Disk Drives / 2 RAID-1 does not have stripes Disk 1 Disk 1 Mirror ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.44

RAID: Level 0+1 (Striping with Mirroring) blk1.1 blk1.2 blk1.3 blk1.4 blk1.1 blk1.2 blk1.3 blk1.4 q Συνδυάζει τα πλεονεκτήματα του RAID 0 και RAID 1,τα δεδομένα αντιγράφονται σε 2 τοποθεσίες και παράλληλα γράφονται σε πολλούς δίσκους q Διπλάσιος αριθμός δίσκων από το RAID 0 (e.g., 8 smaller disks with second set of 4 duplicating the first set) άρα έχει πάντα δύο αντίγραφα δεδομένων # redundant disks = # of data disks so twice the cost of one big disk - writes have to be made to both sets of disks, so writes would be only 1/2 the performance of RAID 0 q Τί γίνεται αν ένας δίσκος χαλάσει; redundant (check) data Απλά το σύστημα φέρνει δεδομένα από το δίσκο με το αντίγραφο (If a disk fails, the system just goes to the mirror for the data) ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.45

RAID-0+1 (a.k.a. RAID 10) Mirroring with Striping Good fault tolerance Disk Space Available = Disk Drives / 2 1a 1b 2a 2b 3a 2b 4a 2b 5a 3b 7a 4b 7a 4b 8a 4b 9a 5b 10a 6b 11a 6b 12a 6b 13a 6b 14a 8b 15a 8b 16a 8b ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.46

RAID-1 and RAID-10 I/O Characteristics Logical reads = Physical Reads Logical Writes = Physical Writes x 2 Βetter read performance can simultaneously read from both disks in the mirrored pair (to service 2 separate requests) ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.47

RAID: Level 2 (Redundancy via ECC) blk1,b0 blk1,b1 blk1,b2 blk1,b3 Checks 4,5,6,7 Checks 2,3,6,7 Checks 1,3,5,7 1 3 5 6 7 4 2 1 ECC disks (even) bit parity ECC (Error correcting codes) disks 4 and 2 point to either data disk 6 or 7, but ECC disk 1 says disk 7 is okay, so disk 6 must be in error qecc (Κώδικες διόρθωσης λαθών) δίσκοι κρατούν την ισοτιμία δεδομένων (parity) σε ένα set ξεχωριστών (distinct overlapping) δίσκων # redundant disks = log (total # of data disks) so almost twice the cost of one big disk - writes require computing parity to write to the ECC disks - reads require reading ECC disk and confirming parity qανέχεται περιορισμένο αριθμό βλαβών, τα δεδομένα μπορούν να διορθωθούν βάσει των αποθηκευμένων ισοτιμιών ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.48 0 1 0 1 0 1 0

RAID: Level 3 (Bit-Interleaved Parity) blk1,b0 blk1,b1 blk1,b2 blk1,b3 1 0 1 0 1 qτο κόστος ψηλότερης διαθεσιμότητας είναι 1/N όπου το N είναι ο αριθμός των δίσκων σε μια ομάδα προστασίας (protection group) # redundant disks = 1 # of protection groups - writes require writing the new data to the data disk as well as computing the parity, meaning reading the other disks, so that the parity disk can be updated qανέχεται περιορισμένο ποσοστό βλάβης (limited disk failure) - reads require reading all the operational data disks as well as the parity disk to calculate the missing data that was stored on the failed disk ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.49 disk fails (odd) bit parity disk

RAID: Level 4 (Block-Interleaved Parity) qτο κόστος ψηλότερης διαθεσιμότητας είναι ακόμα 1/N αλλά η ισοτιμία (parity) αποθηκεύεται σαν blocks συζευγμένα με sets απο κανονικά data blocks Four times the throughput (striping) # redundant disks = 1 # of protection groups Υποστηρίζει small reads και small writes (reads and writes that go to just one (or a few) data disk in a protection group) - by watching which bits change when writing new information, need only to change the corresponding bits on the parity disk - the parity disk must be updated on every write, so it is a bottleneck for back-to-back writes qανέχεται περιορισμένο ποσοστό βλάβης (limited disk failure) ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.50 blk1 blk2 blk3 blk4 block parity disk

Small Writes qraid 3 small writes New D1 data D1 D2 D3 D4 P 3 reads and 2 writes involving all the disks Å D1 D2 D3 D4 P qraid 4 small writes New D1 data D1 D2 D3 D4 P 2 reads and 2 writes involving just two disks Å D1 D2 D3 D4 P Å ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.51

RAID: Level 5 (Distributed Block-Interleaved Parity) one of these assigned as the block parity disk qτο κόστος ψηλότερης διαθεσιμότητας είναι ακόμα 1/N αλλά το block ισοτιμίας μπορεί να είναι σε οποιονδήποτε δίσκο, άρα δεν έχουν μειονέκτημα οι εγγραφές Still four times the throughput (striping) # redundant disks = 1 # of protection groups Supports small reads and small writes (reads and writes that go to just one (or a few) data disk in a protection group) Allows multiple simultaneous writes as long as the accompanying parity blocks are not located on the same disk qανέχεται περιορισμένο ποσοστό βλάβης (limited disk failure) ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.52

Distributing Parity Blocks RAID 4 RAID 5 1 2 3 4 P0 1 2 3 4 P0 5 6 7 8 P1 5 6 7 P1 8 9 10 11 12 P2 9 10 P2 11 12 13 14 15 16 P3 13 P3 14 15 16 qδιασκορπώντας τα blocks ισοτιμίας σε όλους τους δίσκους μερικά small writes γίνονται παράλληλα ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.53

RAID-5 Striping Distributed Parity Disk space = Disk Drives - 1 1 2 3 Parity 4 5 Parity 6 7 Parity 8 9 Parity 10 11 12 ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.54

RAID-5 Write Step 1: Data and Parity are Read 1 2 3 Parity 4 5 Parity 6 7 Parity 8 9 Parity 10 11 12 ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.55

RAID-5 Write Step 2: New Parity is Calculated XOR Engine Calculates parity 1 2 3 Parity 4 5 Parity 6 7 Parity 8 9 Parity 10 11 12 ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.56

RAID-5 Write Step 3: Data and Parity are Written 1 2 3 Parity 4 5 Parity 6 7 Parity 8 9 Parity 10 11 12 ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.57

SSD The New Era! ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.58

Memory as Secondary Storage! ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.59

Επανάληψη qτέσσερις ορολογίες χρόνου: Seek Time / Χρόνος Έρευνας: advertised to be 3 to 14 ms but lower in real systems Χρόνος περιστροφής: 5.6 ms at 5400 RPM and 2.0 ms at 15000 RPM Χρόνος Μεταφοράς: 30 to 80 MB/s Χρόνος ελέγχου (controller): typically less than.2 ms q Τα RAIDS χρησιμοποιούνται για αξιοπιστία και διαθεσιμότητα RAID 0 and RAID 5 widely used in servers, one estimate is that 80% of disks in servers are RAIDs RAID 1 (mirroring) EMC, Tandem, IBM RAID 3 Storage Concepts RAID 4 Network Appliance qτα RAIDS έχουνε αρκετό πλεόνασμα δεδομένων για συνεχή λειτουργία, (αλλά όχι hot swapping) ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.60

Review: Major Components of a Computer Processor Devices Control Memory Output Datapath Input qσημαντικοί παράμετροι συστήματος Ι/Ο Απόδοση (Performance) Ικανότητα Επέκτασης (Expandability) Συνέπεια/Αξιοπιστία (Dependability) Κόστος, μέγεθος, βάρος ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.61

Συσκευές Εισόδου και Εξόδου (I/O Devices) qοι συσκευές I/O διαφέρουν σε μεγάλο βαθμό, ανάλογα με: Συμπεριφορά (Behavior) είσοδος, έξοδος ή αποθήκευση Συνεργάτης (Partner) άνθρωπος ή μηχανή Ροή Δεδομένων (Data rate) η μέγιστη ροή με την οποία μπορούν να μεταφερθούν δεδομένα μεταξύ της συσκευής Ι/Ο της κυρίως μνήμης ή του επεξεργαστή Device Behavior Partner Data rate (Mb/s) Keyboard input human 0.0001 Mouse input human 0.0038 Laser printer output human 3.2000 Graphics display output human 800.0000-8000.0000 Network/LAN input or output machine 100.0000-1000.0000 Magnetic disk storage machine 240.0000-2560.0000 8 orders of magnitude range (always in base 10) ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.62

I/O -- Μέτρηση Απόδοσης q Εύρος (I/O bandwidth) (throughput) ποσότητα πληροφοριών που εισέρχεται (ή εξέρχεται) και επικοινωνεί μέσω μιας διασύνδεσης (π.χ. ένας δίαυλος) με επεξεργαστή/μνήμη, ανά μονάδα χρόνου 1. Πόσα δεδομένα μπορούμε να μεταφέρουμε μέσω του συστήματος κατά τη διάρκεια κάποιου χρονικού διαστήματος; 2. Πόσες Ι/Ο πράξεις μπορούν να γίνουν ανά μονάδα χρόνου; q Χρόνος Ανταπόκρισης (I/O response time) (latency) ο συνολικός χρόνος διεκπεραίωσης ενός Ι/Ο αιτήματος Ιδιαίτερα σημαντική παράμετρος σε συστήματα πραγματικού χρόνου (real-time systems) q Πολλές εφαρμογές απαιτούν και ψηλό εύρος και χαμηλό χρόνο ανταπόκρισης ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.63

A Typical I/O System Processor Interrupts Cache Memory - I/O Bus Main Memory I/O Controller I/O Controller I/O Controller Disk Disk Graphics Network ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.64

Απόδοση Συστήματος I/O q Σχεδιασμός ενός συστήματος Ι/Ο για συγκεκριμένο εύρος και χρόνο ανταπόκρισης περιλαμβάνει: 1. Καθορισμό του αδύναμου κρίκου στο σύστημα I/O η μονάδα που περιορίζει το σύστημα The processor and memory system? The underlying interconnection (e.g., bus)? The I/O controllers? The I/O devices themselves? 2. (Ανά)διάταξη του αδύναμου κρίκου για εκπλήρωση απαιτήσεων εύρους και χρόνου ανταπόκρισης 3. Καθορισμός απαιτήσεων για υπόλοιπες μονάδες και (ανα)διάταξη τους για υποστήριξη των καινούριων παραμέτρων (latency and/or bandwidth) ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.65

I/O System Performance Example q A disk workload consisting of 64KB reads and writes where the user program executes 200,000 instructions per disk I/O operation and a processor that sustains 3 billion instr/s and averages 100,000 OS instructions to handle a disk I/O operation The maximum disk I/O rate (# I/O s/sec) of the processor is Instr execution rate 3 x 10 -------------------------- = ------------------------ 9 = 10,000 disk I/O s/s Instr per I/O (200 + 100) x 10 3 a memory-i/o bus that sustains a transfer rate of 1000 MB/s Each disk I/O reads/writes 64 KB so the maximum I/O rate of the bus is Bus bandwidth 1000 x 10 ---------------------- = ----------------- 6 = 15,625 I/O s/s Bytes per I/O 64 x 10 3 SCSI disk I/O controllers with a DMA transfer rate of 320 MB/s that can accommodate up to 7 disks per controller disk drives with a read/write bandwidth of 75 MB/s and an average seek plus rotational latency of 6 ms what is the maximum sustainable I/O rate and what is the number of disks and SCSI controllers required to achieve that rate? ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.66

Disk I/O System Example Processor 10,000 I/O s/s Cache Memory - I/O Bus 15,625 I/O s/s 320 MB/s Main Memory I/O Controller I/O Controller Disk Disk Disk Disk 75 MB/s Up to 7 ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.67

Παράδειγμα Απόδοσης Συστήματος I/O, Συν. So the processor is the bottleneck, not the bus disk drives with a read/write bandwidth of 75 MB/s and an average seek plus rotational latency of 6 ms Disk I/O read/write time = seek + rotational time + transfer time = 6ms + 64KB/(75MB/s) = 6.9ms Thus each disk can complete 1 I/O operation in 6.9ms à in 1 sec (1000ms) it will complete 1000ms/6.9ms = 144 I/O s per sec. To saturate the processor requires 10,000 I/O s per second or 10,000/144 = 69 disks To calculate the number of SCSI disk controllers, we need to know the average transfer rate per disk to ensure we can put the maximum of 7 disks per SCSI controller and that a disk controller won t saturate the memory-i/o bus during a DMA transfer Disk transfer rate = (transfer size)/(transfer time) = 64KB/6.9ms = 9.56 MB/s Thus 7 disks won t saturate either the SCSI controller (with a maximum transfer rate of 320 MB/s) or the memory-i/o bus (1000 MB/s). This means we will need 69/7 or 10 SCSI controllers. ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.68

Σύστημα διασύνδεσης I/O Προβλήματα qένας δίαυλος (bus) είναι κοινό μέσο επικοινωνίας (a single set of wires used to connect multiple subsystems) που χρειάζεται να υποστηρίζει ένα εύρος ποικίλων καθυστερήσεων (latencies) και διάφορα μεγέθη ροής δεδομένων Πλεονεκτήματα (advantages) - Versatile / Ευελιξία new devices can be added easily and can be moved between computer systems that use the same bus standard - Low cost / Χαμηλό Κόστος a single set of wires is shared in multiple ways Μειονεκτήματα (disadvantages) - Creates a communication bottleneck bus bandwidth limits the maximum I/O throughput (το εύρος περιορίζει την παραγωγή) qh μέγιστη ταχύτητα του διαύλου περιορίζεται από Το μήκος (length of the bus) Τον αριθμό ενεργών συσκευών (number of devices on the bus) ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.69

Χαρακτηριστικά Διαύλων Bus Master Control lines: Master initiates requests Data lines: Data can go either way Bus Slave qcontrol lines / Γραμμές Ελέγχου Signal requests and acknowledgments Indicate what type of information is on the data lines qdata lines / Γραμμές Δεδομένων Data, addresses, and complex commands qη συναλλαγή (Bus transaction) αποτελείται από Master issuing the command (and address) request Slave receiving (or sending) the data action Defined by what the transaction does to memory - Input inputs data from the I/O device to the memory - Output outputs data from the memory to the I/O device ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.70

Είδη διαύλων qεπεξεργαστής Μνήμη (proprietary) Short and high speed Matched to the memory system to maximize the memoryprocessor bandwidth Optimized for cache block transfers qδίαυλος I/O (industry standard, e.g., SCSI, USB, Firewire) Usually is lengthy and slower Needs to accommodate a wide range of I/O devices Connects to the processor-memory bus or backplane bus qbackplane bus (industry standard, e.g., ATA, PCIexpress) The backplane is an interconnection structure within the chassis Used as an intermediary bus connecting I/O busses to the processor-memory bus ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.71

Συγχρονισμένοι και Ασύγχρονοι Δίαυλοι qsynchronous bus (e.g., processor-memory buses) Includes a clock in the control lines and has a fixed protocol for communication that is relative to the clock Advantage: involves very little logic and can run very fast Disadvantages: - Every device communicating on the bus must use same clock rate - To avoid clock skew, they cannot be long if they are fast qasynchronous bus (e.g., I/O buses) It is not clocked, so requires a handshaking protocol and additional control lines (ReadReq, Ack, DataRdy) Advantages: - Can accommodate a wide range of devices and device speeds - Can be lengthened without worrying about clock skew or synchronization problems Disadvantage: slow(er) ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.72

Asynchronous Bus Handshaking Protocol q Output (read) data from memory to an I/O device ReadReq Data Ack DataRdy 1 addr 2 3 4 5 data 6 7 I/O device signals a request by raising ReadReq and putting the addr on the data lines 1. Memory sees ReadReq, reads addr from data lines, and raises Ack 2. I/O device sees Ack and releases the ReadReq and data lines 3. Memory sees ReadReq go low and drops Ack 4. When memory has data ready, it places it on data lines and raises DataRdy 5. I/O device sees DataRdy, reads the data from data lines, and raises Ack 6. Memory sees Ack, releases the data lines, and drops DataRdy 7. I/O device sees DataRdy go low and drops Ack ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.73

Η ανάγκη για προτεραιότητα στον δίαυλο qπολλαπλές συσκευές απαιτούν την χρήση του διαύλου την ίδια ώρα. Χρειάζεται κατανομή προτεραιότητας qτα σχήματα προτεραιότητας συνήθως κατανέμουν: Bus priority the highest priority device should be serviced first Fairness even the lowest priority device should never be completely locked out from the bus qτα σχήματα προτεραιότητας χωρίζονται σε τέσσερις κατηγορίες: Daisy chain arbitration see next slide Centralized, parallel arbitration see next-next slide Distributed arbitration by self-selection each device wanting the bus places a code indicating its identity on the bus Distributed arbitration by collision detection device uses the bus when its not busy and if a collision happens (because some other device also decides to use the bus) then the device tries again later (Ethernet) ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.74

Daisy Chain Bus Arbitration Device 1 Highest Priority Device 2 Device N Lowest Priority Bus Arbiter Ack Ack Ack Release Request wired-or Data/Addr qπλεονέκτημα - Απλότητα qμειονεκτήματα: Δεν εξασφαλίζει δίκαιη κατανομή (fairness) a low-priority device may be locked out indefinitely Αργό the daisy chain grant signal limits the bus speed ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.75

Centralized Parallel Arbitration Device 1 Device 2 Device N Bus Arbiter Ack1 Request1 Request2 RequestN Ack2 AckN Data/Addr qπλεονεκτήματα: ευέλικτο, εγγυάται δίκαιη κατανομή. qμειονεκτήματα: πιο περίπλοκα arbiter hardware qχρήση σε όλους τους διαύλους μνήμης-επεξεργαστή και σε διαύλους ψηλών ταχυτήτων I/O ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.76

Το Εύρος Διαύλου Εξαρτάται από Αν είναι σύγχρονο ή όχι, και τα χαρακτηριστικά χρόνου του πρωτοκόλλου που ακολουθείται Το πλάτος σε bits του διαύλου Την ποσότητα δεδομένων που υποστηρίζει (block, word, byte, etc.) Firewire USB 2.0 Type I/O I/O Data lines 4 2 Clocking Asynchronous Asynchronous Max # devices 63 127 Max length 4.5 meters 5 meters Peak bandwidth 50 MB/s (400 Mbps) 100 MB/s (800 Mbps) 0.2 MB/s (low) 1.5 MB/s (full) 60 MB/s (high) ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.77

Modern Busses ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.78

Example: The Pentium 4 s Buses 2 serial ATAs: 150 MB/s Memory Controller Hub ( Northbridge ) Graphics output: 2.0 GB/s Gbit ethernet: 0.266 GB/s 2 parallel ATA: 100 MB/s System Bus ( Front Side Bus ): 64b x 800 MHz (6.4GB/s), 533 MHz, or 400 MHz DDR SDRAM Main Memory Hub Bus: 8b x 266 MHz PCI: 32b x 33 MHz 8 USBs: 60 MB/s I/O Controller Hub ( Southbridge ) ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.79

Intel Pentium i7 Busses ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.80

Buses in Transition qcompanies are transitioning from synchronous, parallel, wide buses to asynchronous narrow buses Reflection on wires and clock skew makes it difficult to use 16 to 64 parallel wires running at a high clock rate (e.g., ~400 MHz) so companies are transitioning to buses with a few oneway wires running at a very high clock rate (~2 GHz) PCI PCIexpress ATA Serial ATA Total # wires 120 36 80 7 # data wires 32 64 (2-way) 2 x 4 (1-way) 16 (2-way) 2 x 2 (1-way) Clock (MHz) 33 133 625 50 150 Peak BW (MB/s) 128 1064 300 100 375 (3 Gbps) ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.81

ATA Cable Sizes qserial ATA cables (red) are much thinner than parallel ATA cables (green) ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.82

I/O και το Λειτουργικό Σύστημα qthe operating system acts as the interface between the I/O hardware and the program requesting I/O To protect the shared I/O resources, the user program is not allowed to communicate directly with the I/O device qthus OS must be able to give commands to I/O devices, handle interrupts generated by I/O devices, provide equitable access to the shared I/O resources, and schedule I/O requests to enhance system throughput I/O interrupts result in a transfer of processor control to the supervisor (OS) process ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.83

Communication of I/O Devices and Processor qπως ο επεξεργαστής κατευθύνει τις συσκευές I/O Ειδικές I/O εντολές ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.84 - Must specify both the device and the command «Τοποθέτηση» (mapping) συσκευών I/O στην μνήμη - Portions of the high-order memory address space are assigned to each I/O device - Read and writes to those memory addresses are interpreted as commands to the I/O devices - Load/stores to the I/O address space can only be done by the OS qπως μια συσκευή I/O επικοινωνεί με τον επεξεργαστή Έλεγχος / Polling the processor periodically checks the status of an I/O device to determine its need for service - Processor is totally in control but does all the work - Can waste a lot of processor time due to speed differences Interrupt-driven I/O η συσκευή I/O διακόπτει με ένα σήμα τον επεξεργαστή ζητώντας προσοχή

Interrupt-Driven I/O qan I/O interrupt is asynchronous wrt instruction execution Is not associated with any instruction so doesn t prevent any instruction from completing - You can pick your own convenient point to handle the interrupt qwith I/O interrupts Need a way to identify the device generating the interrupt Can have different urgencies (so may need to be prioritized) qadvantages of using interrupts Relieves the processor from having to continuously poll for an I/O event; user program progress is only suspended during the actual transfer of I/O data to/from user memory space qdisadvantage special hardware is needed to Cause an interrupt (I/O device) and detect an interrupt and save the necessary information to resume normal processing after servicing the interrupt (processor) ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.85

Interrupt-Driven Input Memory Processor Receiver 1. input interrupt add sub and or beq user program Keyboard lbu sb... jr : input interrupt service routine memory ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.86

Interrupt-Driven Input Processor Memory Receiver Keyboard 1. input interrupt 2.1 save state 2.2 jump to interrupt service routine 2.4 return to user code add sub and or beq lbu sb... jr user program 2.3 service interrupt input interrupt service routine memory ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.87

Interrupt-Driven Output Processor Memory Trnsmttr Display 1.output interrupt 2.1 save state 2.2 jump to interrupt service routine 2.4 return to user code add sub and or beq lbu sb... jr user program 2.3 service interrupt output interrupt service routine memory ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.88

Direct Memory Access (DMA) Απευθείας Προσπέλαση Μνήμης q Για συσκευές ψηλού εύρους (π.χ. δίσκοι) το interruptdriven I/O θα χρησιμοποιούσε πολλούς κύκλους επεξεργαστή q Απευθείας Προσπέλαση Μνήμης (DMA)-- το I/O controller μεταφέρει δεδομένα απευθείας (directly) προς/από την μνήμη χωρίς την ανάμειξη του επεξεργαστή 1. The processor initiates the DMA transfer by supplying the I/O device address, the operation to be performed, the memory address destination/source, the number of bytes to transfer 2. The I/O DMA controller manages the entire transfer (possibly thousand of bytes in length), arbitrating for the bus 3. When the DMA transfer is complete, the I/O controller interrupts the processor to let it know that the transfer is complete q Ένα σύστημα μπορεί να έχει πολλαπλά DMA processors Αν έχει πολλαπλά Ι/Ο busses à 1 DMA per bus ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.89

Το Πρόβλημα Δεδομένων με DMA (Stale data problem / Coherence problem) q Τα συστήματα με caches έχουν δύο αντίγραφα δεδομένων (ένα στο cache και ένα στην κυρίως μνήμη) For a DMA read (from disk to memory) the processor will be using stale data if that location is also in the cache For a DMA write (from memory to disk) and a write-back cache the I/O device will receive stale data if the data is in the cache and has not yet been written back to the memory q Η συμφωνία cache/μνήμης λύνεται με διάφορους τρόπους: 1. Routing all I/O activity through the cache expensive and a large negative performance impact 2. Having the OS selectively invalidate the cache for an I/O read or force write-backs for an I/O write (flushing) 3. Providing hardware to selectively invalidate or flush the cache need a hardware snooper ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.90

ΕΠΟΜΕΝΗ ΔΙΑΛΕΞΗ ΚΑΙ ΚΑΤ ΟΙΚΟΝ ΜΕΛΕΤΗ q ΕΠΟΜΕΝΗ ΕΝΟΤΗΤΑ Interconnection Networks Principles / Δίκτυα Διασύνδεσης qενδιαμεση ΕΞΕΤΑΣΗ! q ΚΑΤ ΟΙΚΟΝ ΜΕΛΕΤΗ Κεφάλαιο 6 (θέματα που είδαμε στις διαλέξεις) Κεφάλαιο 8 Patterson&Hennessy (από το βιβλίο του ΗΜΥ212) ΗΜΥ312 ΔΙΑΛΕΞΕΙΣ 9-10.Ι/Ο-Αποθήκευση.91