Tuning The Kernel With A Genetic Algorithm 251
fsck! writes "Jake Moilanen provided a series of four patches against the 2.6.9 Linux kernel that introduce a simple genetic algorithm used for automatic tuning. The patches update the anticipatory IO scheduler and the zaphod CPU scheduler to both use the new in-kernel library, theoretically allowing them to automatically tune themselves for the best possible performance for any given workload. Jake says, 'using these patches, there are small gains (1-3%) in Unixbench & SpecJBB. I am hoping a scheduler guru will able to rework them to give higher gains.'"
Innovation and open source (Score:4, Insightful)
I mean, common. Just look at this. Amazing.
And even if it turns out to be not that good, it was still a good read
Complexity? (Score:5, Insightful)
good luck with that (Score:5, Insightful)
In other words, non-competitive genetic algorithms are only as smart as the fitness function you give them. If your fitness criteria aren't smart enough to cover all the bases, your solutions will have unpredictable deficiencies.
Re:Innovation and open source (Score:1, Insightful)
It's KEWL.
No different than every open source freak over the years proclaiming how 3D desktops were so obviously better than the existing 2D desktops of the day.
And all the while cut/copy/paste still doesn't work properly...
Not worth it... (Score:2, Insightful)
Re:Dear Kernel Coders (Score:3, Insightful)
In other words: if you have someone who's good at writing Genetic Algorithms, but not so good at searching for kernel vulns, why devote that person to security? Why not let them write their contribution, and have the guys who are good at security do their part separately? Why should we only do one thing at once?
Re:Complexity? (Score:3, Insightful)
Re:Not worth it... (Score:5, Insightful)
What is "on the borders of statistical error" depends on how many times the test was run, and how much variation there had been in his results before. I think it's pretty safe to assume that if he knows how to implement a genetic algorithm into the linux kernel, he knows how to handle statistics properly.
The problem: Determining Performance (Score:4, Insightful)
What is the system using to decide if a new parameter set is better than a previous? What is the fitness test?
Some applications are disk-bound, others are CPU-bound, others are network bound. The performance dance is often non-obvious (e.g. some applications will achieve generally higher performance by allowing I/O higher priority than context switching, while others that appear to perform in a similar manner will achive higher performance by reversing that order).
The kernel does not have any mechanism to determine if a particular application is performing better or worse, it can only really get a guage of throughput and load. While this MAY be enough to get small systemwide performance gains, in order to really acheive significant application-specific performance gains, I think that applications would need to explicitly add support for adaptive tuning by logging relevant performance metrics for the kernel to tune around.
Thoughts?
Re:Complexity? (Score:2, Insightful)
IMHO, if GA implementation can be made really reliable it could maybe replace other code which may be (I don't know) even more complicated.
Re:Complexity? (Score:3, Insightful)
GAs aren't rocket science (Score:5, Insightful)
In reality, the basic GA framework is "just" another efficient search algorithm, no cooler or more complex than, say, a hash table or a binary search tree; at its simplest, a GA is a way to find an optimal configuration of components without looking at all possible (potentially explosively exponential) combinations; instead, you look at just some permutations, and as you iterate through generations, applying breeding and mutation, you arrive at a generation which is statistically close to optimal.
GAs are also in no way new or unproven technology; a nice example of mainstream use is PostgreSQL [postgresql.org]'s query planner, which uses GAs to optimize query plans.
Re:Complexity? (Score:2, Insightful)
Re:not a panacea (Score:2, Insightful)
Mutation helps with convergence issues.
Sure the only way is to exhaustively search the "chromosome" space for every possibile combination, and computers are good at brute force!
Um, I don't even know how many parameters are involved to be adjusted, but it does not take that many to make exhaustive search useless, even for a computer.
Re:GA + Hill Climbing... (Score:5, Insightful)
If you have the resources to exhastively search the space... you don't need a GA.
A GA is generally used when the search space is hopelessly huge and you need to chart a course from A to(wards) B but you don't know the way.
And in finding this solution, which is "grown", not engineered, it's much easier for unintended wierdnesses to creep in. A GA might solve problem X by ruining performance on problem Y, something that you, as a software engineer, would never even consider viable, and hence you forgot to force the fitness function to check problem Y along with problem X.
Re:Innovation and open source (Score:4, Insightful)
Re:Not worth it... (Score:3, Insightful)
Re:GA + Hill Climbing... (Score:3, Insightful)
Writing a GA is simple. Writing a GA that delivers results, now that is a different beast alltogether. My experience has shown me that there are some rather more complicated things that need to be taken into account such as: