SlideShare a Scribd company logo
1 of 31
Road Map
Introduction
- Disk Scheduling
- Types of Scheduling Algorithms
- Linux Page Cache
- Linux Devices
Overview
LINUX follows the philosophy that every thing is
a file. For example: A
keyboard,Monitor,Mouse,Printer.
Disk
LINUX I/O
Application
File SystemFile System
Disk Drive
Keyboard Terminal Tape Audio
The Role of Linux I/O
LINUX And UNIX(e.g.SVR4) are very
Similar in I/O Terms.
The Linux kernel associates a special
file with each I/O device driver.
Block, character, and network devices
are
recognized.
What are the standard I/O ?
Read/Write Commands
RoadMap
- Introduction
Disk Scheduling
- Types of Scheduling Algorithms
- Linux Page Cache
- Linux Devices
The Elevator Scheduler
• Maintains a single queue for disk
read and write requests
• Keeps list of requests sorted by
block
number
• Drive moves in a single direction to
satisfy each request
Deadline scheduler
1. A far-away block request can be
postponed for considerable time because
the queue is dynamically updated.
2. There are severe problem concerns the
difference between read and write
requests.
There are two problems in elevator scheme.
 To deal with these problems
the deadline I/O scheduler
makes use elevator queue
as before.
 Both read and write queues
keep list of requests in the
sequence in which they were
issued.
 The scheduler sends out requests from write
request from sorted queue.
 Once the request is satisfied , it taken out from the
sorted queue and also from appropriate FIFO
queue.
 But, if the head of one of the queue becomes
older
than its expiration time , then the scheduler
after
that send outs from that queue.
 As each request is sent out it is also deleted
from sorted queue.
 this scheduler removes starvation problem and
also read/ write problem
Anticipatory I/O Scheduler
oSometimes it is possible that consecutive reads
from
the same process will be to disk blocks that are
close to one another.
oGenerally performance of the system could be
better improved if scheduler were to holdup a
short period of time after fulfilling a read
request.
o In Linux , the anticipatory scheduler is placed
over
the deadline scheduler . When a read request
is
dispatched , the anticipatory scheduler causes
the
scheduling system to delay for up to 6 ms .
o During this small delay , there is a good
chance that
the application that issued the last read
request will
issue another read request to the same region
Road Map
- Introduction
- Disk Scheduling
- Types of Scheduling Algorithms
Linux Page Cache
- Linux Devices
Linux Page Cache
• Under Linux, the Page Cache accelerates many
accesses to files on non volatile storage.
• If this data is read again later, it can be quickly read
from this cache in memory.
• This article will supply valuable background
information about this page cache.
• Linux 2.2,for read/write for regular file system and
for virtual memory pages kernel had maintained a
page cache.
 Linux 2.4 and later, a single unified page
cache for all traffic between disk and main
memory.
Benefits Of Page Cache
Page Cache provides two benefits:
• Dirty pages can be collected and written out
efficiently
• Pages in the page cache are likely to be
referenced
again due to temporal locality.
Dirty Pages are written back
to disk in two situation:
 When Free Memory Available ,it is added to
free
memory pool.
 When dirty pages grow older than a specified
threshold, a number of dirty pages are written
back to disk.
If we edit the data and not save the data in
to the secondary storage, it is termed as
dirty page.
Optimizing Page Cache
 When a 500-megabyte log file
is compressed into 10
megabytes by logrotate and
gzip, the original log file
becomes invalid along with its
cache space.
 490 megabytes in the Page Cache
will then become available by
doing so. The danger of a
continuously growing log file
displacing more useful file blocks
from the Page Cache is reduced
thereby.
RoadMap
- Introduction
- Disk Scheduling
- Types of Scheduling Algorithms
- Linux Page Cache
- Linux Devices
Linux devices
Introduction
 Block devices
 Character devices
 Network devices
Linux Device acts as file
 Everything in Linux is a file.
 In Linux even hardware devices are
recognized as files.
 For Linux, devices can be termed as
special files that represent physical or
virtual devices attached to Linux system.
How can a device can be
viewed?
• In Linux, every device needs to have device
driver so that it can be made accessible by the
OS to the users.
• The device driver actually provides the
standard input/output calls to access the
device and interact with it.
All the devices on the Linux can be viewed
through:
Command: cat /proc/devices
Block diagram of linux I/O
Linux kernal
spaces
user
space
App2 App3
System calls
Device drivers
Device nodes
Actual device H/W
App1
Block devices
• Block Devices are devices, as the name
suggests, deal with blocks of data.
• Block device drivers are implemented to
read/write block data and also supports
random access data.
• Intermediate buffer to store data between
reads and writes.
Block devices
• It has block device operations such as
– open()
– release()
– direct_access()
– revalidate_disk()
• Examples: A floppy, hard disks
Block Device diagram
Device driver block structure
Character devices
 Character Devices are devices where data is a
stream of bytes i.e. the input/output happens byte
by byte.
 The interactive operations (often called the file
operations) which would be most vital to implement
are:
– open()
– read()
– write()
– close()
 Examples: A terminal, Keyboard, etc
Character Device diagram
Network devices
 Network device are the ones which are used to
transmit data from one machine to another.
 Here, they are exchange data in the form of
data packets with another remote machine,
using a standard protocol.
 They also deal with setting up ip addresses,
configurations and modifying transmission
parameters, traffic, etc.
Network devices
• Their I/O operations are specific to the data
packet transmission protocol, as in, TCP/UDP.
• Examples: NIC

More Related Content

What's hot

Overview of physical storage media
Overview of physical storage mediaOverview of physical storage media
Overview of physical storage mediaSrinath Sri
 
Disk structure.45
Disk structure.45Disk structure.45
Disk structure.45myrajendra
 
The sysfs Filesystem
The sysfs FilesystemThe sysfs Filesystem
The sysfs FilesystemJeff Yana
 
Storage management in operating system
Storage management in operating systemStorage management in operating system
Storage management in operating systemDeepikaT13
 
storage & file strucure in dbms
storage & file strucure in dbmsstorage & file strucure in dbms
storage & file strucure in dbmssachin2690
 
Storage and File Structure in DBMS
Storage and File Structure in DBMSStorage and File Structure in DBMS
Storage and File Structure in DBMSA. S. M. Shafi
 
Swap-space Management
Swap-space ManagementSwap-space Management
Swap-space ManagementAgnas Jasmine
 
File access methods.54
File access methods.54File access methods.54
File access methods.54myrajendra
 
Swap space management and protection in os
Swap space management and protection  in osSwap space management and protection  in os
Swap space management and protection in osrajshreemuthiah
 
Secondary storage tutorial
Secondary storage tutorialSecondary storage tutorial
Secondary storage tutorialMarvin Burke
 
Root file system for embedded systems
Root file system for embedded systemsRoot file system for embedded systems
Root file system for embedded systemsalok pal
 
Chapter 4 record storage and primary file organization
Chapter 4 record storage and primary file organizationChapter 4 record storage and primary file organization
Chapter 4 record storage and primary file organizationJafar Nesargi
 
Secondary storage structure
Secondary storage structureSecondary storage structure
Secondary storage structurePriya Selvaraj
 
Ch 17 disk storage, basic files structure, and hashing
Ch 17 disk storage, basic files structure, and hashingCh 17 disk storage, basic files structure, and hashing
Ch 17 disk storage, basic files structure, and hashingZainab Almugbel
 
Examining Linux File Structures
Examining Linux File StructuresExamining Linux File Structures
Examining Linux File Structuresprimeteacher32
 

What's hot (18)

Overview of physical storage media
Overview of physical storage mediaOverview of physical storage media
Overview of physical storage media
 
Disk structure.45
Disk structure.45Disk structure.45
Disk structure.45
 
The sysfs Filesystem
The sysfs FilesystemThe sysfs Filesystem
The sysfs Filesystem
 
Storage management in operating system
Storage management in operating systemStorage management in operating system
Storage management in operating system
 
storage & file strucure in dbms
storage & file strucure in dbmsstorage & file strucure in dbms
storage & file strucure in dbms
 
Os
OsOs
Os
 
Storage and File Structure in DBMS
Storage and File Structure in DBMSStorage and File Structure in DBMS
Storage and File Structure in DBMS
 
Swap-space Management
Swap-space ManagementSwap-space Management
Swap-space Management
 
File access methods.54
File access methods.54File access methods.54
File access methods.54
 
Swap space management and protection in os
Swap space management and protection  in osSwap space management and protection  in os
Swap space management and protection in os
 
Secondary storage tutorial
Secondary storage tutorialSecondary storage tutorial
Secondary storage tutorial
 
Root file system for embedded systems
Root file system for embedded systemsRoot file system for embedded systems
Root file system for embedded systems
 
Chapter 4 record storage and primary file organization
Chapter 4 record storage and primary file organizationChapter 4 record storage and primary file organization
Chapter 4 record storage and primary file organization
 
Secondary storage structure
Secondary storage structureSecondary storage structure
Secondary storage structure
 
Ch 17 disk storage, basic files structure, and hashing
Ch 17 disk storage, basic files structure, and hashingCh 17 disk storage, basic files structure, and hashing
Ch 17 disk storage, basic files structure, and hashing
 
OSCh11
OSCh11OSCh11
OSCh11
 
Examining Linux File Structures
Examining Linux File StructuresExamining Linux File Structures
Examining Linux File Structures
 
OSCh13
OSCh13OSCh13
OSCh13
 

Similar to Ioppt

File Management in Operating Systems
File Management in Operating SystemsFile Management in Operating Systems
File Management in Operating Systemsvampugani
 
Distributed File System
Distributed File SystemDistributed File System
Distributed File SystemNtu
 
Lamp1
Lamp1Lamp1
Lamp1Reka
 
Lamp
LampLamp
LampReka
 
19IS305_U4_LP10_LM10-22-23.pdf
19IS305_U4_LP10_LM10-22-23.pdf19IS305_U4_LP10_LM10-22-23.pdf
19IS305_U4_LP10_LM10-22-23.pdfJESUNPK
 
I/O System and Case study
I/O System and Case studyI/O System and Case study
I/O System and Case studyLavanya G
 
File system and Deadlocks
File system and DeadlocksFile system and Deadlocks
File system and DeadlocksRohit Jain
 
Hadoop Distributed File System for Big Data Analytics
Hadoop Distributed File System for Big Data AnalyticsHadoop Distributed File System for Big Data Analytics
Hadoop Distributed File System for Big Data AnalyticsDrPDShebaKeziaMalarc
 
Advanced Storage Area Network
Advanced Storage Area NetworkAdvanced Storage Area Network
Advanced Storage Area NetworkSoumee Maschatak
 
Case study operating systems
Case study operating systemsCase study operating systems
Case study operating systemsAkhil Bevara
 
Learn about log structured file system
Learn about log structured file systemLearn about log structured file system
Learn about log structured file systemGang He
 
Linux Memory Analysis with Volatility
Linux Memory Analysis with VolatilityLinux Memory Analysis with Volatility
Linux Memory Analysis with VolatilityAndrew Case
 
Cloud computing UNIT 2.1 presentation in
Cloud computing UNIT 2.1 presentation inCloud computing UNIT 2.1 presentation in
Cloud computing UNIT 2.1 presentation inRahulBhole12
 

Similar to Ioppt (20)

File Management in Operating Systems
File Management in Operating SystemsFile Management in Operating Systems
File Management in Operating Systems
 
Distributed File System
Distributed File SystemDistributed File System
Distributed File System
 
Lamp1
Lamp1Lamp1
Lamp1
 
Lamp1
Lamp1Lamp1
Lamp1
 
Lamp
LampLamp
Lamp
 
19IS305_U4_LP10_LM10-22-23.pdf
19IS305_U4_LP10_LM10-22-23.pdf19IS305_U4_LP10_LM10-22-23.pdf
19IS305_U4_LP10_LM10-22-23.pdf
 
ch11
ch11ch11
ch11
 
I/O System and Case study
I/O System and Case studyI/O System and Case study
I/O System and Case study
 
File system and Deadlocks
File system and DeadlocksFile system and Deadlocks
File system and Deadlocks
 
Hadoop Distributed File System for Big Data Analytics
Hadoop Distributed File System for Big Data AnalyticsHadoop Distributed File System for Big Data Analytics
Hadoop Distributed File System for Big Data Analytics
 
Advanced Storage Area Network
Advanced Storage Area NetworkAdvanced Storage Area Network
Advanced Storage Area Network
 
Case study operating systems
Case study operating systemsCase study operating systems
Case study operating systems
 
Cs8493 unit 4
Cs8493 unit 4Cs8493 unit 4
Cs8493 unit 4
 
O svv92014
O svv92014O svv92014
O svv92014
 
Edubooktraining
EdubooktrainingEdubooktraining
Edubooktraining
 
Learn about log structured file system
Learn about log structured file systemLearn about log structured file system
Learn about log structured file system
 
Linux Memory Analysis with Volatility
Linux Memory Analysis with VolatilityLinux Memory Analysis with Volatility
Linux Memory Analysis with Volatility
 
Storage system architecture
Storage system architectureStorage system architecture
Storage system architecture
 
Cloud computing UNIT 2.1 presentation in
Cloud computing UNIT 2.1 presentation inCloud computing UNIT 2.1 presentation in
Cloud computing UNIT 2.1 presentation in
 
Unit 4 DBMS.ppt
Unit 4 DBMS.pptUnit 4 DBMS.ppt
Unit 4 DBMS.ppt
 

Recently uploaded

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
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxAnaBeatriceAblay2
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 

Recently uploaded (20)

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
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 

Ioppt

  • 1.
  • 2. Road Map Introduction - Disk Scheduling - Types of Scheduling Algorithms - Linux Page Cache - Linux Devices
  • 3. Overview LINUX follows the philosophy that every thing is a file. For example: A keyboard,Monitor,Mouse,Printer. Disk LINUX I/O Application File SystemFile System Disk Drive Keyboard Terminal Tape Audio
  • 4. The Role of Linux I/O LINUX And UNIX(e.g.SVR4) are very Similar in I/O Terms. The Linux kernel associates a special file with each I/O device driver. Block, character, and network devices are recognized.
  • 5. What are the standard I/O ? Read/Write Commands
  • 6. RoadMap - Introduction Disk Scheduling - Types of Scheduling Algorithms - Linux Page Cache - Linux Devices
  • 7. The Elevator Scheduler • Maintains a single queue for disk read and write requests • Keeps list of requests sorted by block number • Drive moves in a single direction to satisfy each request
  • 8. Deadline scheduler 1. A far-away block request can be postponed for considerable time because the queue is dynamically updated. 2. There are severe problem concerns the difference between read and write requests. There are two problems in elevator scheme.
  • 9.  To deal with these problems the deadline I/O scheduler makes use elevator queue as before.  Both read and write queues keep list of requests in the sequence in which they were issued.  The scheduler sends out requests from write request from sorted queue.  Once the request is satisfied , it taken out from the sorted queue and also from appropriate FIFO queue.
  • 10.  But, if the head of one of the queue becomes older than its expiration time , then the scheduler after that send outs from that queue.  As each request is sent out it is also deleted from sorted queue.  this scheduler removes starvation problem and also read/ write problem
  • 11. Anticipatory I/O Scheduler oSometimes it is possible that consecutive reads from the same process will be to disk blocks that are close to one another. oGenerally performance of the system could be better improved if scheduler were to holdup a short period of time after fulfilling a read request.
  • 12. o In Linux , the anticipatory scheduler is placed over the deadline scheduler . When a read request is dispatched , the anticipatory scheduler causes the scheduling system to delay for up to 6 ms . o During this small delay , there is a good chance that the application that issued the last read request will issue another read request to the same region
  • 13. Road Map - Introduction - Disk Scheduling - Types of Scheduling Algorithms Linux Page Cache - Linux Devices
  • 14. Linux Page Cache • Under Linux, the Page Cache accelerates many accesses to files on non volatile storage. • If this data is read again later, it can be quickly read from this cache in memory. • This article will supply valuable background information about this page cache. • Linux 2.2,for read/write for regular file system and for virtual memory pages kernel had maintained a page cache.
  • 15.  Linux 2.4 and later, a single unified page cache for all traffic between disk and main memory.
  • 16. Benefits Of Page Cache Page Cache provides two benefits: • Dirty pages can be collected and written out efficiently • Pages in the page cache are likely to be referenced again due to temporal locality.
  • 17. Dirty Pages are written back to disk in two situation:  When Free Memory Available ,it is added to free memory pool.  When dirty pages grow older than a specified threshold, a number of dirty pages are written back to disk. If we edit the data and not save the data in to the secondary storage, it is termed as dirty page.
  • 18. Optimizing Page Cache  When a 500-megabyte log file is compressed into 10 megabytes by logrotate and gzip, the original log file becomes invalid along with its cache space.  490 megabytes in the Page Cache will then become available by doing so. The danger of a continuously growing log file displacing more useful file blocks from the Page Cache is reduced thereby.
  • 19. RoadMap - Introduction - Disk Scheduling - Types of Scheduling Algorithms - Linux Page Cache - Linux Devices
  • 20. Linux devices Introduction  Block devices  Character devices  Network devices
  • 21. Linux Device acts as file  Everything in Linux is a file.  In Linux even hardware devices are recognized as files.  For Linux, devices can be termed as special files that represent physical or virtual devices attached to Linux system.
  • 22. How can a device can be viewed? • In Linux, every device needs to have device driver so that it can be made accessible by the OS to the users. • The device driver actually provides the standard input/output calls to access the device and interact with it. All the devices on the Linux can be viewed through: Command: cat /proc/devices
  • 23. Block diagram of linux I/O Linux kernal spaces user space App2 App3 System calls Device drivers Device nodes Actual device H/W App1
  • 24. Block devices • Block Devices are devices, as the name suggests, deal with blocks of data. • Block device drivers are implemented to read/write block data and also supports random access data. • Intermediate buffer to store data between reads and writes.
  • 25. Block devices • It has block device operations such as – open() – release() – direct_access() – revalidate_disk() • Examples: A floppy, hard disks
  • 27. Device driver block structure
  • 28. Character devices  Character Devices are devices where data is a stream of bytes i.e. the input/output happens byte by byte.  The interactive operations (often called the file operations) which would be most vital to implement are: – open() – read() – write() – close()  Examples: A terminal, Keyboard, etc
  • 30. Network devices  Network device are the ones which are used to transmit data from one machine to another.  Here, they are exchange data in the form of data packets with another remote machine, using a standard protocol.  They also deal with setting up ip addresses, configurations and modifying transmission parameters, traffic, etc.
  • 31. Network devices • Their I/O operations are specific to the data packet transmission protocol, as in, TCP/UDP. • Examples: NIC