Messages in this thread | | | Date | Thu, 16 Dec 2010 11:39:47 -0800 | From | Frank Rowand <> | Subject | Re: [RFC][PATCH 0/5] Reduce runqueue lock contention -v2 |
| |
On 12/16/10 11:36, Frank Rowand wrote: > > > patch 1 of 2
The email that explains the context for this does not seem to have gotten through to the list. Here is the email that this patch should have been a reply to:
On 12/16/10 06:56, Peter Zijlstra wrote: > Hi, here a new posting of my scary patch(es) ;-) > > These actually survive a sembench run (and everything else I threw at it). > The discussion between Mike and Frank over the task_running() check made me > realize what was wrong with the previous one. > > As it turns out, what was needed (p->oncpu) was something Thomas wanted me > to do for an entirely different reason (see patch #2). > > Frank's patch, while encouraging me to poke at it again, has a number of > very fundamental problems with it, the most serious one being that it > completely wrecks the wake-up load-balancing.
And also as Peter pointed out when I posted the patch (thank you Peter), I did not properly handle the return value for try_to_wake_up() - a rather fatal flaw.
By coincidence, I was about to post a new version of my scary patch when this email arrived. I'll post my patches as a reply to this email, then read through Peter's.
Frank's patch, Version 2
Changes from Version 1: - Ensure return value of try_to_wake_up() is correct, even when queueing wake up on a different cpu. - rq->lock contention reduction not as good as first version
patch 1
The core changes. All the scary lock related stuff.
select_task_rq() uses the smp_processor_id() of the old task_cpu(p) instead of the waking smp_processor_id().
patch 2
select_task_rq() uses the smp_processor_id() of the waking smp_processor_id()
Limitations x86 only
Tests - tested on 2 cpu x86_64 - very simplistic workload - results: rq->lock contention count reduced by ~ 75% rq->lock contention wait time reduced by ~ 70% test duration reduction is in the noise rq->lock contention improvement is slightly better with just patch 1 applied, but the difference is in the noise
Todo - handle cpu being offlined
-Frank
| |