SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Process Scheduling in Linux
Outline ,[object Object],[object Object],[object Object]
Scheduling Policy ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
System Calls related to Scheduling  change the priority get the maximum group priority set the group priority get the scheduling policy set the scheduling policy and priority get the priority set the priority relinquish the processor voluntarily get the minimum priority value get the maximum priority value get the time quantum for Round-Robin set the CPU affinity mask get the CPU affinity mask nice() getpriority() setpriority() sched_getscheduler() sched_setscheduler() sched_getparam() sched_setparam() sched_yield() sched_get_priority_min() sched_get_priority_max() sched_rr_get_interval() sched_setaffinity() sched_getaffinity() description System call
Process Preemption ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How Long Must a Quantum Last? ,[object Object],[object Object],[object Object],[object Object],[object Object]
The Scheduling Algorithm ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Scheduling of Conventional Processes ,[object Object],[object Object],[object Object],[object Object]
Typical Priority Values for a Conventional Process 1199 ms +6 5 ms +19 139 Lowest static priority 999 ms +4 50 ms +10 130 Low static priority 799 ms +2 100 ms 0 120 Default static priority 499 ms - 1 600 ms - 10 110 High static priority 299 ms -3 800 ms -20 100 Highest static priority Sleep time threshold Interactive delta Base time quantum Nice value Static priority Description
Dynamic Priority and Average Sleep Time ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Average Sleep Time, Bonus Values, and Time Slice Granularity 10 10 1 second 10 9 >= 900 ms but < 1000 ms 20 8 >= 800 ms but < 900 ms 40 7 >= 700 ms but < 800 ms 80 6 >= 600 ms but < 700 ms 160 5 >= 500 ms but < 600 ms 320 4 >= 400 ms but < 500 ms 640 3 >= 300 ms but < 400 ms 1280 2 >= 200 ms but < 300 ms 2560 1 >= 100 ms but < 200 ms 5120 0 >= 0 but < 100 ms Granularity Bonus Average sleep time
[object Object],[object Object],[object Object],[object Object]
Active and Expired Processes ,[object Object],[object Object],[object Object]
Scheduling on Real-Time Processes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Data Structures Used by the Scheduler ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Two Sets of Runnable Processes in the  runqueue  Structure
Process Descriptor Fields Related to the Scheduler ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Functions Used by the Scheduler ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The schedule() Function ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Runqueue Balancing in Multiprocessor Systems ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Scheduling Domains ,[object Object],[object Object],[object Object]
System Calls Related to Scheduling ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
System Calls Related to Real-Time Processes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Weitere ähnliche Inhalte

Was ist angesagt?

Linux architecture
Linux architectureLinux architecture
Linux architecture
mcganesh
 
Processes in unix
Processes in unixProcesses in unix
Processes in unix
miau_max
 
Linux internal
Linux internalLinux internal
Linux internal
mcganesh
 

Was ist angesagt? (20)

Linux scheduler
Linux schedulerLinux scheduler
Linux scheduler
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File System
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New Hardware
 
Linux Programming
Linux ProgrammingLinux Programming
Linux Programming
 
CS6401 OPERATING SYSTEMS Unit 2
CS6401 OPERATING SYSTEMS Unit 2CS6401 OPERATING SYSTEMS Unit 2
CS6401 OPERATING SYSTEMS Unit 2
 
Chapter 8 - Main Memory
Chapter 8 - Main MemoryChapter 8 - Main Memory
Chapter 8 - Main Memory
 
Linux Kernel - Virtual File System
Linux Kernel - Virtual File SystemLinux Kernel - Virtual File System
Linux Kernel - Virtual File System
 
Linux kernel Architecture and Properties
Linux kernel Architecture and PropertiesLinux kernel Architecture and Properties
Linux kernel Architecture and Properties
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
 
Linux scheduling and input and output
Linux scheduling and input and outputLinux scheduling and input and output
Linux scheduling and input and output
 
Processes in unix
Processes in unixProcesses in unix
Processes in unix
 
Operating systems system structures
Operating systems   system structuresOperating systems   system structures
Operating systems system structures
 
Linux kernel architecture
Linux kernel architectureLinux kernel architecture
Linux kernel architecture
 
operating system structure
operating system structureoperating system structure
operating system structure
 
Process Scheduler and Balancer in Linux Kernel
Process Scheduler and Balancer in Linux KernelProcess Scheduler and Balancer in Linux Kernel
Process Scheduler and Balancer in Linux Kernel
 
Signal
SignalSignal
Signal
 
Linux internal
Linux internalLinux internal
Linux internal
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Operating System 2
Operating System 2Operating System 2
Operating System 2
 

Ähnlich wie Process scheduling linux

Linux Process & CF scheduling
Linux Process & CF schedulingLinux Process & CF scheduling
Linux Process & CF scheduling
SangJung Woo
 
Ch6
Ch6Ch6
Ch6
C.U
 
cpu sechduling
cpu sechduling cpu sechduling
cpu sechduling
gopi7
 
Process management in os
Process management in osProcess management in os
Process management in os
Miong Lazaro
 

Ähnlich wie Process scheduling linux (20)

Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
Unit iios process scheduling and synchronization
Unit iios process scheduling and synchronizationUnit iios process scheduling and synchronization
Unit iios process scheduling and synchronization
 
Linux Process & CF scheduling
Linux Process & CF schedulingLinux Process & CF scheduling
Linux Process & CF scheduling
 
Window scheduling algorithm
Window scheduling algorithmWindow scheduling algorithm
Window scheduling algorithm
 
Ch6
Ch6Ch6
Ch6
 
Cpu_sheduling.pptx
Cpu_sheduling.pptxCpu_sheduling.pptx
Cpu_sheduling.pptx
 
Ch05
Ch05Ch05
Ch05
 
cpu sechduling
cpu sechduling cpu sechduling
cpu sechduling
 
Os2
Os2Os2
Os2
 
Where the wild things are - Benchmarking and Micro-Optimisations
Where the wild things are - Benchmarking and Micro-OptimisationsWhere the wild things are - Benchmarking and Micro-Optimisations
Where the wild things are - Benchmarking and Micro-Optimisations
 
Algorithm analysis.pptx
Algorithm analysis.pptxAlgorithm analysis.pptx
Algorithm analysis.pptx
 
cpu scheduling in os
cpu scheduling in oscpu scheduling in os
cpu scheduling in os
 
CH06.pdf
CH06.pdfCH06.pdf
CH06.pdf
 
Process scheduling &amp; time
Process scheduling &amp; timeProcess scheduling &amp; time
Process scheduling &amp; time
 
Process management in os
Process management in osProcess management in os
Process management in os
 
Embedded_ PPT_4-5 unit_Dr Monika-edited.pptx
Embedded_ PPT_4-5 unit_Dr Monika-edited.pptxEmbedded_ PPT_4-5 unit_Dr Monika-edited.pptx
Embedded_ PPT_4-5 unit_Dr Monika-edited.pptx
 
Performance Schema for MySQL Troubleshooting
Performance Schema for MySQL TroubleshootingPerformance Schema for MySQL Troubleshooting
Performance Schema for MySQL Troubleshooting
 
Performance
PerformancePerformance
Performance
 
Performance and how to measure it - ProgSCon London 2016
Performance and how to measure it - ProgSCon London 2016Performance and how to measure it - ProgSCon London 2016
Performance and how to measure it - ProgSCon London 2016
 
Operating System Scheduling
Operating System SchedulingOperating System Scheduling
Operating System Scheduling
 

Mehr von Dr. C.V. Suresh Babu

Mehr von Dr. C.V. Suresh Babu (20)

Data analytics with R
Data analytics with RData analytics with R
Data analytics with R
 
Association rules
Association rulesAssociation rules
Association rules
 
Clustering
ClusteringClustering
Clustering
 
Classification
ClassificationClassification
Classification
 
Blue property assumptions.
Blue property assumptions.Blue property assumptions.
Blue property assumptions.
 
Introduction to regression
Introduction to regressionIntroduction to regression
Introduction to regression
 
DART
DARTDART
DART
 
Mycin
MycinMycin
Mycin
 
Expert systems
Expert systemsExpert systems
Expert systems
 
Dempster shafer theory
Dempster shafer theoryDempster shafer theory
Dempster shafer theory
 
Bayes network
Bayes networkBayes network
Bayes network
 
Bayes' theorem
Bayes' theoremBayes' theorem
Bayes' theorem
 
Knowledge based agents
Knowledge based agentsKnowledge based agents
Knowledge based agents
 
Rule based system
Rule based systemRule based system
Rule based system
 
Formal Logic in AI
Formal Logic in AIFormal Logic in AI
Formal Logic in AI
 
Production based system
Production based systemProduction based system
Production based system
 
Game playing in AI
Game playing in AIGame playing in AI
Game playing in AI
 
Diagnosis test of diabetics and hypertension by AI
Diagnosis test of diabetics and hypertension by AIDiagnosis test of diabetics and hypertension by AI
Diagnosis test of diabetics and hypertension by AI
 
A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”
 
A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”
 

Kürzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 

Process scheduling linux

  • 2.
  • 3.
  • 4. System Calls related to Scheduling change the priority get the maximum group priority set the group priority get the scheduling policy set the scheduling policy and priority get the priority set the priority relinquish the processor voluntarily get the minimum priority value get the maximum priority value get the time quantum for Round-Robin set the CPU affinity mask get the CPU affinity mask nice() getpriority() setpriority() sched_getscheduler() sched_setscheduler() sched_getparam() sched_setparam() sched_yield() sched_get_priority_min() sched_get_priority_max() sched_rr_get_interval() sched_setaffinity() sched_getaffinity() description System call
  • 5.
  • 6.
  • 7.
  • 8.
  • 9. Typical Priority Values for a Conventional Process 1199 ms +6 5 ms +19 139 Lowest static priority 999 ms +4 50 ms +10 130 Low static priority 799 ms +2 100 ms 0 120 Default static priority 499 ms - 1 600 ms - 10 110 High static priority 299 ms -3 800 ms -20 100 Highest static priority Sleep time threshold Interactive delta Base time quantum Nice value Static priority Description
  • 10.
  • 11. Average Sleep Time, Bonus Values, and Time Slice Granularity 10 10 1 second 10 9 >= 900 ms but < 1000 ms 20 8 >= 800 ms but < 900 ms 40 7 >= 700 ms but < 800 ms 80 6 >= 600 ms but < 700 ms 160 5 >= 500 ms but < 600 ms 320 4 >= 400 ms but < 500 ms 640 3 >= 300 ms but < 400 ms 1280 2 >= 200 ms but < 300 ms 2560 1 >= 100 ms but < 200 ms 5120 0 >= 0 but < 100 ms Granularity Bonus Average sleep time
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. Two Sets of Runnable Processes in the runqueue Structure
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.