Computer I/O Systems and Architecture

Explore Computer I/O Systems and Architecture, from performance measures to RAID. Master I/O management, bus types, and storage technologies for your studies!

Podcast

Úložiště a I/O: Od disků po RAID0:00 / 19:51
0:001:00 remaining

Welcome to a deep dive into Computer I/O Systems and Architecture, a fundamental aspect of how computers interact with the world and manage data. Understanding I/O (Input/Output) systems is crucial for anyone studying computer science, as it dictates performance, dependability, and how efficiently a system can process and store information. This guide will cover key characteristics, performance measures, various I/O management techniques, and storage technologies like RAID, all essential for mastering computer architecture.

Understanding Computer I/O Systems and Architecture

I/O devices are the bridges between the computer's central processing unit and external components, whether human or machine. They can be categorized by their behavior (input, output, storage), their partner (human or machine), and their data rate (bytes/sec, transfers/sec). A well-designed I/O system is critical for overall system performance and stability.

Key Characteristics of I/O Systems

Two primary characteristics define I/O systems: dependability and performance measures. Dependability is especially vital for storage devices, where data integrity is paramount. Performance is measured by latency (response time) and throughput (bandwidth).

  • Desktops & Embedded Systems: These typically prioritize response time and the diversity of supported devices.
  • Servers: Servers, on the other hand, focus heavily on throughput and expandability, given their role in handling numerous simultaneous requests.

Dependability, Reliability, and Availability

Dependability is a broad term encompassing several measures:

  • Fault: A failure of a component, which may or may not lead to system failure.
  • Service Accomplishment: The service is delivered exactly as specified.
  • Service Interruption: Any deviation from the specified service.
  • Failure: The point at which service interruption occurs.
  • Restoration: The process of bringing the service back to normal operation.

Key metrics for dependability include:

  • Reliability: Measured by Mean Time To Failure (MTTF).
  • Service Interruption: Measured by Mean Time To Repair (MTTR).
  • Mean Time Between Failures (MTBF): Calculated as MTTF + MTTR.
  • Availability: Determined by MTTF / (MTTF + MTTR).

To improve availability, systems aim to increase MTTF through fault avoidance, fault tolerance, and fault forecasting, and reduce MTTR via better diagnosis and repair tools.

Disk Storage and Flash Storage

Storage devices are a crucial part of I/O systems, holding the data that applications and users interact with. We primarily distinguish between traditional disk storage and modern flash storage.

Disk Storage Overview

Disk storage refers to nonvolatile, rotating magnetic storage devices, commonly known as Hard Disk Drives (HDDs).

Disk Sectors and Access: Each sector on a disk records:

  • Sector ID
  • Data (typically 512 bytes, with 4096 bytes proposed)
  • Error Correcting Code (ECC) to hide defects and recording errors
  • Synchronization fields and gaps

Accessing a sector involves several steps:

  • Queuing delay: If other accesses are pending.
  • Seek: Moving the read/write heads to the correct track.
  • Rotational latency: Waiting for the desired sector to rotate under the head.
  • Data transfer: Reading or writing the data.
  • Controller overhead: Time spent by the disk controller.

Example: For a 512B sector, 15,000rpm, 4ms average seek, 100MB/s transfer, and 0.2ms controller overhead on an idle disk, the average read time is 4ms (seek) + 2ms (rotational latency) + 0.005ms (transfer) + 0.2ms (controller) = 6.2ms.

Disk Performance Issues: Manufacturers often quote average seek time based on all possible seeks. However, locality and OS scheduling typically lead to smaller actual average seek times. Modern disk controllers manage physical sectors and present a logical sector interface (e.g., SCSI, ATA, SATA) to the host. Drives also include caches to prefetch sectors and reduce seek/rotational delays.

Flash Storage Explained

Flash storage is a nonvolatile semiconductor-based storage technology. It is significantly faster than traditional disks (100x – 1000x), smaller, uses less power, and is more robust. However, it typically costs more per gigabyte than HDDs.

Types of Flash:

  • NOR flash: Similar to a NOR gate bit cell, offering random read/write access. It's often used for instruction memory in embedded systems.
  • NAND flash: Resembles a NAND gate bit cell, offering higher density (more bits per area) but requiring block-at-a-time access. It's cheaper per GB and used in USB keys, media storage, and solid-state drives (SSDs).

Wear Leveling: A key challenge with flash memory is that bits wear out after thousands of accesses. Flash memory is not suitable for direct RAM or disk replacement without management. Wear leveling techniques remap data to less-used blocks to extend the life of the device.

Interconnecting Components: Buses and I/O Management

Effective I/O systems rely on robust interconnections and efficient management by the operating system.

Bus Types and Synchronization

Buses are shared communication channels that connect the CPU, memory, and I/O controllers. While traditionally parallel sets of wires, modern systems often use high-speed serial connections with switches, similar to networks.

Types of Buses:

  • Processor-Memory Buses: Short, high-speed buses designed specifically for the memory organization.
  • I/O Buses: Longer, allowing multiple connections and specified by standards for interoperability. They connect to the processor-memory bus via a bridge.

Bus Signals and Synchronization:

  • Data Lines: Carry addresses and data, either multiplexed or separate.
  • Control Lines: Indicate data type and synchronize transactions.
  • Synchronous Buses: Use a bus clock for timing.
  • Asynchronous Buses: Employ request/acknowledge control lines for handshaking to synchronize transactions.

I/O Bus Examples: Key examples of I/O buses include Firewire, USB 2.0, PCI Express, Serial ATA (SATA), and Serial Attached SCSI (SAS). These vary in intended use (external/internal), devices per channel, data width, peak bandwidth, hot-pluggability, max length, and governing standards.

I/O Management by the Operating System

The operating system (OS) mediates I/O operations, ensuring multiple programs can share resources, providing protection, and scheduling access. I/O operations often trigger asynchronous interrupts, which are handled by the OS.

I/O Commands: I/O devices are managed by I/O controller hardware, which transfers data and synchronizes operations with software. Controllers have:

  • Command registers: Cause the device to perform an action.
  • Status registers: Indicate the device's current state and errors.
  • Data registers: Used to transfer data to (write) or from (read) a device.

I/O Register Mapping:

  • Memory-mapped I/O: Registers are addressed in the same space as memory. An address decoder distinguishes them, and the OS uses address translation to restrict access to the kernel.
  • I/O Instructions: Separate instructions are used to access I/O registers, executable only in kernel mode (e.g., x86 architecture).

Methods of I/O Data Transfer

Several methods exist for transferring data between the CPU and I/O devices:

  • Polling: The CPU periodically checks an I/O status register. If the device is ready or an error occurs, it performs the operation or takes action. Common in small, low-performance embedded systems due to predictable timing and low hardware cost, but can waste CPU time in other systems.
  • Interrupts: When a device is ready or an error occurs, the controller interrupts the CPU. This is similar to an exception but not synchronized to instruction execution. Interrupt handlers identify the device, and priority interrupts allow more urgent devices to take precedence.
  • Direct Memory Access (DMA): For high-speed devices, the CPU transfers data directly between memory and I/O data registers, which can be time-consuming. With DMA, the OS provides a starting memory address, and the I/O controller autonomously transfers data to/from memory. The controller interrupts the CPU only upon completion or error.

DMA/Cache Interaction: DMA can introduce cache coherence issues. If DMA writes to a cached memory block, the cached copy becomes stale. If a write-back cache has a dirty block that DMA reads, DMA reads stale data. Solutions include flushing blocks from the cache for DMA operations or using non-cacheable memory locations for I/O.

DMA/VM Interaction: The OS uses virtual addresses. If DMA uses physical addresses, transfers may need to be broken into page-sized chunks, chained, or require contiguous physical pages. If DMA uses virtual addresses, the controller would need to perform address translation.

Flashcards

1 / 86

What are the three ways to characterize an I/O device mentioned in the content?

Behaviour (input, output, storage), partner (human or machine), and data rate (bytes/sec, transfers/sec) including I/O bus connections.

Tap to flip · Swipe to navigate

Measuring I/O Performance and Benchmarking

Assessing I/O performance involves understanding various metrics and using standardized benchmarks.

I/O Performance Measures

I/O performance depends on hardware (CPU, memory, controllers, buses), software (OS, DBMS, application), and workload (request rates and patterns). I/O system design often involves a trade-off between response time and throughput. Throughput measurements are frequently conducted with constrained response times.

I/O Benchmarks

Several benchmarks help evaluate I/O system performance:

  • Transaction Processing Benchmarks (TPC): Focus on small data accesses to a Database Management System (DBMS). They measure I/O rate (throughput) subject to response time limits and failure handling, adhering to ACID (Atomicity, Consistency, Isolation, Durability) properties. The goal is to measure overall cost per transaction.

  • TPC-APP: Benchmarks B2B application servers and web services.

  • TPC-C: Simulates an online order entry environment.

  • TPC-E: Focuses on online transaction processing for brokerage firms.

  • TPC-H: For decision support, involving business-oriented ad-hoc queries.

  • File System & Web Benchmarks:

  • SPEC System File System (SFS): Uses a synthetic workload for NFS servers based on real-system monitoring. Results include throughput (operations/sec) and response time (average ms/operation).

  • SPEC Web Server Benchmark: Measures simultaneous user sessions, subject to required throughput per session, with workloads like Banking, E-commerce, and Support.

I/O vs. CPU Performance and RAID

As CPU performance increases, I/O performance becomes an even more critical factor. Amdahl's Law reminds us not to neglect I/O performance, especially as parallelism boosts compute capabilities.

Example: If a benchmark takes 90s CPU and 10s I/O (100s total), doubling CPUs every 2 years while I/O remains constant quickly makes I/O a bottleneck:

  • Now: 90s CPU, 10s I/O, 100s Elapsed (10% I/O)
  • +2 years: 45s CPU, 10s I/O, 55s Elapsed (18% I/O)
  • +4 years: 23s CPU, 10s I/O, 33s Elapsed (31% I/O)
  • +6 years: 11s CPU, 10s I/O, 21s Elapsed (47% I/O)

Redundant Array of Independent Disks (RAID)

RAID uses multiple smaller disks instead of one large disk to improve both performance and dependability. It provides fault-tolerant storage, especially with

Sign up to access full content

Create a free account to unlock all study materials, take interactive tests, listen to podcasts and more.

Create free account

Related topics