SlideShare a Scribd company logo
1 of 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]

More Related Content

What's hot

Processes Control Block (Operating System)
Processes Control Block (Operating System)Processes Control Block (Operating System)
Processes Control Block (Operating System)
Imdad Ullah
 
Process management in os
Process management in osProcess management in os
Process management in os
Miong Lazaro
 
Thrashing allocation frames.43
Thrashing allocation frames.43Thrashing allocation frames.43
Thrashing allocation frames.43
myrajendra
 

What's hot (20)

Signal Handling in Linux
Signal Handling in LinuxSignal Handling in Linux
Signal Handling in Linux
 
Linux scheduling and input and output
Linux scheduling and input and outputLinux scheduling and input and output
Linux scheduling and input and output
 
Processes Control Block (Operating System)
Processes Control Block (Operating System)Processes Control Block (Operating System)
Processes Control Block (Operating System)
 
Linux file system
Linux file systemLinux file system
Linux file system
 
Process management in os
Process management in osProcess management in os
Process management in os
 
Memory management
Memory managementMemory management
Memory management
 
Parallel processing
Parallel processingParallel processing
Parallel processing
 
System call
System callSystem call
System call
 
System call
System callSystem call
System call
 
U boot-boot-flow
U boot-boot-flowU boot-boot-flow
U boot-boot-flow
 
Linux Programming
Linux ProgrammingLinux Programming
Linux Programming
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memory
 
System calls
System callsSystem calls
System calls
 
Dead Lock in operating system
Dead Lock in operating systemDead Lock in operating system
Dead Lock in operating system
 
Thrashing allocation frames.43
Thrashing allocation frames.43Thrashing allocation frames.43
Thrashing allocation frames.43
 
Process management in linux
Process management in linuxProcess management in linux
Process management in linux
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
Process of operating system
Process of operating systemProcess of operating system
Process of operating system
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 

Similar to 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
 

Similar to 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
 
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
 
Introduction to SLURM
Introduction to SLURMIntroduction to SLURM
Introduction to SLURM
 

More from Dr. C.V. Suresh Babu

More from 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”
 

Recently uploaded

Recently uploaded (20)

ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
THE BEST IPTV in GERMANY for 2024: IPTVreel
THE BEST IPTV in  GERMANY for 2024: IPTVreelTHE BEST IPTV in  GERMANY for 2024: IPTVreel
THE BEST IPTV in GERMANY for 2024: IPTVreel
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 

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.