1 / 14

Multiprocessor Scheduling (Advanced)

Multiprocessor Scheduling (Advanced). Sangchul Kim (stdio@snu.ac.kr) School of Computer Science and Engineering Seoul National University. Outline. Introduction Background Issues of the multiprocessor system Multiprocessor Scheduling Linux Multiprocessor Schedulers Summary. Introduction.

rueter
Download Presentation

Multiprocessor Scheduling (Advanced)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Multiprocessor Scheduling (Advanced) Sangchul Kim (stdio@snu.ac.kr) School of Computer Science and Engineering Seoul National University

  2. Outline Introduction Background Issues of the multiprocessor system Multiprocessor Scheduling Linux Multiprocessor Schedulers Summary

  3. Introduction core core core core • Multiprocessor systems are increasingly common place. • Multiple CPU cores are packed onto a single chip. • The rise of the multicore processor is the source of the proliferation. • Thereare many difficulties. • A typical application only uses a single CPU. • Multiprocessor scheduling. • The center of the multiprocessor system is the use of hardware cache.

  4. Background CPU Cache RAM Memory Main Storage • Properties of Cache • Small and fast memories that hold copies of popular data. • To help the processor run programs faster. • Strategies of Cache • Temporal locality • It is likely to be accessed again in the near future. • e.g. loop. • Spatial locality • It is likely to access data items near the currently accessed the items. • e.g. array.

  5. Issues of the multiprocessor system CPU CPU Memory Cache Cache A A’ A A bus • Problem • Cache coherence • Multiprocessors with a shared single main memory. • Solution • Bus snooping • Either invalidate or update the data item.

  6. Issues of the multiprocessor system (cont’) thread1 thread2 Problem thread1 thread2 • Example: Simple List Delete Code • Problem • Correctness • Shared queue being accessed on multiple CPUs concurrently. • Adding or removing elements from the queue concurrently will not work as expected. • Solution • Mutual exclusion (locking)

  7. Issues of the multiprocessor system (cont’) CPU CPU Px Px TLBx Memory Cache Cache DataX bus • Cache Affinity • Keep a process on the same CPU if at all possible.

  8. Multiprocessor Scheduling A B C D E Queue NULL CPU: CPU: migration • Single queue multiprocessor scheduling (SQMS) • Simply reuse the basic framework for single processor scheduling. • Advantage: simplicity. • Disadvantage : scalability and cache affinity. • To ensure the correctness, locking is used. • Implementing the migration scheme, it can be complex.

  9. Multiprocessor Scheduling (cont’) A C B D Queue2 Queue1 CPU: • Multi-queue multiprocessor scheduling (MQMS) • The basic scheduling framework consists of multiple scheduling queues. • Each queue will likely follow a particular scheduling discipline. • Advantage: more scalable, cache affinity. • Disadvantage: load imbalance.

  10. Multiprocessor Scheduling (cont’) A B D Queue2 Queue1 CPU: B D Queue2 Queue1 CPU: • Multi-queue multiprocessor scheduling (MQMS) • C finishes. • A and C finish.

  11. Multiprocessor Scheduling (cont’) B D A Queue2 Queue1 CPU: B D Queue2 Queue1 CPU: • Multi-queue multiprocessor scheduling (MQMS) • Solution: migration

  12. Multiprocessor Scheduling (cont’) Source: http://www.tanveernaseer.com/how-to-manage-a-co-worker-who-takes-credit-for-your-work (Retrieved on 2015 / 04 / 28) • Multi-queue multiprocessor scheduling (MQMS) • Solution: migration • Work stealing • A source queue that is low on jobs • Cccasionally peek at another target queue. • If the target queue is more full than the source queue • The source will stealjobs. • If it looks around at other queues too often • It would suffer from high overhead. • If it doesn’t look around at other queues very often • It would suffer from load imbalances.

  13. Linux Multiprocessor Schedulers • No common solutions are there. • Over time, three different schedulers arose: • O(1) scheduler • Completely Fair Scheduler (CFS) • BF Scheduler (BFS)

  14. Summary • Issues of the multiprocessor • Cache coherence • Synchronization • Cache affinity • Multiprocessor scheduling • Single-queue approach (SQMS) • Multiple-queue approach (MQMS)

More Related