SlideShare una empresa de Scribd logo
1 de 22
Disk Scheduling
Process B reads tracks 3, 5
Process A reads tracks 2, 5
Process C reads tracks 8, 4
OS has to read
these tracks:
2,3,4,5,8.
Disk Scheduling
 At runtime, I/O requests for disk tracks come from
the processes
 OS has to choose an order to serve the requests
Access time
 Total access time = seek time + rotational delay +
data transfer time
 Seek time – time required to move the disk arm to
the required track
 Rotational delay – time required to rotate the disk to
the required sector
 Data transfer time – time to read/write data from/to
the disk
Disk Scheduling
 The order that the read/write head is moved to
satisfy several I/O requests
 determines the total seek time
 affects performance
 the OS cannot change the rotational delay or transfer
time, but it can try to find a ‘good’ order that spends less
time in seek time.
 If requests are selected randomly, we will get the
worst possible performance...
Disk Scheduling Policy
 FIFO: fair, but near random scheduling
 SSTF: possible starvation
 SCAN: favor requests for tracks near the ends
 C-SCAN
 FSCAN: avoid “arm stickiness” in SSTF, SCAN and
C-SCAN
Disk Scheduling Policies
 First-in, first-out (FIFO)
 Process request sequentially
 Fair to all processes
 Approaches random scheduling in performance if there are
many processes
 Example: 55, 58, 39, 18, 90, 160, 150, 38, 184
Disk Scheduling Policies
 Shortest Service/Seek Time First
 Select the disk I/O request that requires the least
movement of the disk arm from its current position
 Always choose the minimum seek time
 Example: 55, 58, 39, 18, 90, 160, 150, 38, 184
 Requests for tracks far away from the current position
may never be served, if requests for closer tracks are
issued continuously
Disk Scheduling Policies
 SCAN (aka Elevator Algorithm)
 Arm moves in one direction only, satisfying all outstanding
requests until it reaches the last track in that direction
 Direction is reversed
 Example: 55, 58, 39, 18, 90, 160, 150, 38, 184
Disk Scheduling Policies
 C-SCAN
 Restricts scanning to one direction only
 When the last track has been visited in one direction, the arm is
returned to the opposite end of the disk and the scan begins
again
 In case of repetitive requests to one track, we will see “arm
stickiness” in SSTF, SCAN, C-SCAN
FSCAN
 “Arm stickiness” in SSTF, SCAN, C-SCAN in case
of repetitive requests to one track
 FSCAN uses two queues. When a SCAN begins, all
of the requests are in one of the queues, with the
other empty. During the scan, all new requests are
put into the other queue.
 Service of new requests is deferred until all of the
old requests have been processed.
Disk Scheduling Algorithms
Trace the policies FIFO, SSTF, SCAN, C-SCAN and FSCAN for the
following disk requests. Each I/O request on a track takes 5 time
units. At time 0, the disk starts reading track 10, and the read/write
head was moving to the larger track number direction .
Example
Time 0 1 2 3 6 7
Request to
access track ..
10 19 3 14 12 9
Track access order Average seek length
FIFO 10,19,3,14,12,9 (9+16+11+2+3)/5 = 8.2
SSTF 10,14,12,9,3,19 (4+2+3+6+16)/5 = 6.2
SCAN 10,14,19,12,9,3 (4+5+7+3+6)/5 = 5
C-SCAN 10,14,19,3,9,12 (4+5+16+6+3)/5 = 6.8
FSCAN 10,14,19,3,9,12 (4+5+16+6+3)/5 = 6.8
RAID
 Redundant Array of Independent Disks
 A set of physical disk drives viewed by the OS as a
single logical drive
 Data are distributed across the physical drives. May
improve performance.
 Redundant disk stores parity information.
Recoverability, reliability.
RAID 0 (Non-redundant)
 The logical disk is divided into
strips, mapped round robin to
consecutive physical disks
 Improve performance
in disk read/write
 Not fault tolerant
RAID 1 (Mirrored)
 Each disk is mirrored by another disk
 Good performance if the hardware supports
concurrent read/write to the mirrored pair
 Reliable, but expensive
Parity strip
 Computed and updated at
write, verified at read
 Every write results in two
read and two write of
strips
 A corrupted strip
can be recovered
To compute the parity strip...
P(0-3) := b0  b1  b2  b3
To recover the block 0...
b0 = P(0-3)  b1  b2  b3
RAID 5 (Block-level distributed parity)
Having all parity strips on one disk may make
it a bottleneck. Instead, we can distribute the
parity strips among the disks
If a single disk fails, the system can regenerate
the data lost
Reliable. Good
performance
with special hardware
Block-oriented disk
 Disk is block-oriented. One sector
is read/written at a time.
 In PC, a sector is 512 byte
The term
cache
memory
is usually
used to
apply to a
memory
that is
smaller
and …
while (!feof(F)) {
// read one char
fscanf(F, “%c”, &c);
…
}
Disk Cache
 Buffer in main memory for
disk sectors
 Contains a copy of some of
the sectors
The term
cache
memory
is usually
used to
apply to a
memory
that is
smaller
and …
The term
cache
memory
…
…
memory
that is
smaller
Disk cache
Disk
Disk I/O
requests
Disk Cache, Hit and Miss
 When an I/O request is made for a particular sector,
the OS checks whether the sector is in the disk cache.
 If so, (cache hit), the request is satisfied via the cache.
 If not (cache miss), the requested sector is read into the disk
cache from the disk.
Disk Cache, Replacement
 Least Recently Used (LRU)
 Replace the block that has been in the cache the longest with
no reference
 Least Frequently Used (LFU)
 Replace the block that has experienced the fewest references
Thank You
22

Más contenido relacionado

La actualidad más candente

instruction cycle ppt
instruction cycle pptinstruction cycle ppt
instruction cycle pptsheetal singh
 
Computer instructions
Computer instructionsComputer instructions
Computer instructionsAnuj Modi
 
Methods for handling deadlock
Methods for handling deadlockMethods for handling deadlock
Methods for handling deadlocksangrampatil81
 
Operating system 40 lru algorithm
Operating system 40 lru algorithmOperating system 40 lru algorithm
Operating system 40 lru algorithmVaibhav Khanna
 
FCFS scheduling OS
FCFS scheduling OSFCFS scheduling OS
FCFS scheduling OSTotan Banik
 
General register organization (computer organization)
General register organization  (computer organization)General register organization  (computer organization)
General register organization (computer organization)rishi ram khanal
 
First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)nikeAthena
 
Pipeline hazard
Pipeline hazardPipeline hazard
Pipeline hazardAJAL A J
 
Cache memory principles
Cache memory principlesCache memory principles
Cache memory principlesbit allahabad
 
Pipelining and vector processing
Pipelining and vector processingPipelining and vector processing
Pipelining and vector processingKamal Acharya
 
Allocation of Frames & Thrashing
Allocation of Frames & ThrashingAllocation of Frames & Thrashing
Allocation of Frames & Thrashingarifmollick8578
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryWayne Jones Jnr
 
CPU scheduling
CPU schedulingCPU scheduling
CPU schedulingAmir Khan
 
cpu scheduling
cpu schedulingcpu scheduling
cpu schedulinghashim102
 

La actualidad más candente (20)

instruction cycle ppt
instruction cycle pptinstruction cycle ppt
instruction cycle ppt
 
Computer instructions
Computer instructionsComputer instructions
Computer instructions
 
Methods for handling deadlock
Methods for handling deadlockMethods for handling deadlock
Methods for handling deadlock
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Operating system 40 lru algorithm
Operating system 40 lru algorithmOperating system 40 lru algorithm
Operating system 40 lru algorithm
 
FCFS scheduling OS
FCFS scheduling OSFCFS scheduling OS
FCFS scheduling OS
 
General register organization (computer organization)
General register organization  (computer organization)General register organization  (computer organization)
General register organization (computer organization)
 
First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)
 
System calls
System callsSystem calls
System calls
 
Pipeline hazard
Pipeline hazardPipeline hazard
Pipeline hazard
 
Cache memory principles
Cache memory principlesCache memory principles
Cache memory principles
 
Demand paging
Demand pagingDemand paging
Demand paging
 
Pipelining
PipeliningPipelining
Pipelining
 
Pipelining and vector processing
Pipelining and vector processingPipelining and vector processing
Pipelining and vector processing
 
Pipelining & All Hazards Solution
Pipelining  & All Hazards SolutionPipelining  & All Hazards Solution
Pipelining & All Hazards Solution
 
Priority scheduling algorithms
Priority scheduling algorithmsPriority scheduling algorithms
Priority scheduling algorithms
 
Allocation of Frames & Thrashing
Allocation of Frames & ThrashingAllocation of Frames & Thrashing
Allocation of Frames & Thrashing
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual Memory
 
CPU scheduling
CPU schedulingCPU scheduling
CPU scheduling
 
cpu scheduling
cpu schedulingcpu scheduling
cpu scheduling
 

Similar a Disk Scheduling (20)

Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
7 disk managment
7 disk managment7 disk managment
7 disk managment
 
Mass storage structure
Mass storage structureMass storage structure
Mass storage structure
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
Disk Scheduling
Disk SchedulingDisk Scheduling
Disk Scheduling
 
Cs8493 unit 4
Cs8493 unit 4Cs8493 unit 4
Cs8493 unit 4
 
Operating system
Operating systemOperating system
Operating system
 
CH10.pdf
CH10.pdfCH10.pdf
CH10.pdf
 
Ch12
Ch12Ch12
Ch12
 
Mass storage structure
Mass storage structureMass storage structure
Mass storage structure
 
9_Storage_Devices.pptx
9_Storage_Devices.pptx9_Storage_Devices.pptx
9_Storage_Devices.pptx
 
Disk scheduling algorithms
Disk scheduling algorithms Disk scheduling algorithms
Disk scheduling algorithms
 
Ch10
Ch10Ch10
Ch10
 
9_Storage_Devices.pptx
9_Storage_Devices.pptx9_Storage_Devices.pptx
9_Storage_Devices.pptx
 
Disk Scheduling
Disk SchedulingDisk Scheduling
Disk Scheduling
 
Viknesh
VikneshViknesh
Viknesh
 
operating system
operating systemoperating system
operating system
 
Secondary storage structure-Operating System Concepts
Secondary storage structure-Operating System ConceptsSecondary storage structure-Operating System Concepts
Secondary storage structure-Operating System Concepts
 
Kavi
KaviKavi
Kavi
 
Kavi
KaviKavi
Kavi
 

Último

welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the weldingMuhammadUzairLiaqat
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONjhunlian
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating SystemRashmi Bhat
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgsaravananr517913
 
Industrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIESIndustrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIESNarmatha D
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...Amil Baba Dawood bangali
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm Systemirfanmechengr
 
System Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingSystem Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingBootNeck1
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substationstephanwindworld
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptNarmatha D
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsSachinPawar510423
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxRomil Mishra
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 

Último (20)

welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the welding
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating System
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
 
Industrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIESIndustrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIES
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm System
 
System Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingSystem Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event Scheduling
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substation
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.ppt
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documents
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptx
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 

Disk Scheduling

  • 2. Process B reads tracks 3, 5 Process A reads tracks 2, 5 Process C reads tracks 8, 4 OS has to read these tracks: 2,3,4,5,8. Disk Scheduling  At runtime, I/O requests for disk tracks come from the processes  OS has to choose an order to serve the requests
  • 3. Access time  Total access time = seek time + rotational delay + data transfer time  Seek time – time required to move the disk arm to the required track  Rotational delay – time required to rotate the disk to the required sector  Data transfer time – time to read/write data from/to the disk
  • 4. Disk Scheduling  The order that the read/write head is moved to satisfy several I/O requests  determines the total seek time  affects performance  the OS cannot change the rotational delay or transfer time, but it can try to find a ‘good’ order that spends less time in seek time.  If requests are selected randomly, we will get the worst possible performance...
  • 5. Disk Scheduling Policy  FIFO: fair, but near random scheduling  SSTF: possible starvation  SCAN: favor requests for tracks near the ends  C-SCAN  FSCAN: avoid “arm stickiness” in SSTF, SCAN and C-SCAN
  • 6. Disk Scheduling Policies  First-in, first-out (FIFO)  Process request sequentially  Fair to all processes  Approaches random scheduling in performance if there are many processes  Example: 55, 58, 39, 18, 90, 160, 150, 38, 184
  • 7. Disk Scheduling Policies  Shortest Service/Seek Time First  Select the disk I/O request that requires the least movement of the disk arm from its current position  Always choose the minimum seek time  Example: 55, 58, 39, 18, 90, 160, 150, 38, 184  Requests for tracks far away from the current position may never be served, if requests for closer tracks are issued continuously
  • 8. Disk Scheduling Policies  SCAN (aka Elevator Algorithm)  Arm moves in one direction only, satisfying all outstanding requests until it reaches the last track in that direction  Direction is reversed  Example: 55, 58, 39, 18, 90, 160, 150, 38, 184
  • 9. Disk Scheduling Policies  C-SCAN  Restricts scanning to one direction only  When the last track has been visited in one direction, the arm is returned to the opposite end of the disk and the scan begins again  In case of repetitive requests to one track, we will see “arm stickiness” in SSTF, SCAN, C-SCAN
  • 10. FSCAN  “Arm stickiness” in SSTF, SCAN, C-SCAN in case of repetitive requests to one track  FSCAN uses two queues. When a SCAN begins, all of the requests are in one of the queues, with the other empty. During the scan, all new requests are put into the other queue.  Service of new requests is deferred until all of the old requests have been processed.
  • 12. Trace the policies FIFO, SSTF, SCAN, C-SCAN and FSCAN for the following disk requests. Each I/O request on a track takes 5 time units. At time 0, the disk starts reading track 10, and the read/write head was moving to the larger track number direction . Example Time 0 1 2 3 6 7 Request to access track .. 10 19 3 14 12 9 Track access order Average seek length FIFO 10,19,3,14,12,9 (9+16+11+2+3)/5 = 8.2 SSTF 10,14,12,9,3,19 (4+2+3+6+16)/5 = 6.2 SCAN 10,14,19,12,9,3 (4+5+7+3+6)/5 = 5 C-SCAN 10,14,19,3,9,12 (4+5+16+6+3)/5 = 6.8 FSCAN 10,14,19,3,9,12 (4+5+16+6+3)/5 = 6.8
  • 13. RAID  Redundant Array of Independent Disks  A set of physical disk drives viewed by the OS as a single logical drive  Data are distributed across the physical drives. May improve performance.  Redundant disk stores parity information. Recoverability, reliability.
  • 14. RAID 0 (Non-redundant)  The logical disk is divided into strips, mapped round robin to consecutive physical disks  Improve performance in disk read/write  Not fault tolerant
  • 15. RAID 1 (Mirrored)  Each disk is mirrored by another disk  Good performance if the hardware supports concurrent read/write to the mirrored pair  Reliable, but expensive
  • 16. Parity strip  Computed and updated at write, verified at read  Every write results in two read and two write of strips  A corrupted strip can be recovered To compute the parity strip... P(0-3) := b0  b1  b2  b3 To recover the block 0... b0 = P(0-3)  b1  b2  b3
  • 17. RAID 5 (Block-level distributed parity) Having all parity strips on one disk may make it a bottleneck. Instead, we can distribute the parity strips among the disks If a single disk fails, the system can regenerate the data lost Reliable. Good performance with special hardware
  • 18. Block-oriented disk  Disk is block-oriented. One sector is read/written at a time.  In PC, a sector is 512 byte The term cache memory is usually used to apply to a memory that is smaller and … while (!feof(F)) { // read one char fscanf(F, “%c”, &c); … }
  • 19. Disk Cache  Buffer in main memory for disk sectors  Contains a copy of some of the sectors The term cache memory is usually used to apply to a memory that is smaller and … The term cache memory … … memory that is smaller Disk cache Disk Disk I/O requests
  • 20. Disk Cache, Hit and Miss  When an I/O request is made for a particular sector, the OS checks whether the sector is in the disk cache.  If so, (cache hit), the request is satisfied via the cache.  If not (cache miss), the requested sector is read into the disk cache from the disk.
  • 21. Disk Cache, Replacement  Least Recently Used (LRU)  Replace the block that has been in the cache the longest with no reference  Least Frequently Used (LFU)  Replace the block that has experienced the fewest references