SlideShare a Scribd company logo
1 of 17
Multiprocessor Scheduling
SHOAIB MANZOOR
F19-MSCS-5020
Multicore Processors
 Multiple CPU cores are packed into single chip.
 Making single CPU too fast by this technique.
Difficulties in Multicore
 C Program uses only one CPU.
 Adding more CPUs doesn’t make the program run faster.
 To OVERCOME this difficulty we need to rewrite the C program to run in parallel
(Threads).
Difference B/W Single CPU and Multi-CPU
Hardware
 Use of Hardware Caches.
 Caches are small, fast memories that hold copies of popular data.
Temporal locality and spatial locality
 Temporal locality is that when a piece of data is accessed, it is likely to be
accessed again in the near future. E.g. Loop
 Spatial locality is that if a program accesses a data item at address x, it is likely
to access data items near x as well. E.g. Arrays
Cache Coherence
 Multiple processors with single shared memory.
Bus Snooping
 Each cache pays attention to memory updates by observing the bus that
connects them to main memory.
 it will notice the change.
 Then it will remove it from its cache or it will update the data.
Locking
 In this case, allocating a simple mutex (e.g., pthread mutex tm;)
and then adding a lock at the beginning of the routine and an
unlock at the end will solve the problem, ensuring that the code will
execute as desired.
Cache Affinity
 One process is running on CPU1 and then terminates and wants to run again it will
run fast on CPU!.
 But if this process will run on diff processor every time then performance of this
process will be worse because each time it has to reload state each time.
SQMS
 Single Queue Multiprocessor Scheduling.
 Reuse the basic framework for single processor scheduling, by putting all jobs that
need to be scheduled into a single queue.
Problems in SQMS
 Lack of Scalability
 Cache Affinity
Overcome to Cache Affinity
Multi-Queue Scheduling
 Problems caused in single-queue schedulers, some systems opt for multiple
queues, e.g., one per CPU.
 By using RR system will behave like this
MQS Drawback and Solution
 What if A and C finishes ealrly?
 Solution:
 Migration is the only option to overcome this drawback.
Linux Multiprocessor Schedulers
 O(1) scheduler.
 Completely Fair Scheduler (CFS).
 BF Scheduler (BFS).
 Both O(1) and CFS use multiple queues, whereas BFS uses a single queue,
Thank you
Any Question???

More Related Content

What's hot

Multiprocessors(performance and synchronization issues)
Multiprocessors(performance and synchronization issues)Multiprocessors(performance and synchronization issues)
Multiprocessors(performance and synchronization issues)Gaurav Dalvi
 
Wish list from PostgreSQL - Linux Kernel Summit 2009
Wish list from PostgreSQL - Linux Kernel Summit 2009Wish list from PostgreSQL - Linux Kernel Summit 2009
Wish list from PostgreSQL - Linux Kernel Summit 2009Takahiro Itagaki
 
Lecture 6.1
Lecture  6.1Lecture  6.1
Lecture 6.1Mr SMAK
 
Hardware Multi-Threading
Hardware Multi-ThreadingHardware Multi-Threading
Hardware Multi-Threadingbabuece
 
Introduction to Advance Computer Architecture
Introduction to Advance Computer ArchitectureIntroduction to Advance Computer Architecture
Introduction to Advance Computer Architecturebabuece
 
Shared-Memory Multiprocessors
Shared-Memory MultiprocessorsShared-Memory Multiprocessors
Shared-Memory MultiprocessorsSalvatore La Bua
 
Computer architecture multi processor
Computer architecture multi processorComputer architecture multi processor
Computer architecture multi processorMazin Alwaaly
 
Cache memory.12
Cache memory.12Cache memory.12
Cache memory.12myrajendra
 
Chapter 08
Chapter 08Chapter 08
Chapter 08 Google
 
Multiprocessor Systems
Multiprocessor SystemsMultiprocessor Systems
Multiprocessor Systemsvampugani
 
An Introduction to threads
An Introduction to threadsAn Introduction to threads
An Introduction to threadsZahra Sadeghi
 
multi processors
multi processorsmulti processors
multi processorsAcad
 
Multithreading models
Multithreading modelsMultithreading models
Multithreading modelsanoopkrishna2
 

What's hot (20)

Multiprocessors(performance and synchronization issues)
Multiprocessors(performance and synchronization issues)Multiprocessors(performance and synchronization issues)
Multiprocessors(performance and synchronization issues)
 
Wish list from PostgreSQL - Linux Kernel Summit 2009
Wish list from PostgreSQL - Linux Kernel Summit 2009Wish list from PostgreSQL - Linux Kernel Summit 2009
Wish list from PostgreSQL - Linux Kernel Summit 2009
 
Multiprocessor system
Multiprocessor systemMultiprocessor system
Multiprocessor system
 
Lecture 6.1
Lecture  6.1Lecture  6.1
Lecture 6.1
 
Multiprocessor
MultiprocessorMultiprocessor
Multiprocessor
 
Hardware Multi-Threading
Hardware Multi-ThreadingHardware Multi-Threading
Hardware Multi-Threading
 
Introduction to Advance Computer Architecture
Introduction to Advance Computer ArchitectureIntroduction to Advance Computer Architecture
Introduction to Advance Computer Architecture
 
Multiprocessing operating systems
Multiprocessing operating systemsMultiprocessing operating systems
Multiprocessing operating systems
 
Cache memory
Cache memory Cache memory
Cache memory
 
Shared-Memory Multiprocessors
Shared-Memory MultiprocessorsShared-Memory Multiprocessors
Shared-Memory Multiprocessors
 
Symmetric multiprocessing
Symmetric multiprocessingSymmetric multiprocessing
Symmetric multiprocessing
 
Computer architecture multi processor
Computer architecture multi processorComputer architecture multi processor
Computer architecture multi processor
 
Cache memory.12
Cache memory.12Cache memory.12
Cache memory.12
 
Cache memory
Cache memoryCache memory
Cache memory
 
Chapter 08
Chapter 08Chapter 08
Chapter 08
 
Multiprocessor Systems
Multiprocessor SystemsMultiprocessor Systems
Multiprocessor Systems
 
An Introduction to threads
An Introduction to threadsAn Introduction to threads
An Introduction to threads
 
multi processors
multi processorsmulti processors
multi processors
 
Multithreading models
Multithreading modelsMultithreading models
Multithreading models
 
Multiprocessor
MultiprocessorMultiprocessor
Multiprocessor
 

Similar to Multiprocessor Scheduling

Linux Device Driver parallelism using SMP and Kernel Pre-emption
Linux Device Driver parallelism using SMP and Kernel Pre-emptionLinux Device Driver parallelism using SMP and Kernel Pre-emption
Linux Device Driver parallelism using SMP and Kernel Pre-emptionHemanth Venkatesh
 
10 Multicore 07
10 Multicore 0710 Multicore 07
10 Multicore 07timcrack
 
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTES
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTESPARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTES
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTESsuthi
 
Symmetric multiprocessing and Microkernel
Symmetric multiprocessing and MicrokernelSymmetric multiprocessing and Microkernel
Symmetric multiprocessing and MicrokernelManoraj Pannerselum
 
ADVANCED COMPUTER ARCHITECTURE AND PARALLEL PROCESSING
ADVANCED COMPUTER ARCHITECTUREAND PARALLEL PROCESSINGADVANCED COMPUTER ARCHITECTUREAND PARALLEL PROCESSING
ADVANCED COMPUTER ARCHITECTURE AND PARALLEL PROCESSING Zena Abo-Altaheen
 
Introduction to multi core
Introduction to multi coreIntroduction to multi core
Introduction to multi coremukul bhardwaj
 
Shared memory Parallelism (NOTES)
Shared memory Parallelism (NOTES)Shared memory Parallelism (NOTES)
Shared memory Parallelism (NOTES)Subhajit Sahu
 
Unix operating system basics
Unix operating system basicsUnix operating system basics
Unix operating system basicsSankar Suriya
 
Cache memory and cache
Cache memory and cacheCache memory and cache
Cache memory and cacheVISHAL DONGA
 

Similar to Multiprocessor Scheduling (20)

Linux Device Driver parallelism using SMP and Kernel Pre-emption
Linux Device Driver parallelism using SMP and Kernel Pre-emptionLinux Device Driver parallelism using SMP and Kernel Pre-emption
Linux Device Driver parallelism using SMP and Kernel Pre-emption
 
Bus Based Multiprocessors v2
Bus Based Multiprocessors v2Bus Based Multiprocessors v2
Bus Based Multiprocessors v2
 
Cache memory
Cache memoryCache memory
Cache memory
 
Week5
Week5Week5
Week5
 
10 Multicore 07
10 Multicore 0710 Multicore 07
10 Multicore 07
 
6.distributed shared memory
6.distributed shared memory6.distributed shared memory
6.distributed shared memory
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
 
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTES
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTESPARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTES
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTES
 
Symmetric multiprocessing and Microkernel
Symmetric multiprocessing and MicrokernelSymmetric multiprocessing and Microkernel
Symmetric multiprocessing and Microkernel
 
ADVANCED COMPUTER ARCHITECTURE AND PARALLEL PROCESSING
ADVANCED COMPUTER ARCHITECTUREAND PARALLEL PROCESSINGADVANCED COMPUTER ARCHITECTUREAND PARALLEL PROCESSING
ADVANCED COMPUTER ARCHITECTURE AND PARALLEL PROCESSING
 
Introduction to multi core
Introduction to multi coreIntroduction to multi core
Introduction to multi core
 
Shared memory Parallelism (NOTES)
Shared memory Parallelism (NOTES)Shared memory Parallelism (NOTES)
Shared memory Parallelism (NOTES)
 
Dosass2
Dosass2Dosass2
Dosass2
 
Unix operating system basics
Unix operating system basicsUnix operating system basics
Unix operating system basics
 
Chap2 slides
Chap2 slidesChap2 slides
Chap2 slides
 
Operating System Lecture 4
Operating System Lecture 4Operating System Lecture 4
Operating System Lecture 4
 
Wiki 2
Wiki 2Wiki 2
Wiki 2
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 
Oversimplified CA
Oversimplified CAOversimplified CA
Oversimplified CA
 
Cache memory and cache
Cache memory and cacheCache memory and cache
Cache memory and cache
 

More from oDesk

1G, 2G, 3G, 4G, 5G. Best topic for telecom presentation
1G, 2G, 3G, 4G, 5G. Best topic for telecom presentation1G, 2G, 3G, 4G, 5G. Best topic for telecom presentation
1G, 2G, 3G, 4G, 5G. Best topic for telecom presentationoDesk
 
Formation of a Company
Formation of a Company Formation of a Company
Formation of a Company oDesk
 
Online Testing (Examination) System
Online Testing (Examination) SystemOnline Testing (Examination) System
Online Testing (Examination) SystemoDesk
 
Global Warming (full topic, Causes, impacts,Solution etc.)
Global Warming (full topic, Causes, impacts,Solution etc.)Global Warming (full topic, Causes, impacts,Solution etc.)
Global Warming (full topic, Causes, impacts,Solution etc.)oDesk
 
Customer Relationship Management
Customer Relationship  ManagementCustomer Relationship  Management
Customer Relationship ManagementoDesk
 
Sorting (Bubble,Merge,Selection sort)
Sorting (Bubble,Merge,Selection sort)Sorting (Bubble,Merge,Selection sort)
Sorting (Bubble,Merge,Selection sort)oDesk
 

More from oDesk (6)

1G, 2G, 3G, 4G, 5G. Best topic for telecom presentation
1G, 2G, 3G, 4G, 5G. Best topic for telecom presentation1G, 2G, 3G, 4G, 5G. Best topic for telecom presentation
1G, 2G, 3G, 4G, 5G. Best topic for telecom presentation
 
Formation of a Company
Formation of a Company Formation of a Company
Formation of a Company
 
Online Testing (Examination) System
Online Testing (Examination) SystemOnline Testing (Examination) System
Online Testing (Examination) System
 
Global Warming (full topic, Causes, impacts,Solution etc.)
Global Warming (full topic, Causes, impacts,Solution etc.)Global Warming (full topic, Causes, impacts,Solution etc.)
Global Warming (full topic, Causes, impacts,Solution etc.)
 
Customer Relationship Management
Customer Relationship  ManagementCustomer Relationship  Management
Customer Relationship Management
 
Sorting (Bubble,Merge,Selection sort)
Sorting (Bubble,Merge,Selection sort)Sorting (Bubble,Merge,Selection sort)
Sorting (Bubble,Merge,Selection sort)
 

Recently uploaded

Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxJohnnyPlasten
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxfirstjob4
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfRachmat Ramadhan H
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
Zuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxZuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxolyaivanovalion
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFxolyaivanovalion
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxMohammedJunaid861692
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...amitlee9823
 

Recently uploaded (20)

Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptx
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
Zuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxZuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptx
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 

Multiprocessor Scheduling

  • 2. Multicore Processors  Multiple CPU cores are packed into single chip.  Making single CPU too fast by this technique.
  • 3. Difficulties in Multicore  C Program uses only one CPU.  Adding more CPUs doesn’t make the program run faster.  To OVERCOME this difficulty we need to rewrite the C program to run in parallel (Threads).
  • 4. Difference B/W Single CPU and Multi-CPU Hardware  Use of Hardware Caches.  Caches are small, fast memories that hold copies of popular data.
  • 5. Temporal locality and spatial locality  Temporal locality is that when a piece of data is accessed, it is likely to be accessed again in the near future. E.g. Loop  Spatial locality is that if a program accesses a data item at address x, it is likely to access data items near x as well. E.g. Arrays
  • 6. Cache Coherence  Multiple processors with single shared memory.
  • 7. Bus Snooping  Each cache pays attention to memory updates by observing the bus that connects them to main memory.  it will notice the change.  Then it will remove it from its cache or it will update the data.
  • 8. Locking  In this case, allocating a simple mutex (e.g., pthread mutex tm;) and then adding a lock at the beginning of the routine and an unlock at the end will solve the problem, ensuring that the code will execute as desired.
  • 9. Cache Affinity  One process is running on CPU1 and then terminates and wants to run again it will run fast on CPU!.  But if this process will run on diff processor every time then performance of this process will be worse because each time it has to reload state each time.
  • 10. SQMS  Single Queue Multiprocessor Scheduling.  Reuse the basic framework for single processor scheduling, by putting all jobs that need to be scheduled into a single queue.
  • 11. Problems in SQMS  Lack of Scalability  Cache Affinity
  • 12. Overcome to Cache Affinity
  • 13. Multi-Queue Scheduling  Problems caused in single-queue schedulers, some systems opt for multiple queues, e.g., one per CPU.  By using RR system will behave like this
  • 14. MQS Drawback and Solution  What if A and C finishes ealrly?  Solution:  Migration is the only option to overcome this drawback.
  • 15. Linux Multiprocessor Schedulers  O(1) scheduler.  Completely Fair Scheduler (CFS).  BF Scheduler (BFS).  Both O(1) and CFS use multiple queues, whereas BFS uses a single queue,