SlideShare a Scribd company logo
1 of 21
I/O Buffering
-Rushabh Shah
Buffering Techniques
 Single Buffer
 Double Buffer
 Circular Buffer
Single Buffer
 When a user process issues an I/O request, the operating system allocates a buffer
in the system portion of main memory to the operation.
 Input transfers are made to the system buffer. When the transfer is complete, the
process moves the block into user space and request another block.
 Thus this approach will generally speedup the I/O operations requested by a
process
Double Buffer
 An improvement over single buffering is by assigning two system buffers to the
operations.
 In this case, moving data from one system buffer to the process and reading data
from the I/O device to the other buffer may be performed simultaneously
Circular Buffer
 Double buffering is when more than two buffers are used and the collection of
these buffers is referred to as a circular buffer.
 It may be inadequate, if the process performs rapid burst of I/O. When two or more
buffers are used.
 In this way, although the I/O device is much slower, there may be enough data in
the system buffers for the process to read.
Disk Scheduling
-Rushabh Shah
Disk Scheduling
 A process needs two type of time, CPU time and IO time. For I/O, it requests the
Operating system to access the disk.
 However, the operating system must be fare enough to satisfy each request and at
the same time, operating system must maintain the efficiency and speed of process
execution.
 The technique that operating system uses to determine the request which is to be
satisfied next is called disk scheduling.
Purpose & Goal
Purpose:
 The main purpose of disk scheduling algorithm is to select a disk request from the
queue of IO requests and decide the schedule when this request will be processed.
Goal:
 Fairness
 High throughout
 Minimal traveling head time
Disk Scheduling Algorithms
 FCFS scheduling algorithm
 SSTF (shortest seek time first) algorithm
 SCAN scheduling
 C-SCAN scheduling
 LOOK Scheduling
 C-LOOK scheduling
FCFS Scheduling Algorithm
 It is the simplest Disk Scheduling algorithm. It services the IO requests in the order
in which they arrive. There is no starvation in this algorithm, every request is
serviced.
Disadvantages
 The scheme does not optimize the seek time.
 The request may come from different processes therefore there is the possibility of
inappropriate movement of the head.
Example
 Consider the following disk request sequence for a disk with 100 tracks 45, 21, 67,
90, 4, 50, 89, 52, 61, 87, 25
 Head pointer starting at 50 and moving in left direction. Find the number of head
movements in cylinders using FCFS scheduling.
Solution
Number of cylinders moved by the head
= (50-45)+(45-21)+(67-21)+
(90-67)+(90-4)+(50-4)+(89-50)+
(61-52)+(87-61)+(87-25)
= 5 + 24 + 46 + 23 + 86 + 46 +
49 + 9 + 26 + 62
= 376
SSTF Scheduling Algorithm
 Shortest seek time first (SSTF) algorithm selects the disk I/O request which requires
the least disk arm movement from its current position regardless of the direction. It
reduces the total seek time as compared to FCFS.
 It allows the head to move to the closest track in the service queue.
Disadvantages
 It may cause starvation for some requests.
 Switching direction on the frequent basis slows the working of algorithm.
 It is not the most optimal algorithm.
Example
 Consider the following disk request sequence for a disk with 100 tracks
 45, 21, 67, 90, 4, 89, 52, 61, 87, 25
 Head pointer starting at 50.
 Find the number of head movements in cylinders using SSTF scheduling.
Solution
• Number of cylinders = 5 + 7 + 9 + 6 + 20 + 2 + 1 + 65 + 4 + 17 =
136
I/O buffering
 The process of temporarily storing data that is passing between a processor and
a peripheral.
 The usual purpose is to smooth out the difference in rates at which the two
devices can handle data
 The zero-capacity case is sometimes referred to as a message system with no
buffering. The other cases are referred to as systems with automatic buffering.
Zero capacity.
 The queue has a maximum length of zero; thus, the link cannot have any messages waiting in it
Bounded capacity.
 The queue has finite length n; thus, at most n messages can reside in it. If the queue is not full
when a new message is sent, the message is placed in the queue.
Unbounded capacity.
 The queue’s length is potentially infinite; thus, any number of messages can wait in it. The sender
never blocks.
I/O buffering & disk scheduling

More Related Content

What's hot

Memory management ppt coa
Memory management ppt coaMemory management ppt coa
Memory management ppt coaBharti Khemani
 
Memory map
Memory mapMemory map
Memory mapaviban
 
Memory management
Memory managementMemory management
Memory managementcpjcollege
 
Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System ImplementationWayne Jones Jnr
 
Threads in Operating System | Multithreading | Interprocess Communication
Threads in Operating System | Multithreading | Interprocess CommunicationThreads in Operating System | Multithreading | Interprocess Communication
Threads in Operating System | Multithreading | Interprocess CommunicationShivam Mitra
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryWayne Jones Jnr
 
Parallel processing (simd and mimd)
Parallel processing (simd and mimd)Parallel processing (simd and mimd)
Parallel processing (simd and mimd)Bhavik Vashi
 
Memory management in operating system | Paging | Virtual memory
Memory management in operating system | Paging | Virtual memoryMemory management in operating system | Paging | Virtual memory
Memory management in operating system | Paging | Virtual memoryShivam Mitra
 
Memory organization
Memory organizationMemory organization
Memory organizationishapadhy
 

What's hot (20)

Memory management
Memory managementMemory management
Memory management
 
7 Deadlocks
7 Deadlocks7 Deadlocks
7 Deadlocks
 
Memory management ppt coa
Memory management ppt coaMemory management ppt coa
Memory management ppt coa
 
Memory map
Memory mapMemory map
Memory map
 
Memory Organization
Memory OrganizationMemory Organization
Memory Organization
 
Memory management
Memory managementMemory management
Memory management
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Memory organization
Memory organizationMemory organization
Memory organization
 
Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System Implementation
 
Os unit 2
Os unit 2Os unit 2
Os unit 2
 
Memory management
Memory managementMemory management
Memory management
 
Threads in Operating System | Multithreading | Interprocess Communication
Threads in Operating System | Multithreading | Interprocess CommunicationThreads in Operating System | Multithreading | Interprocess Communication
Threads in Operating System | Multithreading | Interprocess Communication
 
virtual memory
virtual memoryvirtual memory
virtual memory
 
Cache Memory
Cache MemoryCache Memory
Cache Memory
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual Memory
 
Parallel processing (simd and mimd)
Parallel processing (simd and mimd)Parallel processing (simd and mimd)
Parallel processing (simd and mimd)
 
VIRTUAL MEMORY
VIRTUAL MEMORYVIRTUAL MEMORY
VIRTUAL MEMORY
 
Memory management in operating system | Paging | Virtual memory
Memory management in operating system | Paging | Virtual memoryMemory management in operating system | Paging | Virtual memory
Memory management in operating system | Paging | Virtual memory
 
DMA and DMA controller
DMA and DMA controllerDMA and DMA controller
DMA and DMA controller
 
Memory organization
Memory organizationMemory organization
Memory organization
 

Similar to I/O buffering & disk scheduling

Similar to I/O buffering & disk scheduling (20)

I/O structure slide by Rajalakshmi SKC
I/O structure slide by Rajalakshmi SKCI/O structure slide by Rajalakshmi SKC
I/O structure slide by Rajalakshmi SKC
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 
Oversimplified CA
Oversimplified CAOversimplified CA
Oversimplified CA
 
cpu scheduling.pdf
cpu scheduling.pdfcpu scheduling.pdf
cpu scheduling.pdf
 
Mass storage structure
Mass storage structureMass storage structure
Mass storage structure
 
Cs8493 unit 4
Cs8493 unit 4Cs8493 unit 4
Cs8493 unit 4
 
Operating System
Operating SystemOperating System
Operating System
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
Disk Scheduling
Disk SchedulingDisk Scheduling
Disk Scheduling
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)
 
Operating system
Operating systemOperating system
Operating system
 
Operating system
Operating systemOperating system
Operating system
 
CH10.pdf
CH10.pdfCH10.pdf
CH10.pdf
 
Viknesh
VikneshViknesh
Viknesh
 
Ch10
Ch10Ch10
Ch10
 
Secondary storage structure-Operating System Concepts
Secondary storage structure-Operating System ConceptsSecondary storage structure-Operating System Concepts
Secondary storage structure-Operating System Concepts
 
Instruction pipelining
Instruction pipeliningInstruction pipelining
Instruction pipelining
 
LM10,11,12 - CPU SCHEDULING algorithms and its processes
LM10,11,12 - CPU SCHEDULING algorithms and its processesLM10,11,12 - CPU SCHEDULING algorithms and its processes
LM10,11,12 - CPU SCHEDULING algorithms and its processes
 
Disk scheduling algorithm.52
Disk scheduling algorithm.52Disk scheduling algorithm.52
Disk scheduling algorithm.52
 

Recently uploaded

Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 

Recently uploaded (20)

Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 

I/O buffering & disk scheduling

  • 2. Buffering Techniques  Single Buffer  Double Buffer  Circular Buffer
  • 3. Single Buffer  When a user process issues an I/O request, the operating system allocates a buffer in the system portion of main memory to the operation.  Input transfers are made to the system buffer. When the transfer is complete, the process moves the block into user space and request another block.  Thus this approach will generally speedup the I/O operations requested by a process
  • 4.
  • 5. Double Buffer  An improvement over single buffering is by assigning two system buffers to the operations.  In this case, moving data from one system buffer to the process and reading data from the I/O device to the other buffer may be performed simultaneously
  • 6.
  • 7. Circular Buffer  Double buffering is when more than two buffers are used and the collection of these buffers is referred to as a circular buffer.  It may be inadequate, if the process performs rapid burst of I/O. When two or more buffers are used.  In this way, although the I/O device is much slower, there may be enough data in the system buffers for the process to read.
  • 8.
  • 10. Disk Scheduling  A process needs two type of time, CPU time and IO time. For I/O, it requests the Operating system to access the disk.  However, the operating system must be fare enough to satisfy each request and at the same time, operating system must maintain the efficiency and speed of process execution.  The technique that operating system uses to determine the request which is to be satisfied next is called disk scheduling.
  • 11. Purpose & Goal Purpose:  The main purpose of disk scheduling algorithm is to select a disk request from the queue of IO requests and decide the schedule when this request will be processed. Goal:  Fairness  High throughout  Minimal traveling head time
  • 12. Disk Scheduling Algorithms  FCFS scheduling algorithm  SSTF (shortest seek time first) algorithm  SCAN scheduling  C-SCAN scheduling  LOOK Scheduling  C-LOOK scheduling
  • 13. FCFS Scheduling Algorithm  It is the simplest Disk Scheduling algorithm. It services the IO requests in the order in which they arrive. There is no starvation in this algorithm, every request is serviced. Disadvantages  The scheme does not optimize the seek time.  The request may come from different processes therefore there is the possibility of inappropriate movement of the head.
  • 14. Example  Consider the following disk request sequence for a disk with 100 tracks 45, 21, 67, 90, 4, 50, 89, 52, 61, 87, 25  Head pointer starting at 50 and moving in left direction. Find the number of head movements in cylinders using FCFS scheduling.
  • 15. Solution Number of cylinders moved by the head = (50-45)+(45-21)+(67-21)+ (90-67)+(90-4)+(50-4)+(89-50)+ (61-52)+(87-61)+(87-25) = 5 + 24 + 46 + 23 + 86 + 46 + 49 + 9 + 26 + 62 = 376
  • 16. SSTF Scheduling Algorithm  Shortest seek time first (SSTF) algorithm selects the disk I/O request which requires the least disk arm movement from its current position regardless of the direction. It reduces the total seek time as compared to FCFS.  It allows the head to move to the closest track in the service queue. Disadvantages  It may cause starvation for some requests.  Switching direction on the frequent basis slows the working of algorithm.  It is not the most optimal algorithm.
  • 17. Example  Consider the following disk request sequence for a disk with 100 tracks  45, 21, 67, 90, 4, 89, 52, 61, 87, 25  Head pointer starting at 50.  Find the number of head movements in cylinders using SSTF scheduling.
  • 18. Solution • Number of cylinders = 5 + 7 + 9 + 6 + 20 + 2 + 1 + 65 + 4 + 17 = 136
  • 19. I/O buffering  The process of temporarily storing data that is passing between a processor and a peripheral.  The usual purpose is to smooth out the difference in rates at which the two devices can handle data  The zero-capacity case is sometimes referred to as a message system with no buffering. The other cases are referred to as systems with automatic buffering.
  • 20. Zero capacity.  The queue has a maximum length of zero; thus, the link cannot have any messages waiting in it Bounded capacity.  The queue has finite length n; thus, at most n messages can reside in it. If the queue is not full when a new message is sent, the message is placed in the queue. Unbounded capacity.  The queue’s length is potentially infinite; thus, any number of messages can wait in it. The sender never blocks.