ì ¡ Computer ¡Systems ¡and ¡Networks ¡ ECPE ¡170 ¡– ¡Jeff ¡Shafer ¡– ¡University ¡of ¡the ¡Pacific ¡ Input ¡/ ¡Output ¡
2 ¡ Schedule ¡ ì Quiz ¡6 ¡– ¡Tuesday, ¡Nov ¡22 nd ¡ ¡ ì Input ¡/ ¡Output ¡ ì OperaEng ¡Systems ¡ ì Compilers ¡& ¡Assemblers ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2011 ¡
3 ¡ ì ¡ Input ¡/ ¡Output ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2011 ¡
4 ¡ I/O ¡and ¡Performance ¡ Star=ng ¡Chapter ¡7 ¡ ì Data ¡storage ¡and ¡retrieval ¡is ¡one ¡of ¡the ¡primary ¡funcEons ¡of ¡ ì computer ¡systems ¡ Sluggish ¡I/O ¡throughput ¡can ¡have ¡a ¡ripple ¡effect, ¡dragging ¡ ì down ¡overall ¡system ¡performance ¡ This ¡is ¡especially ¡true ¡when ¡virtual ¡memory ¡is ¡involved ¡ ì The ¡fastest ¡processor ¡in ¡the ¡world ¡is ¡of ¡liNle ¡use ¡if ¡it ¡spends ¡ ì most ¡of ¡its ¡Eme ¡waiEng ¡for ¡data ¡ If ¡we ¡really ¡understand ¡what’s ¡happening ¡in ¡a ¡computer ¡ ì system ¡we ¡can ¡make ¡the ¡best ¡possible ¡use ¡of ¡its ¡resources ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2011 ¡
5 ¡ Amdahl’s ¡Law ¡ ì The ¡overall ¡performance ¡of ¡a ¡system ¡is ¡a ¡result ¡of ¡the ¡ interacEon ¡of ¡all ¡of ¡its ¡components ¡ ì System ¡performance ¡is ¡most ¡effecEvely ¡improved ¡when ¡ the ¡performance ¡of ¡the ¡most ¡heavily ¡used ¡components ¡ is ¡improved ¡ ì This ¡idea ¡is ¡quanEfied ¡by ¡Amdahl’s ¡Law: ¡ where ¡ S ¡is ¡the ¡overall ¡speedup; ¡ ¡ f ¡is ¡the ¡fracEon ¡of ¡work ¡performed ¡by ¡a ¡ faster ¡component; ¡and ¡ ¡ k ¡is ¡the ¡speedup ¡of ¡the ¡faster ¡component ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2011 ¡
6 ¡ Amdahl’s ¡Law ¡ ì Amdahl’s ¡Law ¡can ¡esEmate ¡the ¡performance ¡ improvement ¡of ¡upgrading ¡a ¡system ¡component ¡ ì On ¡a ¡large ¡system, ¡suppose ¡we ¡can ¡upgrade ¡a ¡CPU ¡ to ¡make ¡it ¡50% ¡faster ¡for ¡$10,000 ¡or ¡upgrade ¡its ¡ disk ¡drives ¡for ¡$7,000 ¡to ¡make ¡them ¡150% ¡faster ¡ ì Processes ¡spend ¡70% ¡of ¡their ¡Eme ¡running ¡in ¡the ¡ CPU ¡and ¡30% ¡of ¡their ¡Eme ¡waiEng ¡for ¡disk ¡service ¡ ì An ¡upgrade ¡of ¡which ¡component ¡would ¡offer ¡the ¡ greater ¡benefit ¡for ¡the ¡lesser ¡cost? ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2011 ¡
7 ¡ Amdahl’s ¡Law ¡ ì The ¡processor ¡opEon ¡offers ¡a ¡30% ¡speedup: ¡ ì And ¡the ¡disk ¡drive ¡opEon ¡gives ¡a ¡22% ¡speedup: ¡ ì Each ¡1% ¡of ¡improvement ¡for ¡the ¡processor ¡costs ¡$333, ¡ and ¡for ¡the ¡disk ¡a ¡1% ¡improvement ¡costs ¡$318 ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2011 ¡
8 ¡ ì ¡ I/O ¡Architecture ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2011 ¡
9 ¡ I/O ¡Architectures ¡ ì DefiniEon ¡of ¡I/O ¡subsystem: ¡components ¡that ¡move ¡ data ¡between ¡external ¡devices ¡and ¡a ¡host ¡system ¡ ì I/O ¡subsystems ¡include: ¡ Blocks ¡of ¡main ¡memory ¡ that ¡are ¡devoted ¡to ¡I/O ¡funcEons ¡ ì Buses ¡that ¡move ¡data ¡into ¡and ¡out ¡of ¡the ¡system. ¡ ì Control ¡modules ¡ in ¡the ¡host ¡and ¡in ¡peripheral ¡devices ¡ ì Interfaces ¡to ¡external ¡component s ¡such ¡as ¡keyboards ¡ ì and ¡disks ¡ Cabling ¡or ¡communica=ons ¡links ¡ between ¡the ¡host ¡ ì system ¡and ¡its ¡peripherals ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2011 ¡
10 ¡ Modern ¡AMD ¡Opteron ¡System ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2011 ¡
11 ¡ I/O ¡Architectures ¡ ì Programmed ¡I/O ¡ ¡ ì Memory-‑Mapped ¡I/O ¡ ¡ Reserves ¡a ¡register ¡for ¡ Shares ¡memory ¡address ¡ ì ì each ¡I/O ¡device ¡ space ¡between ¡I/O ¡devices ¡ and ¡program ¡memory ¡ Each ¡register ¡is ¡conEnually ¡ ì polled ¡in ¡so]ware ¡to ¡ ì Direct ¡Memory ¡Access ¡ detect ¡data ¡arrival ¡ (DMA) ¡ ì Interrupt-‑Driven ¡I/O ¡ Offloads ¡I/O ¡processing ¡to ¡ ì a ¡special-‑purpose ¡chip ¡that ¡ Allows ¡the ¡CPU ¡to ¡do ¡other ¡ ì takes ¡care ¡of ¡the ¡details. ¡ things ¡unEl ¡I/O ¡is ¡ requested ¡ These ¡are ¡not ¡mutually ¡exclusive ¡categories! ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2011 ¡
12 ¡ I/O ¡Architectures ¡– ¡Interrupts ¡ ì Each ¡device ¡connects ¡its ¡interrupt ¡line ¡to ¡the ¡interrupt ¡controller. ¡ The ¡controller ¡ signals ¡the ¡CPU ¡ when ¡any ¡of ¡the ¡ interrupt ¡lines ¡ are ¡asserted. ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2011 ¡
13 ¡ I/O ¡Architectures ¡– ¡Interrupts ¡ ì Interrupt ¡signal ¡is ¡checked ¡at ¡the ¡top ¡of ¡the ¡fetch-‑ decode-‑execute ¡cycle ¡ ì Interrupt? ¡Save ¡system ¡state, ¡go ¡run ¡ interrupt ¡ service ¡rou=ne, ¡ and ¡restore ¡system ¡state ¡a]erwards ¡ ì No ¡interrupt ¡– ¡conEnue ¡ ì Interrupt ¡service ¡rou=ne ¡ -‑ ¡The ¡specific ¡subrouEne ¡ that ¡is ¡executed ¡whenever ¡a ¡specific ¡interrupt ¡ occurs ¡ ì SubrouEne ¡chosen ¡by ¡set ¡of ¡addresses ¡(called ¡ interrupt ¡vectors ) ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2011 ¡
14 ¡ I/O ¡Architectures ¡– ¡Memory-‑Mapped ¡I/O ¡ ì In ¡memory-‑mapped ¡I/O, ¡devices ¡and ¡main ¡memory ¡ share ¡the ¡same ¡address ¡space ¡ ¡ Each ¡I/O ¡device ¡has ¡its ¡own ¡reserved ¡block ¡of ¡memory ¡ ì Memory-‑mapped ¡I/O ¡is ¡just ¡CPU ¡memory ¡accesses ¡ ì ì The ¡same ¡instrucEons ¡move ¡data ¡to ¡and ¡from ¡both ¡I/O ¡ and ¡memory ¡– ¡simple ¡system ¡design! ¡ ì In ¡ memory-‑mapped ¡I/O , ¡the ¡ CPU ¡is ¡iniEaEng ¡the ¡ memory ¡transfers ¡ ì In ¡ direct-‑memory ¡access ¡I/O , ¡a ¡ DMA ¡controller ¡ (separate ¡ hardware ¡element) ¡is ¡iniEaEng ¡the ¡memory ¡transfers ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2011 ¡
15 ¡ Character ¡versus ¡Block ¡I/O ¡ ì Character ¡I/O ¡devices ¡process ¡one ¡byte ¡(or ¡ character) ¡at ¡a ¡Eme ¡ ì Legacy ¡devices! ¡PS/2 ¡keyboards, ¡mice, ¡modems, ¡ etc… ¡ ì Usually ¡connected ¡through ¡an ¡interrupt-‑driven ¡I/O ¡ system ¡ ì Block ¡I/O ¡devices ¡handle ¡bytes ¡in ¡larger ¡groups ¡ ì Disks, ¡network ¡cards, ¡video ¡cards, ¡etc… ¡ ì Most ¡efficiently ¡connected ¡through ¡DMA ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2011 ¡
16 ¡ I/O ¡Bus ¡ ì Similar ¡to ¡memory ¡bus ¡– ¡group ¡of ¡wires ¡in ¡parallel ¡ The ¡number ¡of ¡data ¡lines ¡is ¡the ¡width ¡of ¡the ¡bus ¡ ì ì Key ¡difference ¡– ¡Devices ¡on ¡I/O ¡bus ¡operate ¡ asynchronously! ¡ Requests ¡for ¡bus ¡access ¡must ¡be ¡ arbitrated ¡among ¡the ¡ ì devices ¡involved ¡ ì Bus ¡control ¡lines ¡ acEvate ¡the ¡devices ¡when ¡they ¡are ¡ needed, ¡raise ¡signals ¡when ¡errors ¡have ¡occurred, ¡and ¡ reset ¡devices ¡when ¡necessary ¡ ì Bus ¡clock ¡ coordinates ¡acEviEes ¡and ¡provides ¡bit ¡cell ¡ boundaries ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2011 ¡
17 ¡ I/O ¡Architectures ¡ ì Example: ¡Bus ¡connected ¡to ¡a ¡disk ¡drive ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2011 ¡
18 ¡ ì Timing ¡ diagrams ¡ define ¡bus ¡ operaEon ¡ in ¡detail. ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2011 ¡
Recommend
More recommend