From: Peter Zijlstra <peterz@infradead.org>
To: Davidlohr Bueso <davidlohr@hp.com>
Cc: linux-kernel@vger.kernel.org, mingo@kernel.org,
dvhart@linux.intel.com, tglx@linutronix.de, efault@gmx.de,
jeffm@suse.com, torvalds@linux-foundation.org,
scott.norton@hp.com, tom.vaden@hp.com, aswin@hp.com,
Waiman.Long@hp.com, jason.low2@hp.com
Subject: Re: [PATCH 5/5] sched,futex: Provide delayed wakeup list
Date: Sat, 23 Nov 2013 12:48:15 +0100 [thread overview]
Message-ID: <20131123114815.GC16796@laptop.programming.kicks-ass.net> (raw)
In-Reply-To: <1385168197-8612-6-git-send-email-davidlohr@hp.com>
On Fri, Nov 22, 2013 at 04:56:37PM -0800, Davidlohr Bueso wrote:
> From: Peter Zijlstra <peterz@infradead.org>
>
> Original patchset: https://lkml.org/lkml/2011/9/14/118
>
> This is useful for locking primitives that can effect multiple
> wakeups per operation and want to avoid lock internal lock contention
> by delaying the wakeups until we've released the lock internal locks.
>
> Alternatively it can be used to avoid issuing multiple wakeups, and
> thus save a few cycles, in packet processing. Queue all target tasks
> and wakeup once you've processed all packets. That way you avoid
> waking the target task multiple times if there were multiple packets
> for the same task.
>
> This patch adds the needed infrastructure into the scheduler code
> and uses the new wake_list to delay the futex wakeups until
> after we've released the hash bucket locks. This avoids the newly
> woken tasks from immediately getting stuck on the hb->lock.
>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Darren Hart <dvhart@linux.intel.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Mike Galbraith <efault@gmx.de>
> Cc: Jeff Mahoney <jeffm@suse.com>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Cc: Scott Norton <scott.norton@hp.com>
> Cc: Tom Vaden <tom.vaden@hp.com>
> Cc: Aswin Chandramouleeswaran <aswin@hp.com>
> Cc: Waiman Long <Waiman.Long@hp.com>
> Tested-by: Jason Low <jason.low2@hp.com>
> [forward ported]
> Signed-off-by: Davidlohr Bueso <davidlohr@hp.com>
> ---
> Please note that in the original thread there was some debate
> about spurious wakeups (https://lkml.org/lkml/2011/9/17/31), so
> you can consider this more of an RFC patch if folks believe that
> this functionality is incomplete/buggy.
Right, from what I remember, this patch can cause spurious wakeups, and
while all our regular sleeping lock / wait thingies can deal with this,
not all creative schedule() usage in the tree can deal with this.
There's about ~1400 (or there were that many 2 years ago, might be more
by now) schedule() calls, many of which are open coded wait constructs
of which most are buggy in one way or another.
So we first need to audit / fix all those before we can do this one.
I used to have a patch to schedule() that would always immediately fall
through and only actually block on the second call; it illustrated the
problem really well, in fact so well the kernels fails to boot most
times.
next prev parent reply other threads:[~2013-11-23 11:48 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-23 0:56 [PATCH 0/5] futex: Wakeup optimizations Davidlohr Bueso
2013-11-23 0:56 ` [PATCH 1/5] futex: Misc cleanups Davidlohr Bueso
2013-11-23 6:52 ` Darren Hart
2013-11-23 0:56 ` [PATCH 2/5] futex: Check for pi futex_q only once Davidlohr Bueso
2013-11-23 6:33 ` Darren Hart
2013-11-24 5:19 ` Davidlohr Bueso
2013-11-23 0:56 ` [PATCH 3/5] futex: Larger hash table Davidlohr Bueso
2013-11-23 6:52 ` Darren Hart
2013-11-23 0:56 ` [PATCH 4/5] futex: Avoid taking hb lock if nothing to wakeup Davidlohr Bueso
2013-11-23 1:25 ` Linus Torvalds
2013-11-23 3:03 ` Jason Low
2013-11-23 3:19 ` Davidlohr Bueso
2013-11-23 7:23 ` Darren Hart
2013-11-23 13:16 ` Thomas Gleixner
2013-11-24 3:46 ` Linus Torvalds
2013-11-24 5:15 ` Davidlohr Bueso
2013-11-25 12:01 ` Thomas Gleixner
2013-11-25 16:23 ` Thomas Gleixner
2013-11-25 16:36 ` Peter Zijlstra
2013-11-25 17:32 ` Thomas Gleixner
2013-11-25 17:38 ` Peter Zijlstra
2013-11-25 18:55 ` Davidlohr Bueso
2013-11-25 19:52 ` Thomas Gleixner
2013-11-25 19:47 ` Thomas Gleixner
2013-11-25 20:03 ` Darren Hart
2013-11-25 20:26 ` Thomas Gleixner
2013-11-26 13:53 ` Thomas Gleixner
2013-11-23 4:05 ` Waiman Long
2013-11-23 5:40 ` Darren Hart
2013-11-23 5:42 ` Hart, Darren
2013-11-23 7:20 ` Darren Hart
2013-11-23 0:56 ` [PATCH 5/5] sched,futex: Provide delayed wakeup list Davidlohr Bueso
2013-11-23 11:48 ` Peter Zijlstra [this message]
2013-11-23 12:01 ` Peter Zijlstra
2013-11-24 5:25 ` Davidlohr Bueso
2013-11-23 5:55 ` [PATCH 0/5] futex: Wakeup optimizations Darren Hart
2013-11-23 6:35 ` Mike Galbraith
2013-11-23 6:38 ` Davidlohr Bueso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131123114815.GC16796@laptop.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=Waiman.Long@hp.com \
--cc=aswin@hp.com \
--cc=davidlohr@hp.com \
--cc=dvhart@linux.intel.com \
--cc=efault@gmx.de \
--cc=jason.low2@hp.com \
--cc=jeffm@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=scott.norton@hp.com \
--cc=tglx@linutronix.de \
--cc=tom.vaden@hp.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox