Well, this is quite interesting. This is one of those items where I have to make sure everybody realises I’m no developer as to not make myself look like an idiot. Having said that – LinSched. It’s a user-space program that hosts the Linux kernel scheduler, so you can create and test scheduling policies on arbitrary hardware topologies – without actually having to work with the real hardware.
Originally developed at the University of North Carolina, it is being used by Google to test scheduler policies. “At Google we have used Linsched as a testing tool to validate the behavior of the kernel scheduler,” details Google’s Ranjit Manomohan, “We could cut down our validation time from several days to a couple of hours due to the ability to run multiple tests on several different types of hardware models.”
This has already led to several improvements in the kernel scheduler, thanks to the high fegree of code sharing between LinSched and the ‘real’ scheduler. “Due to the high degree of code sharing between LinSched and the Linux scheduler, porting LinSched code to Linux is reasonably straightforward,” Manomohan explains, “LinSched may be especially useful to those who are new to Linux scheduler development.”
“Since Linsched allows arbitrary hardware topologies to be modeled, it enables testing of scheduler changes on hardware that may not be easily accessible to the developer,” he adds, “For example, most developers don’t have access to a quad-core quad-socket box, but they can use LinSched to see how their changes affect the scheduler on such boxes.”
The code is out there.
This is definitely something to check out if you are interested in making a new Linux scheduler.
You could be the next Con Kolivas!
There is a book I have that dissects the 2.4 kernel. The section about the kernel has some commentary to the effect “This section is well optimized, do not bother trying to make any improvements here its a waste of your time”.
Then Con came and I was a little miffed at first that I took the book’s advise and didn’t play with it more. Then Linus replied, and I was sort of glad I didn’t. But hey, getting personally slammed by Linus would be an email to pass down to the generations. So, I think I will mess with it.