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
Ad

More Related Content

What's hot (20)

Linux device drivers
Linux device drivers Linux device drivers
Linux device drivers
Emertxe Information Technologies Pvt Ltd
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File System
Sadia Bashir
 
LCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted FirmwareLCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted Firmware
Linaro
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)
shimosawa
 
Linux Programming
Linux ProgrammingLinux Programming
Linux Programming
Emertxe Information Technologies Pvt Ltd
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
Tushar B Kute
 
Embedded Operating System - Linux
Embedded Operating System - LinuxEmbedded Operating System - Linux
Embedded Operating System - Linux
Emertxe Information Technologies Pvt Ltd
 
Linux on ARM 64-bit Architecture
Linux on ARM 64-bit ArchitectureLinux on ARM 64-bit Architecture
Linux on ARM 64-bit Architecture
Ryo Jin
 
Understanding a kernel oops and a kernel panic
Understanding a kernel oops and a kernel panicUnderstanding a kernel oops and a kernel panic
Understanding a kernel oops and a kernel panic
Joseph Lu
 
LCU14 500 ARM Trusted Firmware
LCU14 500 ARM Trusted FirmwareLCU14 500 ARM Trusted Firmware
LCU14 500 ARM Trusted Firmware
Linaro
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
shimosawa
 
Hardware Abstraction Layer
Hardware Abstraction LayerHardware Abstraction Layer
Hardware Abstraction Layer
Teh Kian Cheng
 
Linux-Internals-and-Networking
Linux-Internals-and-NetworkingLinux-Internals-and-Networking
Linux-Internals-and-Networking
Emertxe Information Technologies Pvt Ltd
 
Linux boot process
Linux boot processLinux boot process
Linux boot process
Archana Chandrasekharan
 
Linux Memory
Linux MemoryLinux Memory
Linux Memory
Vitaly Nahshunov
 
Embedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernelEmbedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernel
Emertxe Information Technologies Pvt Ltd
 
Direct Memory Access (DMA)-Working and Implementation
Direct Memory Access (DMA)-Working and ImplementationDirect Memory Access (DMA)-Working and Implementation
Direct Memory Access (DMA)-Working and Implementation
Shubham Kumar
 
Kdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysisKdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysis
Buland Singh
 
LCU14 302- How to port OP-TEE to another platform
LCU14 302- How to port OP-TEE to another platformLCU14 302- How to port OP-TEE to another platform
LCU14 302- How to port OP-TEE to another platform
Linaro
 
Introduction to CUDA
Introduction to CUDAIntroduction to CUDA
Introduction to CUDA
Raymond Tay
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File System
Sadia Bashir
 
LCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted FirmwareLCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted Firmware
Linaro
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)
shimosawa
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
Tushar B Kute
 
Linux on ARM 64-bit Architecture
Linux on ARM 64-bit ArchitectureLinux on ARM 64-bit Architecture
Linux on ARM 64-bit Architecture
Ryo Jin
 
Understanding a kernel oops and a kernel panic
Understanding a kernel oops and a kernel panicUnderstanding a kernel oops and a kernel panic
Understanding a kernel oops and a kernel panic
Joseph Lu
 
LCU14 500 ARM Trusted Firmware
LCU14 500 ARM Trusted FirmwareLCU14 500 ARM Trusted Firmware
LCU14 500 ARM Trusted Firmware
Linaro
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
shimosawa
 
Hardware Abstraction Layer
Hardware Abstraction LayerHardware Abstraction Layer
Hardware Abstraction Layer
Teh Kian Cheng
 
Direct Memory Access (DMA)-Working and Implementation
Direct Memory Access (DMA)-Working and ImplementationDirect Memory Access (DMA)-Working and Implementation
Direct Memory Access (DMA)-Working and Implementation
Shubham Kumar
 
Kdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysisKdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysis
Buland Singh
 
LCU14 302- How to port OP-TEE to another platform
LCU14 302- How to port OP-TEE to another platformLCU14 302- How to port OP-TEE to another platform
LCU14 302- How to port OP-TEE to another platform
Linaro
 
Introduction to CUDA
Introduction to CUDAIntroduction to CUDA
Introduction to CUDA
Raymond Tay
 

Similar to Linux scheduling and input and output (20)

Linux architecture
Linux architectureLinux architecture
Linux architecture
mcganesh
 
Linux kernel Architecture and Properties
Linux kernel Architecture and PropertiesLinux kernel Architecture and Properties
Linux kernel Architecture and Properties
Saadi Rahman
 
Mca ii os u-5 unix linux file system
Mca  ii  os u-5 unix linux file systemMca  ii  os u-5 unix linux file system
Mca ii os u-5 unix linux file system
Rai University
 
Walking around linux kernel
Walking around linux kernelWalking around linux kernel
Walking around linux kernel
Dharshana Kasun Warusavitharana
 
OS Architectures and Different Kernel Approaches
OS Architectures and Different Kernel ApproachesOS Architectures and Different Kernel Approaches
OS Architectures and Different Kernel Approaches
osayauc
 
Linux internal
Linux internalLinux internal
Linux internal
mcganesh
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
mcganesh
 
Ch22
Ch22Ch22
Ch22
guestaf6c9b
 
OS_Ch20
OS_Ch20OS_Ch20
OS_Ch20
Supriya Shrivastava
 
Ch20 OS
Ch20 OSCh20 OS
Ch20 OS
C.U
 
OSCh20
OSCh20OSCh20
OSCh20
Joe Christensen
 
First steps on CentOs7
First steps on CentOs7First steps on CentOs7
First steps on CentOs7
Marc Cortinas Val
 
Linux@assignment ppt
Linux@assignment pptLinux@assignment ppt
Linux@assignment ppt
Rama .
 
Studies
StudiesStudies
Studies
Abhishek Masiiwal
 
managing kernal module from egineering sunject operating system
managing kernal module from egineering sunject operating systemmanaging kernal module from egineering sunject operating system
managing kernal module from egineering sunject operating system
mohammadshahnawaz77
 
Kernel (computing)
Kernel (computing)Kernel (computing)
Kernel (computing)
Teja Bheemanapally
 
Kernel (computing)
Kernel (computing)Kernel (computing)
Kernel (computing)
Teja Bheemanapally
 
Introduction to NetBSD kernel
Introduction to NetBSD kernelIntroduction to NetBSD kernel
Introduction to NetBSD kernel
Mahendra M
 
Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)
Vivian Vhaves
 
linux kernel overview 2013
linux kernel overview 2013linux kernel overview 2013
linux kernel overview 2013
Rohit Pratap Singh
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
mcganesh
 
Linux kernel Architecture and Properties
Linux kernel Architecture and PropertiesLinux kernel Architecture and Properties
Linux kernel Architecture and Properties
Saadi Rahman
 
Mca ii os u-5 unix linux file system
Mca  ii  os u-5 unix linux file systemMca  ii  os u-5 unix linux file system
Mca ii os u-5 unix linux file system
Rai University
 
OS Architectures and Different Kernel Approaches
OS Architectures and Different Kernel ApproachesOS Architectures and Different Kernel Approaches
OS Architectures and Different Kernel Approaches
osayauc
 
Linux internal
Linux internalLinux internal
Linux internal
mcganesh
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
mcganesh
 
Ch20 OS
Ch20 OSCh20 OS
Ch20 OS
C.U
 
Linux@assignment ppt
Linux@assignment pptLinux@assignment ppt
Linux@assignment ppt
Rama .
 
managing kernal module from egineering sunject operating system
managing kernal module from egineering sunject operating systemmanaging kernal module from egineering sunject operating system
managing kernal module from egineering sunject operating system
mohammadshahnawaz77
 
Introduction to NetBSD kernel
Introduction to NetBSD kernelIntroduction to NetBSD kernel
Introduction to NetBSD kernel
Mahendra M
 
Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)
Vivian Vhaves
 
Ad

Recently uploaded (20)

Slack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teamsSlack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teams
Nacho Cougil
 
DNF 2.0 Implementations Challenges in Nepal
DNF 2.0 Implementations Challenges in NepalDNF 2.0 Implementations Challenges in Nepal
DNF 2.0 Implementations Challenges in Nepal
ICT Frame Magazine Pvt. Ltd.
 
Top-AI-Based-Tools-for-Game-Developers (1).pptx
Top-AI-Based-Tools-for-Game-Developers (1).pptxTop-AI-Based-Tools-for-Game-Developers (1).pptx
Top-AI-Based-Tools-for-Game-Developers (1).pptx
BR Softech
 
How to Build an AI-Powered App: Tools, Techniques, and Trends
How to Build an AI-Powered App: Tools, Techniques, and TrendsHow to Build an AI-Powered App: Tools, Techniques, and Trends
How to Build an AI-Powered App: Tools, Techniques, and Trends
Nascenture
 
Understanding SEO in the Age of AI.pdf
Understanding SEO in the Age of AI.pdfUnderstanding SEO in the Age of AI.pdf
Understanding SEO in the Age of AI.pdf
Fulcrum Concepts, LLC
 
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz
 
Why Slack Should Be Your Next Business Tool? (Tips to Make Most out of Slack)
Why Slack Should Be Your Next Business Tool? (Tips to Make Most out of Slack)Why Slack Should Be Your Next Business Tool? (Tips to Make Most out of Slack)
Why Slack Should Be Your Next Business Tool? (Tips to Make Most out of Slack)
Cyntexa
 
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Christian Folini
 
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
Ivano Malavolta
 
Developing System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptxDeveloping System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptx
wondimagegndesta
 
An Overview of Salesforce Health Cloud & How is it Transforming Patient Care
An Overview of Salesforce Health Cloud & How is it Transforming Patient CareAn Overview of Salesforce Health Cloud & How is it Transforming Patient Care
An Overview of Salesforce Health Cloud & How is it Transforming Patient Care
Cyntexa
 
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Maarten Verwaest
 
ACE Aarhus - Team'25 wrap-up presentation
ACE Aarhus - Team'25 wrap-up presentationACE Aarhus - Team'25 wrap-up presentation
ACE Aarhus - Team'25 wrap-up presentation
DanielEriksen5
 
Agentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community MeetupAgentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community Meetup
Manoj Batra (1600 + Connections)
 
Config 2025 presentation recap covering both days
Config 2025 presentation recap covering both daysConfig 2025 presentation recap covering both days
Config 2025 presentation recap covering both days
TrishAntoni1
 
Dark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanizationDark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanization
Jakub Šimek
 
machines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdfmachines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdf
AmirStern2
 
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdfKit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Wonjun Hwang
 
Cybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and MitigationCybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and Mitigation
VICTOR MAESTRE RAMIREZ
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Slack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teamsSlack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teams
Nacho Cougil
 
Top-AI-Based-Tools-for-Game-Developers (1).pptx
Top-AI-Based-Tools-for-Game-Developers (1).pptxTop-AI-Based-Tools-for-Game-Developers (1).pptx
Top-AI-Based-Tools-for-Game-Developers (1).pptx
BR Softech
 
How to Build an AI-Powered App: Tools, Techniques, and Trends
How to Build an AI-Powered App: Tools, Techniques, and TrendsHow to Build an AI-Powered App: Tools, Techniques, and Trends
How to Build an AI-Powered App: Tools, Techniques, and Trends
Nascenture
 
Understanding SEO in the Age of AI.pdf
Understanding SEO in the Age of AI.pdfUnderstanding SEO in the Age of AI.pdf
Understanding SEO in the Age of AI.pdf
Fulcrum Concepts, LLC
 
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz
 
Why Slack Should Be Your Next Business Tool? (Tips to Make Most out of Slack)
Why Slack Should Be Your Next Business Tool? (Tips to Make Most out of Slack)Why Slack Should Be Your Next Business Tool? (Tips to Make Most out of Slack)
Why Slack Should Be Your Next Business Tool? (Tips to Make Most out of Slack)
Cyntexa
 
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?
Christian Folini
 
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
Ivano Malavolta
 
Developing System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptxDeveloping System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptx
wondimagegndesta
 
An Overview of Salesforce Health Cloud & How is it Transforming Patient Care
An Overview of Salesforce Health Cloud & How is it Transforming Patient CareAn Overview of Salesforce Health Cloud & How is it Transforming Patient Care
An Overview of Salesforce Health Cloud & How is it Transforming Patient Care
Cyntexa
 
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Maarten Verwaest
 
ACE Aarhus - Team'25 wrap-up presentation
ACE Aarhus - Team'25 wrap-up presentationACE Aarhus - Team'25 wrap-up presentation
ACE Aarhus - Team'25 wrap-up presentation
DanielEriksen5
 
Config 2025 presentation recap covering both days
Config 2025 presentation recap covering both daysConfig 2025 presentation recap covering both days
Config 2025 presentation recap covering both days
TrishAntoni1
 
Dark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanizationDark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanization
Jakub Šimek
 
machines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdfmachines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdf
AmirStern2
 
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdfKit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Wonjun Hwang
 
Cybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and MitigationCybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and Mitigation
VICTOR MAESTRE RAMIREZ
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Ad

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
  翻译: