10
CPU Scheduling - Multicore

CPU Scheduling - Multicore. Reading Silberschatz et al: Chapter 5.5

Embed Size (px)

Citation preview

Page 1: CPU Scheduling - Multicore. Reading Silberschatz et al: Chapter 5.5

CPU Scheduling - Multicore

Page 2: CPU Scheduling - Multicore. Reading Silberschatz et al: Chapter 5.5

Reading

Silberschatz et al: Chapter 5.5

Page 3: CPU Scheduling - Multicore. Reading Silberschatz et al: Chapter 5.5

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

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

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

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

MultiProcessor Scheduling

Challenges Processor affinity Load balancing

Page 8: CPU Scheduling - Multicore. Reading Silberschatz et al: Chapter 5.5

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

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

Summary Reviewed multicore