OLS 2001 coverage
Weekly Edition |
Enhancing the Linux Scheduler
The problems they have identified with the current scheduler are:
The first approach shown was the "Priority Level Scheduler." Here, they have taken the single run queue and split it into multiple lists, each representing a priority level. Since the run queue is now sorted, there is no more need to scan the whole thing. In benchmark runs, this scheduler was shown to perform better when a large number of tasks is running on the system; for lighter loads, it can be worse than what Linux has now. The second approach is the "Multi-Queue Scheduler." This one maintains a single run queue for each processor; it also tracks the best "goodness" value (the scheduling priority, essentially) present on each processor's run queue. When scheduling time happens, only the local processor's run queue is scanned. If the best process there (adjusted with the local CPU bonus) has a higher priority than the best on all the other queues, it can be run without the need to scan any other processor's queue. Otherwise, it may be necessary to examine the queue for one or more processors. There is a separate spinlock for each processor, which decreases lock contention greatly. And, in fact, this scheduler tends to perform far better than both the default Linux scheduler and the priority-level scheduler, especially as the number of processors increases. The numbers are clear, but there is still a lot of skepticism among the kernel developers; not everybody feels that the scheduler needs replacing. In particular, nobody wants to create a situation where 16-processor systems go very fast, but uniprocessor desktop systems are slowed down. Schedulers is still very much an open topic.
More information is available on the Linux Scalability Effort
page.
|
Copyright 2002
Eklektix, Inc. all rights
reserved.
Linux ® is a registered trademark of Linus Torvalds