cpu scheduling - multicore. reading silberschatz et al: chapter 5.5
TRANSCRIPT
![Page 1: CPU Scheduling - Multicore. Reading Silberschatz et al: Chapter 5.5](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0d5503460f94af6e36/html5/thumbnails/1.jpg)
CPU Scheduling - Multicore
![Page 2: CPU Scheduling - Multicore. Reading Silberschatz et al: Chapter 5.5](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0d5503460f94af6e36/html5/thumbnails/2.jpg)
Reading
Silberschatz et al: Chapter 5.5
![Page 3: CPU Scheduling - Multicore. Reading Silberschatz et al: Chapter 5.5](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0d5503460f94af6e36/html5/thumbnails/3.jpg)
Multiple-Processor Scheduling
So far, we’ve only dealt with a single processor
CPU scheduling more complex when multiple CPUs are available due to load sharing.
No single best solutions – no great surprise.
![Page 4: CPU Scheduling - Multicore. Reading Silberschatz et al: Chapter 5.5](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0d5503460f94af6e36/html5/thumbnails/4.jpg)
Multiple-Processor Scheduling
Asymmetric multiprocessing (master) Here there is one processor that makes the
decisions for Scheduling, I/O processing, system
activitiesOther processor(s) execute only user
code.
This is a simple approach because only one processor accesses the system data structures, so sharing is not an issue with other processors.
![Page 5: CPU Scheduling - Multicore. Reading Silberschatz et al: Chapter 5.5](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0d5503460f94af6e36/html5/thumbnails/5.jpg)
Multiple-Processor Scheduling
Symmetric Multiprocessing (SMP)
Here, each processor is self-scheduling.
Share a common ready queue or each processor may have its own private queue of ready processes.
![Page 6: CPU Scheduling - Multicore. Reading Silberschatz et al: Chapter 5.5](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0d5503460f94af6e36/html5/thumbnails/6.jpg)
Multiple-Processor Scheduling
Whether there is a common ready queue or private ready queues, we have a scheduler for each processor that examines the ready queue and dispatches the CPU to a specific process for execution.
Clearly, there are sharing issues, here, since each processor may update this common data structure or try to access a specific PCB in a queue …
Most all modern operating systems support SMP including Windows XP, Solaris, Linux, and Mac OS X.
![Page 7: CPU Scheduling - Multicore. Reading Silberschatz et al: Chapter 5.5](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0d5503460f94af6e36/html5/thumbnails/7.jpg)
MultiProcessor Scheduling
Challenges Processor affinity Load balancing
![Page 8: CPU Scheduling - Multicore. Reading Silberschatz et al: Chapter 5.5](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0d5503460f94af6e36/html5/thumbnails/8.jpg)
Processor Affinity
Processors have a cache What happens to the cache when a
process leaves the running state The contents of cache memory must be
invalidated Why? The next time the process is schedule
it may be scheduled on another processor Try to avoid migration (processor
affinity)
![Page 9: CPU Scheduling - Multicore. Reading Silberschatz et al: Chapter 5.5](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0d5503460f94af6e36/html5/thumbnails/9.jpg)
Load Balancing
Keep the workload balanced among all processors
This is especially a problem in SMP systems
![Page 10: CPU Scheduling - Multicore. Reading Silberschatz et al: Chapter 5.5](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0d5503460f94af6e36/html5/thumbnails/10.jpg)
Summary Reviewed multicore