Re: [RFC][PATCH 0/5] Reduce runqueue lock contention -v2

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Frank Rowand
Date: Thursday, December 16, 2010 - 12:39 pm

On 12/16/10 11:36, Frank Rowand wrote:

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:

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
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC][PATCH 0/5] Reduce runqueue lock contention -v2, Peter Zijlstra, (Thu Dec 16, 7:56 am)
[RFC][PATCH 1/5] sched: Always provide p->oncpu, Peter Zijlstra, (Thu Dec 16, 7:56 am)
[RFC][PATCH 3/5] sched: Change the ttwu success details, Peter Zijlstra, (Thu Dec 16, 7:56 am)
[RFC][PATCH 4/5] sched: Clean up ttwu stats, Peter Zijlstra, (Thu Dec 16, 7:56 am)
[RFC][PATCH 5/5] sched: Reduce ttwu rq->lock contention, Peter Zijlstra, (Thu Dec 16, 7:56 am)
Re: [RFC][PATCH 3/5] sched: Change the ttwu success details, Frederic Weisbecker, (Thu Dec 16, 8:23 am)
Re: [RFC][PATCH 5/5] sched: Reduce ttwu rq->lock contention, Frederic Weisbecker, (Thu Dec 16, 8:31 am)
Re: [RFC][PATCH 3/5] sched: Change the ttwu success details, Frederic Weisbecker, (Thu Dec 16, 8:35 am)
Re: [RFC][PATCH 3/5] sched: Change the ttwu success details, Frederic Weisbecker, (Thu Dec 16, 8:45 am)
Re: [RFC][PATCH 0/5] Reduce runqueue lock contention -v2, Frank Rowand, (Thu Dec 16, 12:12 pm)
Re: [RFC][PATCH 0/5] Reduce runqueue lock contention -v2, Frank Rowand, (Thu Dec 16, 12:36 pm)
Re: [RFC][PATCH 0/5] Reduce runqueue lock contention -v2, Frank Rowand, (Thu Dec 16, 12:36 pm)
Re: [RFC][PATCH 0/5] Reduce runqueue lock contention -v2, Frank Rowand, (Thu Dec 16, 12:39 pm)
Re: [RFC][PATCH 0/5] Reduce runqueue lock contention -v2, Peter Zijlstra, (Thu Dec 16, 12:42 pm)
Re: [RFC][PATCH 1/5] sched: Always provide p->oncpu, Frank Rowand, (Fri Dec 17, 6:03 pm)
Re: [RFC][PATCH 4/5] sched: Clean up ttwu stats, Frank Rowand, (Fri Dec 17, 6:09 pm)