Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-20 Thread Catalin Marinas
On Mon, Oct 20, 2014 at 04:32:00PM +0100, Linus Torvalds wrote: > On Mon, Oct 20, 2014 at 3:49 AM, Catalin Marinas > wrote: > > Since you mention symmetry, something like below makes the barriers more > > explicit. > > Borken, for two reasons: > > > diff --git a/kernel/futex.c b/kernel/futex.c

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-20 Thread Linus Torvalds
On Mon, Oct 20, 2014 at 3:49 AM, Catalin Marinas wrote: > > Since you mention symmetry, something like below makes the barriers more > explicit. Borken, for two reasons: > diff --git a/kernel/futex.c b/kernel/futex.c > index f3a3a071283c..5b9d857d0816 100644 > --- a/kernel/futex.c > +++

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-20 Thread Catalin Marinas
On Mon, Oct 20, 2014 at 10:11:40AM +0100, Thomas Gleixner wrote: > On Sat, 18 Oct 2014, Davidlohr Bueso wrote: > > On Sat, 2014-10-18 at 13:50 -0700, Linus Torvalds wrote: > > > On Sat, Oct 18, 2014 at 12:58 PM, Davidlohr Bueso > > > wrote: > > > > > > > > And [get/put]_futex_keys() shouldn't

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-20 Thread Catalin Marinas
On Sat, Oct 18, 2014 at 09:19:50PM +0100, Davidlohr Bueso wrote: > On Sat, 2014-10-18 at 14:32 -0500, Darren Hart wrote: > > Which is not incomplete (lacking the explicit smp_mb()) added by this > > patch. Perhaps the MB implementation of get_futex_key_refs() need not be > > explicitly enumerated

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-20 Thread Thomas Gleixner
On Sat, 18 Oct 2014, Davidlohr Bueso wrote: > On Sat, 2014-10-18 at 13:50 -0700, Linus Torvalds wrote: > > On Sat, Oct 18, 2014 at 12:58 PM, Davidlohr Bueso wrote: > > > > > > And [get/put]_futex_keys() shouldn't even be called for private futexes. > > > The following patch had some very minor

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-20 Thread Thomas Gleixner
On Sat, 18 Oct 2014, Davidlohr Bueso wrote: On Sat, 2014-10-18 at 13:50 -0700, Linus Torvalds wrote: On Sat, Oct 18, 2014 at 12:58 PM, Davidlohr Bueso d...@stgolabs.net wrote: And [get/put]_futex_keys() shouldn't even be called for private futexes. The following patch had some very

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-20 Thread Catalin Marinas
On Sat, Oct 18, 2014 at 09:19:50PM +0100, Davidlohr Bueso wrote: On Sat, 2014-10-18 at 14:32 -0500, Darren Hart wrote: Which is not incomplete (lacking the explicit smp_mb()) added by this patch. Perhaps the MB implementation of get_futex_key_refs() need not be explicitly enumerated here?

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-20 Thread Catalin Marinas
On Mon, Oct 20, 2014 at 10:11:40AM +0100, Thomas Gleixner wrote: On Sat, 18 Oct 2014, Davidlohr Bueso wrote: On Sat, 2014-10-18 at 13:50 -0700, Linus Torvalds wrote: On Sat, Oct 18, 2014 at 12:58 PM, Davidlohr Bueso d...@stgolabs.net wrote: And [get/put]_futex_keys() shouldn't

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-20 Thread Linus Torvalds
On Mon, Oct 20, 2014 at 3:49 AM, Catalin Marinas catalin.mari...@arm.com wrote: Since you mention symmetry, something like below makes the barriers more explicit. Borken, for two reasons: diff --git a/kernel/futex.c b/kernel/futex.c index f3a3a071283c..5b9d857d0816 100644 ---

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-20 Thread Catalin Marinas
On Mon, Oct 20, 2014 at 04:32:00PM +0100, Linus Torvalds wrote: On Mon, Oct 20, 2014 at 3:49 AM, Catalin Marinas catalin.mari...@arm.com wrote: Since you mention symmetry, something like below makes the barriers more explicit. Borken, for two reasons: diff --git a/kernel/futex.c

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-18 Thread Davidlohr Bueso
On Sat, 2014-10-18 at 13:50 -0700, Linus Torvalds wrote: > On Sat, Oct 18, 2014 at 12:58 PM, Davidlohr Bueso wrote: > > > > And [get/put]_futex_keys() shouldn't even be called for private futexes. > > The following patch had some very minor testing on a 60 core box last > > night, but passes both

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-18 Thread Darren Hart
On October 18, 2014 3:19:50 PM CDT, Davidlohr Bueso wrote: >On Sat, 2014-10-18 at 14:32 -0500, Darren Hart wrote: >> Which is not incomplete (lacking the explicit smp_mb()) added by this >> patch. Perhaps the MB implementation of get_futex_key_refs() need not >be >> explicitly enumerated here?

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-18 Thread Linus Torvalds
On Sat, Oct 18, 2014 at 12:58 PM, Davidlohr Bueso wrote: > > And [get/put]_futex_keys() shouldn't even be called for private futexes. > The following patch had some very minor testing on a 60 core box last > night, but passes both Darren's and perf's tests. So I *think* this is > right, but lack

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-18 Thread Davidlohr Bueso
On Sat, 2014-10-18 at 14:32 -0500, Darren Hart wrote: > Which is not incomplete (lacking the explicit smp_mb()) added by this > patch. Perhaps the MB implementation of get_futex_key_refs() need not be > explicitly enumerated here? Agreed, how about this: diff --git a/kernel/futex.c

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-18 Thread Davidlohr Bueso
On Sat, 2014-10-18 at 00:33 -0700, Davidlohr Bueso wrote: > On Fri, 2014-10-17 at 17:38 +0100, Catalin Marinas wrote: > > Commit b0c29f79ecea (futexes: Avoid taking the hb->lock if there's > > nothing to wake up) changes the futex code to avoid taking a lock when > > there are no waiters. This

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-18 Thread Darren Hart
On 10/17/14 11:38, Catalin Marinas wrote: > Commit b0c29f79ecea (futexes: Avoid taking the hb->lock if there's > nothing to wake up) changes the futex code to avoid taking a lock when > there are no waiters. This code has been subsequently fixed in commit > 11d4616bd07f (futex: revert back to the

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-18 Thread Mike Galbraith
On Sat, 2014-10-18 at 08:28 -0700, Linus Torvalds wrote: > On Fri, Oct 17, 2014 at 11:54 PM, Mike Galbraith > wrote: > > > > The barrier fixing up my problematic box smells a lot like evidence. > > Is this a "tested-by"? Did you actuallyu verify that the patch ends up > fixing the problem you

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-18 Thread Linus Torvalds
On Fri, Oct 17, 2014 at 11:54 PM, Mike Galbraith wrote: > > The barrier fixing up my problematic box smells a lot like evidence. Is this a "tested-by"? Did you actuallyu verify that the patch ends up fixing the problem you saw? Linus -- To unsubscribe from this list: send the line

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-18 Thread Davidlohr Bueso
On Fri, 2014-10-17 at 17:38 +0100, Catalin Marinas wrote: > Commit b0c29f79ecea (futexes: Avoid taking the hb->lock if there's > nothing to wake up) changes the futex code to avoid taking a lock when > there are no waiters. This code has been subsequently fixed in commit > 11d4616bd07f (futex:

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-18 Thread Mike Galbraith
(fixes Davidlohr bounce) On Sat, 2014-10-18 at 08:54 +0200, Mike Galbraith wrote: > On Fri, 2014-10-17 at 17:38 +0100, Catalin Marinas wrote: > > Commit b0c29f79ecea (futexes: Avoid taking the hb->lock if there's > > nothing to wake up) changes the futex code to avoid taking a lock when > >

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-18 Thread Mike Galbraith
On Fri, 2014-10-17 at 17:38 +0100, Catalin Marinas wrote: > Commit b0c29f79ecea (futexes: Avoid taking the hb->lock if there's > nothing to wake up) changes the futex code to avoid taking a lock when > there are no waiters. This code has been subsequently fixed in commit > 11d4616bd07f (futex:

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-18 Thread Mike Galbraith
On Fri, 2014-10-17 at 17:38 +0100, Catalin Marinas wrote: Commit b0c29f79ecea (futexes: Avoid taking the hb-lock if there's nothing to wake up) changes the futex code to avoid taking a lock when there are no waiters. This code has been subsequently fixed in commit 11d4616bd07f (futex: revert

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-18 Thread Mike Galbraith
(fixes Davidlohr bounce) On Sat, 2014-10-18 at 08:54 +0200, Mike Galbraith wrote: On Fri, 2014-10-17 at 17:38 +0100, Catalin Marinas wrote: Commit b0c29f79ecea (futexes: Avoid taking the hb-lock if there's nothing to wake up) changes the futex code to avoid taking a lock when there are

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-18 Thread Davidlohr Bueso
On Fri, 2014-10-17 at 17:38 +0100, Catalin Marinas wrote: Commit b0c29f79ecea (futexes: Avoid taking the hb-lock if there's nothing to wake up) changes the futex code to avoid taking a lock when there are no waiters. This code has been subsequently fixed in commit 11d4616bd07f (futex: revert

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-18 Thread Linus Torvalds
On Fri, Oct 17, 2014 at 11:54 PM, Mike Galbraith umgwanakikb...@gmail.com wrote: The barrier fixing up my problematic box smells a lot like evidence. Is this a tested-by? Did you actuallyu verify that the patch ends up fixing the problem you saw? Linus -- To unsubscribe from this

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-18 Thread Mike Galbraith
On Sat, 2014-10-18 at 08:28 -0700, Linus Torvalds wrote: On Fri, Oct 17, 2014 at 11:54 PM, Mike Galbraith umgwanakikb...@gmail.com wrote: The barrier fixing up my problematic box smells a lot like evidence. Is this a tested-by? Did you actuallyu verify that the patch ends up fixing the

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-18 Thread Darren Hart
On 10/17/14 11:38, Catalin Marinas wrote: Commit b0c29f79ecea (futexes: Avoid taking the hb-lock if there's nothing to wake up) changes the futex code to avoid taking a lock when there are no waiters. This code has been subsequently fixed in commit 11d4616bd07f (futex: revert back to the

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-18 Thread Davidlohr Bueso
On Sat, 2014-10-18 at 00:33 -0700, Davidlohr Bueso wrote: On Fri, 2014-10-17 at 17:38 +0100, Catalin Marinas wrote: Commit b0c29f79ecea (futexes: Avoid taking the hb-lock if there's nothing to wake up) changes the futex code to avoid taking a lock when there are no waiters. This code has

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-18 Thread Davidlohr Bueso
On Sat, 2014-10-18 at 14:32 -0500, Darren Hart wrote: Which is not incomplete (lacking the explicit smp_mb()) added by this patch. Perhaps the MB implementation of get_futex_key_refs() need not be explicitly enumerated here? Agreed, how about this: diff --git a/kernel/futex.c b/kernel/futex.c

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-18 Thread Linus Torvalds
On Sat, Oct 18, 2014 at 12:58 PM, Davidlohr Bueso d...@stgolabs.net wrote: And [get/put]_futex_keys() shouldn't even be called for private futexes. The following patch had some very minor testing on a 60 core box last night, but passes both Darren's and perf's tests. So I *think* this is

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-18 Thread Darren Hart
On October 18, 2014 3:19:50 PM CDT, Davidlohr Bueso d...@stgolabs.net wrote: On Sat, 2014-10-18 at 14:32 -0500, Darren Hart wrote: Which is not incomplete (lacking the explicit smp_mb()) added by this patch. Perhaps the MB implementation of get_futex_key_refs() need not be explicitly

Re: [PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-18 Thread Davidlohr Bueso
On Sat, 2014-10-18 at 13:50 -0700, Linus Torvalds wrote: On Sat, Oct 18, 2014 at 12:58 PM, Davidlohr Bueso d...@stgolabs.net wrote: And [get/put]_futex_keys() shouldn't even be called for private futexes. The following patch had some very minor testing on a 60 core box last night, but

[PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-17 Thread Catalin Marinas
Commit b0c29f79ecea (futexes: Avoid taking the hb->lock if there's nothing to wake up) changes the futex code to avoid taking a lock when there are no waiters. This code has been subsequently fixed in commit 11d4616bd07f (futex: revert back to the explicit waiter counting code). Both the original

[PATCH] futex: Ensure get_futex_key_refs() always implies a barrier

2014-10-17 Thread Catalin Marinas
Commit b0c29f79ecea (futexes: Avoid taking the hb-lock if there's nothing to wake up) changes the futex code to avoid taking a lock when there are no waiters. This code has been subsequently fixed in commit 11d4616bd07f (futex: revert back to the explicit waiter counting code). Both the original