SlideShare a Scribd company logo
Scheduling
Scheduling is the job of allocating cpu(central processing unit) time to different tasks within an operating
system.
Scheduling includes - :
Process scheduling , kernel synchronization and symmetric
multiprocessing .
Process scheduling
Linux hastwo separateprocess-schedulingalgorithms . One is the time – sharingalgorithm for fair , preemptive scheduling
amongmultiple processes ; the otheris designedfor real – time tasks, where absoluteprioritiesare more important than
fairness.
The Linux scheduler is a preemptive , priority – based algorithm with two separate priority ranges : a real-
time range from 0 to 99 and a nice value ranging from 100 to 140 .
These two ranges map into a global priority scheme whereby numerically lower values indicate higher
priorities.
there are two real time scheduling classes –
first-come first-served (fcfs) and round-robin (rr)
Kernel synchronization
Kernel synchronizationinvolves muchmore thanjust process scheduling . A framework is requiredthat allows kernel tasks to run
without violatingthe integrityof shared data.
Prior to version 2.6 , Linux was a non preemptive kernel , meaning that a process running in kernel mode could not be pre-
empted – even if a higher-priority process became available to run . With version 2.6 , the linux kernel became fully preemptive ;
so a task can now be pre-empted when it is running in the kernel .
The Linuxkernelprovidesspinlocks and semaphores for lockingin the kernel.
On single–processor machines spinlocks are inappropriatefor use and are replacedby enablingand disablingkernel pre-emption
.
Symmetric multiprocessing
The linux2. 0 kernelwas the first stablelinuxkernel to support symmetric multiprocessor(smp) hardware , allowing
separateprocessesto executein parallelon separateprocessors .
implementation Restriction– onlyone processat a time couldbe executingkernel- mode code .
Version 2.2
In version2.2 of the kernel , a single kernel spinlockwas createdto allow multiple processes to be active in the
kernel concurrently.
Laterwiththe releases of the kernel made the (smp) implementation more scalable by splitting this single
kernel spinlockinto multiple locks, eachof which protects the small subset of the kernel’s data structures.
Input and output
Linuxsplitsalldevicesintothreedevices:
blockde
vices
characterdevices
networkdevices
Definition
Block devices – include all devices that allowrandom access to completelyindependent , fixed-sizedblocks of data, including hard
disks and floppydisks, CD-ROMs and flashmemory.
character devices– include most other devices, such as mice and keyboards.
Network devices – are dealt withdifferentlyfromblockand characterdevices .
Block devices
Blockdevicesprovidethemaininterfaceto alldiskdevicesina system.
A blockrepresentstheunitwithwhichthekernelperformsI/o.
Whena block isreadintomemory, it isstoredina buffer. The requestmanageris thelayerof softwarethatmanagesthe readingandwritingof buffer
contentsto andfroma block-devicedriver.
Scheduling of i/o versions
A separate list of requests is kept for each block-device driver. Traditionally, these requestshave beenscheduled accordingto a
unidirectional-elevator (c-scan) algorithmthat exploitsthe order in whichrequests are inserted in and removed fromthe list . The
request lists are maintained in sorted orderof increasing starting – sector number . Whena request is acceptedfor processing by a
block-device driver , it is not removed fromthe list. It is removed onlyafterthe i/o is complete, at whichpoint the driver continues
withthe next request in the list , even if newrequests have been inserted intothe list before the activerequest .
Character devices
A character–devicedrivercanbe almostanydevicedriverthatdoesnotofferrandomaccessto fixedblocksof data. Anycharacter– devicedrivers
registeredto theLinuxkernelmustalsoregistera setof functionsthatimplementthefilei/ooperationsthatthe drivercanhandle. Thekernelperforms
almostno preprocessingof a filereador writerequestto a characterdevice;it simplypassestherequestto thedevicein questionandletsthedevicedeal
withtherequest.
Line discipline
A linedisciplineisan interpreterfortheinformationfromtheterminaldevice.Themostcommonlinedisciplineisthetty discipline, whichgluesthe
terminal’sdatastreamontothestandardinput andoutputstreamsof a user’srunningprocesses, allowingthoseprocessesto communicatedirectlywith
theuser’sterminal.
Thisjob iscomplicatedbythefactthatseveralsuchprocessesmaybe runningsimultaneously, andthettylinedisciplineisresponsibleforattachingand
detachingtheterminal’sinputandoutputfromthevariousprocessesconnectedto it asthoseprocessesaresuspendedor awakenedby theuser.
Thank you
Effortsby
sanidhyachugh
Bca/25017/17
Source of information
Operatingsystemconcepts 8th edition

More Related Content

PDF
Linux scheduler
PDF
Memory management in Linux kernel
PPTX
Linux Memory Management
PDF
Performance Analysis Tools for Linux Kernel
PDF
Linux Memory Management
PPT
Linux Crash Dump Capture and Analysis
PDF
Linux Synchronization Mechanism: RCU (Read Copy Update)
PDF
BPF: Tracing and more
Linux scheduler
Memory management in Linux kernel
Linux Memory Management
Performance Analysis Tools for Linux Kernel
Linux Memory Management
Linux Crash Dump Capture and Analysis
Linux Synchronization Mechanism: RCU (Read Copy Update)
BPF: Tracing and more

What's hot (20)

PDF
The Linux Block Layer - Built for Fast Storage
PPT
Memory management in linux
PDF
The Linux Kernel Scheduler (For Beginners) - SFO17-421
PDF
Linux Kernel - Virtual File System
PDF
XPDS16: Porting Xen on ARM to a new SOC - Julien Grall, ARM
PPTX
Redhat ha cluster with pacemaker
PPTX
Linux booting process - Linux System Administration
PPT
Process scheduling linux
PPTX
Linux MMAP & Ioremap introduction
ODP
Linux Kernel Crashdump
PDF
Linux basic commands with examples
PDF
Qemu JIT Code Generator and System Emulation
PPTX
Linux process management
PDF
Process Scheduler and Balancer in Linux Kernel
DOCX
linux file sysytem& input and output
PDF
Reverse Mapping (rmap) in Linux Kernel
PDF
New Ways to Find Latency in Linux Using Tracing
PPT
RedHat Linux
 
PDF
Qemu Introduction
The Linux Block Layer - Built for Fast Storage
Memory management in linux
The Linux Kernel Scheduler (For Beginners) - SFO17-421
Linux Kernel - Virtual File System
XPDS16: Porting Xen on ARM to a new SOC - Julien Grall, ARM
Redhat ha cluster with pacemaker
Linux booting process - Linux System Administration
Process scheduling linux
Linux MMAP & Ioremap introduction
Linux Kernel Crashdump
Linux basic commands with examples
Qemu JIT Code Generator and System Emulation
Linux process management
Process Scheduler and Balancer in Linux Kernel
linux file sysytem& input and output
Reverse Mapping (rmap) in Linux Kernel
New Ways to Find Latency in Linux Using Tracing
RedHat Linux
 
Qemu Introduction
Ad

Similar to Linux scheduling and input and output (20)

PPSX
linux kernel overview 2013
PPT
Linux Performance Tunning Kernel
PPTX
Io sy.stemppt
PPTX
Linux architecture
ODP
Linux Internals - Kernel/Core
PPTX
Process scheduling
PDF
Linux kernel development ch4
PDF
Linux kernel development_ch9-10_20120410
PDF
Linux kernel development chapter 10
PPTX
Operating System Introduction - Definition, Working, Components
PPTX
Os unit 3 , process management
DOCX
Week 11Linux InternalsProcesses, schedulingLecture o.docx
PDF
Linux Internals - Part II
PPT
Synchronization linux
PDF
os-lect 1-Intro (3).pdf by buddha and GOD
PPTX
operating system
PPTX
Resource Monitoring and management
PDF
Making Linux do Hard Real-time
PDF
Linux kernel Architecture and Properties
linux kernel overview 2013
Linux Performance Tunning Kernel
Io sy.stemppt
Linux architecture
Linux Internals - Kernel/Core
Process scheduling
Linux kernel development ch4
Linux kernel development_ch9-10_20120410
Linux kernel development chapter 10
Operating System Introduction - Definition, Working, Components
Os unit 3 , process management
Week 11Linux InternalsProcesses, schedulingLecture o.docx
Linux Internals - Part II
Synchronization linux
os-lect 1-Intro (3).pdf by buddha and GOD
operating system
Resource Monitoring and management
Making Linux do Hard Real-time
Linux kernel Architecture and Properties
Ad

Recently uploaded (20)

PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Big Data Technologies - Introduction.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Cloud computing and distributed systems.
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Approach and Philosophy of On baking technology
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Review of recent advances in non-invasive hemoglobin estimation
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
sap open course for s4hana steps from ECC to s4
Programs and apps: productivity, graphics, security and other tools
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Diabetes mellitus diagnosis method based random forest with bat algorithm
Big Data Technologies - Introduction.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Network Security Unit 5.pdf for BCA BBA.
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Dropbox Q2 2025 Financial Results & Investor Presentation
Cloud computing and distributed systems.
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Approach and Philosophy of On baking technology
Encapsulation_ Review paper, used for researhc scholars
Reach Out and Touch Someone: Haptics and Empathic Computing
Review of recent advances in non-invasive hemoglobin estimation

Linux scheduling and input and output

  • 1. Scheduling Scheduling is the job of allocating cpu(central processing unit) time to different tasks within an operating system. Scheduling includes - : Process scheduling , kernel synchronization and symmetric multiprocessing .
  • 2. Process scheduling Linux hastwo separateprocess-schedulingalgorithms . One is the time – sharingalgorithm for fair , preemptive scheduling amongmultiple processes ; the otheris designedfor real – time tasks, where absoluteprioritiesare more important than fairness. The Linux scheduler is a preemptive , priority – based algorithm with two separate priority ranges : a real- time range from 0 to 99 and a nice value ranging from 100 to 140 . These two ranges map into a global priority scheme whereby numerically lower values indicate higher priorities. there are two real time scheduling classes – first-come first-served (fcfs) and round-robin (rr)
  • 3. Kernel synchronization Kernel synchronizationinvolves muchmore thanjust process scheduling . A framework is requiredthat allows kernel tasks to run without violatingthe integrityof shared data. Prior to version 2.6 , Linux was a non preemptive kernel , meaning that a process running in kernel mode could not be pre- empted – even if a higher-priority process became available to run . With version 2.6 , the linux kernel became fully preemptive ; so a task can now be pre-empted when it is running in the kernel . The Linuxkernelprovidesspinlocks and semaphores for lockingin the kernel. On single–processor machines spinlocks are inappropriatefor use and are replacedby enablingand disablingkernel pre-emption .
  • 4. Symmetric multiprocessing The linux2. 0 kernelwas the first stablelinuxkernel to support symmetric multiprocessor(smp) hardware , allowing separateprocessesto executein parallelon separateprocessors . implementation Restriction– onlyone processat a time couldbe executingkernel- mode code . Version 2.2 In version2.2 of the kernel , a single kernel spinlockwas createdto allow multiple processes to be active in the kernel concurrently. Laterwiththe releases of the kernel made the (smp) implementation more scalable by splitting this single kernel spinlockinto multiple locks, eachof which protects the small subset of the kernel’s data structures.
  • 5. Input and output Linuxsplitsalldevicesintothreedevices: blockde vices characterdevices networkdevices Definition Block devices – include all devices that allowrandom access to completelyindependent , fixed-sizedblocks of data, including hard disks and floppydisks, CD-ROMs and flashmemory. character devices– include most other devices, such as mice and keyboards. Network devices – are dealt withdifferentlyfromblockand characterdevices .
  • 6. Block devices Blockdevicesprovidethemaininterfaceto alldiskdevicesina system. A blockrepresentstheunitwithwhichthekernelperformsI/o. Whena block isreadintomemory, it isstoredina buffer. The requestmanageris thelayerof softwarethatmanagesthe readingandwritingof buffer contentsto andfroma block-devicedriver. Scheduling of i/o versions A separate list of requests is kept for each block-device driver. Traditionally, these requestshave beenscheduled accordingto a unidirectional-elevator (c-scan) algorithmthat exploitsthe order in whichrequests are inserted in and removed fromthe list . The request lists are maintained in sorted orderof increasing starting – sector number . Whena request is acceptedfor processing by a block-device driver , it is not removed fromthe list. It is removed onlyafterthe i/o is complete, at whichpoint the driver continues withthe next request in the list , even if newrequests have been inserted intothe list before the activerequest .
  • 7. Character devices A character–devicedrivercanbe almostanydevicedriverthatdoesnotofferrandomaccessto fixedblocksof data. Anycharacter– devicedrivers registeredto theLinuxkernelmustalsoregistera setof functionsthatimplementthefilei/ooperationsthatthe drivercanhandle. Thekernelperforms almostno preprocessingof a filereador writerequestto a characterdevice;it simplypassestherequestto thedevicein questionandletsthedevicedeal withtherequest. Line discipline A linedisciplineisan interpreterfortheinformationfromtheterminaldevice.Themostcommonlinedisciplineisthetty discipline, whichgluesthe terminal’sdatastreamontothestandardinput andoutputstreamsof a user’srunningprocesses, allowingthoseprocessesto communicatedirectlywith theuser’sterminal. Thisjob iscomplicatedbythefactthatseveralsuchprocessesmaybe runningsimultaneously, andthettylinedisciplineisresponsibleforattachingand detachingtheterminal’sinputandoutputfromthevariousprocessesconnectedto it asthoseprocessesaresuspendedor awakenedby theuser.
  • 8. Thank you Effortsby sanidhyachugh Bca/25017/17 Source of information Operatingsystemconcepts 8th edition