Re: [RESEND PATCH] documentation: memory-barriers: fix smp_mb__before_spinlock() semantics

2015-04-01 Thread Paul E. McKenney
e that this sequence orders only prior > stores against subsequent loads and stores. > > Cc: Oleg Nesterov > Cc: "Paul E. McKenney" > Cc: Peter Zijlstra > Signed-off-by: Will Deacon > --- > > Could somebody pick this up please? I guess I could route it

[PATCH tip/core/rcu 09/15] powerpc: Fix smp_mb__before_spinlock()

2015-05-12 Thread Paul E. McKenney
From: "Paul E. McKenney" Currently, smp_mb__before_spinlock() is defined to be smp_wmb() in core code, but this is not sufficient on PowerPC. This patch therefore supplies an override for the generic definition to strengthen smp_mb__before_spinlock() to smp_mb(), as is needed

Re: bit fields && data tearing

2014-09-04 Thread Paul E. McKenney
on algorithms. Signed-off-by: Paul E. McKenney diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt index 87be0a8a78de..a28bfe4fd759 100644 --- a/Documentation/memory-barriers.txt +++ b/Documentation/memory-barriers.txt @@ -269,6 +269,26 @@ And there are a number

Re: bit fields && data tearing

2014-09-04 Thread Paul E. McKenney
On Thu, Sep 04, 2014 at 10:47:24PM -0400, Peter Hurley wrote: > Hi James, > > On 09/04/2014 10:11 PM, James Bottomley wrote: > > On Thu, 2014-09-04 at 17:17 -0700, Paul E. McKenney wrote: > >> +And there are anti-guarantees: > >> + > >> + (*) These gua

Re: bit fields && data tearing

2014-09-05 Thread Paul E. McKenney
r to be supported by the Linux kernel. (Michael Cree has agreed to the resulting non-support of pre-EV56 Alpha CPUs: https://lkml.org/lkml/2014/9/5/143. Signed-off-by: Paul E. McKenney diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt index 87be0a8a78de..455df6b298f7

Re: bit fields && data tearing

2014-09-05 Thread Paul E. McKenney
On Fri, Sep 05, 2014 at 11:09:50AM -0700, Paul E. McKenney wrote: > On Fri, Sep 05, 2014 at 08:16:48PM +1200, Michael Cree wrote: > > On Thu, Sep 04, 2014 at 07:08:48PM -0700, H. Peter Anvin wrote: > > > On 09/04/2014 05:59 PM, Peter Hurley wrote: > > > > I have no

Re: bit fields && data tearing

2014-09-05 Thread Paul E. McKenney
On Fri, Sep 05, 2014 at 02:50:31PM -0400, Peter Hurley wrote: > On 09/05/2014 02:09 PM, Paul E. McKenney wrote: > > On Fri, Sep 05, 2014 at 08:16:48PM +1200, Michael Cree wrote: > >> On Thu, Sep 04, 2014 at 07:08:48PM -0700, H. Peter Anvin wrote: > >>> On 09/04/201

Re: bit fields && data tearing

2014-09-05 Thread Paul E. McKenney
On Fri, Sep 05, 2014 at 03:24:35PM -0400, Peter Hurley wrote: > On 09/05/2014 03:05 PM, Paul E. McKenney wrote: > > On Fri, Sep 05, 2014 at 02:50:31PM -0400, Peter Hurley wrote: > >> On 09/05/2014 02:09 PM, Paul E. McKenne

Re: bit fields && data tearing

2014-09-05 Thread Paul E. McKenney
On Fri, Sep 05, 2014 at 04:01:35PM -0400, Peter Hurley wrote: > On 09/05/2014 03:52 PM, Peter Zijlstra wrote: > > On Fri, Sep 05, 2014 at 11:31:09AM -0700, Paul E. McKenney wrote: > >> compiler: Allow 1- and 2-byte smp_load_acquire() and smp_store_release() > >> > &

Re: bit fields && data tearing

2014-09-05 Thread Paul E. McKenney
On Fri, Sep 05, 2014 at 04:14:48PM -0400, Peter Hurley wrote: > On 09/05/2014 03:38 PM, Marc Gauthier wrote: > > Paul E. McKenney wrote: > >> On Fri, Sep 05, 2014 at 02:50:31PM -0400, Peter Hurley wrote: > >>> On 09/05/2014 02:09 PM, Paul E. McKenney wrote: > &g

Re: bit fields && data tearing

2014-09-05 Thread Paul E. McKenney
On Fri, Sep 05, 2014 at 01:34:52PM -0700, H. Peter Anvin wrote: > On 09/05/2014 01:14 PM, Peter Hurley wrote: > > > > Here's how I read the two statements. > > > > First, the commit message: > > > > "It [this commit] documents that CPUs [supported by the Linux kernel] > > _must provide_ atomic o

Re: bit fields && data tearing

2014-09-05 Thread Paul E. McKenney
On Fri, Sep 05, 2014 at 10:48:34PM +0200, Thomas Gleixner wrote: > On Fri, 5 Sep 2014, Paul E. McKenney wrote: > > On Fri, Sep 05, 2014 at 01:34:52PM -0700, H. Peter Anvin wrote: > > > On 09/05/2014 01:14 PM, Peter Hurley wrote: > > > > > > >

Re: bit fields && data tearing

2014-09-07 Thread Paul E. McKenney
On Sat, Sep 06, 2014 at 10:07:22PM -0700, James Bottomley wrote: > On Thu, 2014-09-04 at 21:06 -0700, Paul E. McKenney wrote: > > On Thu, Sep 04, 2014 at 10:47:24PM -0400, Peter Hurley wrote: > > > Hi James, > > > > > > On 09/04/2014 10:11 PM, James Bottomley

Re: bit fields && data tearing

2014-09-07 Thread Paul E. McKenney
On Sun, Sep 07, 2014 at 12:04:47PM -0700, James Bottomley wrote: > On Sun, 2014-09-07 at 09:21 -0700, Paul E. McKenney wrote: > > On Sat, Sep 06, 2014 at 10:07:22PM -0700, James Bottomley wrote: > > > On Thu, 2014-09-04 at 21:06 -0700, Paul E. McKenney wrote: > > > >

Re: bit fields && data tearing

2014-09-07 Thread Paul E. McKenney
systems don't provide atomicity for partially overlapping stores. ;-) Thanx, Paul > On September 7, 2014 4:00:19 PM PDT, "Paul E. McKenney" > wrote: > >On Sun, Sep 07, 2014 at 12:04:47PM -0700, James Bottomley wrot

Re: bit fields && data tearing

2014-09-08 Thread Paul E. McKenney
On Mon, Sep 08, 2014 at 06:47:35PM -0400, Peter Hurley wrote: > On 09/08/2014 01:59 PM, H. Peter Anvin wrote: > > On 09/08/2014 10:52 AM, One Thousand Gnomes wrote: > >> On Fri, 05 Sep 2014 08:41:52 -0700 > >> "H. Peter Anvin" wrote: > >> > >>> On 09/05/2014 08:31 AM, Peter Hurley wrote: > >

Re: bit fields && data tearing

2014-09-11 Thread Paul E. McKenney
On Thu, Sep 11, 2014 at 11:04:11AM +0100, One Thousand Gnomes wrote: > > > Is *that* what we are talking about? I was added to this conversation > > > in the middle where it had already generalized, so I had no idea. > > > > No, this is just what brought this craziness to my attention. > > None

Re: bit fields && data tearing

2014-09-22 Thread Paul E. McKenney
On Mon, Sep 15, 2014 at 12:24:27AM +0100, One Thousand Gnomes wrote: > > So a problem that no one has ever complained about on _any_ arch is suddenly > > a problem on a subset of Alpha cpus, but a problem I know exists on Alpha > > isn't important because no one's filed a bug about it? > > Yes - b

Re: [PATCH] powerpc: mitigate impact of decrementer reset

2014-11-17 Thread Paul E. McKenney
On Thu, Nov 13, 2014 at 01:42:12PM +1100, Michael Ellerman wrote: > On Mon, 2014-11-10 at 14:58 -0600, Paul Clarke wrote: > > On 11/10/2014 04:08 AM, Benjamin Herrenschmidt wrote: > > > On Tue, 2014-10-07 at 14:13 -0500, Paul Clarke wrote: > > >> This patch short-circuits the reset of the decrement

Re: [PATCH] powerpc: mitigate impact of decrementer reset

2014-11-17 Thread Paul E. McKenney
On Tue, Nov 18, 2014 at 12:46:56PM +1100, Michael Ellerman wrote: > On Mon, 2014-11-17 at 11:18 -0800, Paul E. McKenney wrote: > > On Thu, Nov 13, 2014 at 01:42:12PM +1100, Michael Ellerman wrote: > > > On Mon, 2014-11-10 at 14:58 -0600, Paul Clarke wrote: > > > > On

Re: [PATCH v2] srcu: Isolate srcu sections using CONFIG_SRCU

2014-12-31 Thread Paul E. McKenney
On Tue, Dec 30, 2014 at 08:07:40PM +0100, Peter Zijlstra wrote: > On Tue, Dec 30, 2014 at 01:54:07PM -0500, Pranith Kumar wrote: > > On Tue, Dec 30, 2014 at 1:50 PM, Peter Zijlstra > > wrote: > > > On Tue, Dec 30, 2014 at 12:46:22AM -0500, Pranith Kumar wrote: > > >> Isolate the SRCU functions an

Re: [PATCH v2] srcu: Isolate srcu sections using CONFIG_SRCU

2015-01-04 Thread Paul E. McKenney
On Sun, Jan 04, 2015 at 08:35:52PM +1100, Michael Ellerman wrote: > On Tue, 2014-12-30 at 13:54 -0500, Pranith Kumar wrote: > > On Tue, Dec 30, 2014 at 1:50 PM, Peter Zijlstra > > wrote: > > > On Tue, Dec 30, 2014 at 12:46:22AM -0500, Pranith Kumar wrote: > > >> Isolate the SRCU functions and dat

Re: Regression in RCU subsystem in latest mainline kernel

2013-06-14 Thread Paul E. McKenney
On Fri, Jun 14, 2013 at 10:31:12PM -0400, Steven Rostedt wrote: > On Sat, 2013-06-15 at 12:21 +1000, Benjamin Herrenschmidt wrote: > > On Fri, 2013-06-14 at 22:17 -0400, Steven Rostedt wrote: > > > On Sat, 2013-06-15 at 12:02 +1000, Benjamin Herrenschmidt wrote: > > > > On Fri, 2013-06-14 at 17:06

Re: Regression in RCU subsystem in latest mainline kernel

2013-06-18 Thread Paul E. McKenney
On Mon, Jun 17, 2013 at 05:42:13PM +1000, Michael Ellerman wrote: > On Sat, Jun 15, 2013 at 12:02:21PM +1000, Benjamin Herrenschmidt wrote: > > On Fri, 2013-06-14 at 17:06 -0400, Steven Rostedt wrote: > > > I was pretty much able to reproduce this on my PA Semi PPC box. Funny > > > thing is, when I

Re: Regression in RCU subsystem in latest mainline kernel

2013-06-25 Thread Paul E. McKenney
On Tue, Jun 25, 2013 at 05:44:23PM +1000, Michael Ellerman wrote: > On Tue, Jun 25, 2013 at 05:19:14PM +1000, Michael Ellerman wrote: > > > > Here's another trace from 3.10-rc7 plus a few local patches. > > And here's another with CONFIG_RCU_CPU_STALL_INFO=y in case that's useful: > > PASS runni

Re: [PATCH v2 15/45] rcu: Use get/put_online_cpus_atomic() to prevent CPU offline

2013-06-25 Thread Paul E. McKenney
line, and so on. Thoughts? Thanx, Paul > Cc: Dipankar Sarma > Cc: "Paul E. McKenney" > Signed-off-by: Srivatsa S. Bhat > --- > > kernel/rcutree.c |4 > 1 file changed, 4 insertions(+) > > diff --git a/kernel/rcutree.c b/kernel/rcutree.c &

Re: Regression in RCU subsystem in latest mainline kernel

2013-06-26 Thread Paul E. McKenney
On Wed, Jun 26, 2013 at 06:10:58PM +1000, Michael Ellerman wrote: > On Tue, Jun 25, 2013 at 09:03:32AM -0700, Paul E. McKenney wrote: > > On Tue, Jun 25, 2013 at 05:44:23PM +1000, Michael Ellerman wrote: > > > On Tue, Jun 25, 2013 at 05:19:14PM +1000, Mich

Re: [PATCH v2 15/45] rcu: Use get/put_online_cpus_atomic() to prevent CPU offline

2013-06-26 Thread Paul E. McKenney
On Wed, Jun 26, 2013 at 03:29:40PM +0100, David Laight wrote: > > Once stop_machine() is gone from the CPU offline path, we won't be able > > to depend on disabling preemption to prevent CPUs from going offline > > from under us. > > Could you use an rcu-like sequence so that disabling pre-emption

Re: [PATCH v2 15/45] rcu: Use get/put_online_cpus_atomic() to prevent CPU offline

2013-06-26 Thread Paul E. McKenney
On Wed, Jun 26, 2013 at 07:39:40PM +0530, Srivatsa S. Bhat wrote: > On 06/26/2013 03:30 AM, Paul E. McKenney wrote: > > On Wed, Jun 26, 2013 at 01:57:55AM +0530, Srivatsa S. Bhat wrote: > >> Once stop_machine() is gone from the CPU offline path, we won't be able >

Re: [PATCH v2 15/45] rcu: Use get/put_online_cpus_atomic() to prevent CPU offline

2013-06-26 Thread Paul E. McKenney
On Wed, Jun 26, 2013 at 03:29:40PM +0100, David Laight wrote: > > Once stop_machine() is gone from the CPU offline path, we won't be able > > to depend on disabling preemption to prevent CPUs from going offline > > from under us. > > Could you use an rcu-like sequence so that disabling pre-emption

Re: [PATCH v3 16/45] rcu: Use cpu_is_offline_nocheck() to avoid false-positive warnings

2013-06-27 Thread Paul E. McKenney
check() variants of the cpu accessor functions to prevent false- > positive warnings from the CPU hotplug debug code. Also, add a comment > explaining the hotplug synchronization design used in RCU, so that its easy > to see why it is justified to use the _nocheck() variants. > > C

Re: Avoiding the dentry d_lock on final dput(), part deux: transactional memory

2013-09-30 Thread Paul E. McKenney
On Tue, Oct 01, 2013 at 12:05:03PM +1000, Benjamin Herrenschmidt wrote: > On Mon, 2013-09-30 at 17:56 -0700, Linus Torvalds wrote: > > On Mon, Sep 30, 2013 at 5:36 PM, Michael Neuling wrote: > > > > > > The scary part is that we to make all register volatile. You were not > > > that keen on doing

Re: Avoiding the dentry d_lock on final dput(), part deux: transactional memory

2013-10-01 Thread Paul E. McKenney
On Tue, Oct 01, 2013 at 02:52:28PM +1000, Michael Neuling wrote: > >> Well we don't have to, I think Mikey wasn't totally clear about that > >> "making all registers volatile" business :-) This is just something we > >> need to handle in assembly if we are going to reclaim the suspended > >> transa

Re: Avoiding the dentry d_lock on final dput(), part deux: transactional memory

2013-10-01 Thread Paul E. McKenney
On Tue, Oct 01, 2013 at 05:16:54AM -0700, Paul E. McKenney wrote: > On Tue, Oct 01, 2013 at 02:52:28PM +1000, Michael Neuling wrote: > > >> Well we don't have to, I think Mikey wasn't totally clear about that > > >> "making all registers volatile" bus

Re: perf events ring buffer memory barrier on powerpc

2013-10-28 Thread Paul E. McKenney
On Mon, Oct 28, 2013 at 02:26:34PM +0100, Peter Zijlstra wrote: > On Mon, Oct 28, 2013 at 02:38:29PM +0200, Victor Kaplansky wrote: > > > 2013/10/25 Peter Zijlstra : > > > > On Wed, Oct 23, 2013 at 03:19:51PM +0100, Frederic Weisbecker wrote: > > > > I would argue for > > > > > > > > READ ->data_

Re: perf events ring buffer memory barrier on powerpc

2013-10-30 Thread Paul E. McKenney
On Mon, Oct 28, 2013 at 10:58:58PM +0200, Victor Kaplansky wrote: > Oleg Nesterov wrote on 10/28/2013 10:17:35 PM: > > > mb(); // : do we really need it? I think yes. > > Oh, it is hard to argue with feelings. Also, it is easy to be on > conservative side and put the barrier here

Re: perf events ring buffer memory barrier on powerpc

2013-10-30 Thread Paul E. McKenney
On Wed, Oct 30, 2013 at 04:51:16PM +0100, Peter Zijlstra wrote: > On Wed, Oct 30, 2013 at 03:28:54PM +0200, Victor Kaplansky wrote: > > one of the authors of Documentation/memory-barriers.txt is on cc: list ;-) > > > > Disclaimer: it is anyway impossible to prove lack of *any* problem. > > > > Ha

Re: perf events ring buffer memory barrier on powerpc

2013-10-30 Thread Paul E. McKenney
On Wed, Oct 30, 2013 at 03:28:54PM +0200, Victor Kaplansky wrote: > "Paul E. McKenney" wrote on 10/30/2013 > 11:27:25 AM: > > > If you were to back up that insistence with a description of the > orderings > > you are relying on, why other orderings are not im

Re: perf events ring buffer memory barrier on powerpc

2013-10-31 Thread Paul E. McKenney
On Thu, Oct 31, 2013 at 10:04:57AM +0100, Peter Zijlstra wrote: > On Wed, Oct 30, 2013 at 09:32:58PM -0700, Paul E. McKenney wrote: > > Before C/C++11, the closest thing to such a prohibition is use of > > volatile, for example, ACCESS_ONCE(). Even in C/C++11, you have to > &g

Re: perf events ring buffer memory barrier on powerpc

2013-11-01 Thread Paul E. McKenney
On Thu, Oct 31, 2013 at 04:19:55PM +0100, Peter Zijlstra wrote: > On Thu, Oct 31, 2013 at 08:07:56AM -0700, Paul E. McKenney wrote: > > On Thu, Oct 31, 2013 at 10:04:57AM +0100, Peter Zijlstra wrote: > > > On Wed, Oct 30, 2013 at 09:32:58PM -0700, Paul E. McKenney wrote: >

Re: perf events ring buffer memory barrier on powerpc

2013-11-01 Thread Paul E. McKenney
On Thu, Oct 31, 2013 at 11:59:21AM +0200, Victor Kaplansky wrote: > "Paul E. McKenney" wrote on 10/31/2013 > 06:32:58 AM: > > > If you want to play the "omit memory barriers" game, then proving a > > negative is in fact the task before you. > > Ge

Re: perf events ring buffer memory barrier on powerpc

2013-11-01 Thread Paul E. McKenney
On Wed, Oct 30, 2013 at 12:25:26PM +0100, Peter Zijlstra wrote: > On Wed, Oct 30, 2013 at 02:27:25AM -0700, Paul E. McKenney wrote: > > On Mon, Oct 28, 2013 at 10:58:58PM +0200, Victor Kaplansky wrote: > > > Oleg Nesterov wrote on 10/28/2013 10:17:35 PM: > > > > &

Re: perf events ring buffer memory barrier on powerpc

2013-11-01 Thread Paul E. McKenney
On Wed, Oct 30, 2013 at 04:52:05PM +0200, Victor Kaplansky wrote: > Peter Zijlstra wrote on 10/30/2013 01:25:26 PM: > > > Also, I'm not entirely sure on C, that too seems like a dependency, we > > simply cannot read the buffer @tail before we've read the tail itself, > > now can we? Similarly we

Re: perf events ring buffer memory barrier on powerpc

2013-11-02 Thread Paul E. McKenney
On Fri, Nov 01, 2013 at 05:11:29PM +0100, Peter Zijlstra wrote: > On Wed, Oct 30, 2013 at 11:40:15PM -0700, Paul E. McKenney wrote: > > > void kbuf_write(int sz, void *buf) > > > { > > > u64 tail = ACCESS_ONCE(ubuf->tail); /* last location userspace read */ >

Re: perf events ring buffer memory barrier on powerpc

2013-11-02 Thread Paul E. McKenney
On Fri, Nov 01, 2013 at 04:25:42PM +0200, Victor Kaplansky wrote: > "Paul E. McKenney" wrote on 10/31/2013 > 08:40:15 AM: > > > > void ubuf_read(void) > > > { > > >u64 head, tail; > > > > > >tail =

Re: perf events ring buffer memory barrier on powerpc

2013-11-02 Thread Paul E. McKenney
On Fri, Nov 01, 2013 at 03:12:58PM +0200, Victor Kaplansky wrote: > "Paul E. McKenney" wrote on 10/31/2013 > 08:16:02 AM: > > > > BTW, it is why you also don't need ACCESS_ONCE() around @tail, but only > > > around > > > @head read. > >

Re: perf events ring buffer memory barrier on powerpc

2013-11-02 Thread Paul E. McKenney
On Fri, Nov 01, 2013 at 11:30:17AM +0100, Peter Zijlstra wrote: > On Fri, Nov 01, 2013 at 02:28:14AM -0700, Paul E. McKenney wrote: > > > This is a completely untenable position. > > > > Indeed it is! > > > > C/C++ never was intended to be used for parallel pr

Re: perf events ring buffer memory barrier on powerpc

2013-11-02 Thread Paul E. McKenney
On Fri, Nov 01, 2013 at 06:06:58PM +0200, Victor Kaplansky wrote: > "Paul E. McKenney" wrote on 10/31/2013 > 05:25:43 PM: > > > I really don't care about "fair" -- I care instead about the kernel > > working reliably. > > Though I

Re: perf events ring buffer memory barrier on powerpc

2013-11-02 Thread Paul E. McKenney
[ Adding David Howells, Lech Fomicki, and Mark Batty on CC for their thoughts given previous discussions. ] On Sat, Nov 02, 2013 at 09:36:18AM -0700, Paul E. McKenney wrote: > On Fri, Nov 01, 2013 at 03:12:58PM +0200, Victor Kaplansky wrote: > > "Paul E. McKenney" wrote on 1

Re: perf events ring buffer memory barrier on powerpc

2013-11-02 Thread Paul E. McKenney
On Fri, Nov 01, 2013 at 05:18:19PM +0100, Peter Zijlstra wrote: > On Wed, Oct 30, 2013 at 11:40:15PM -0700, Paul E. McKenney wrote: > > The dependency you are talking about is via the "if" statement? > > Even C/C++11 is not required to respect control dependencies. &

Re: perf events ring buffer memory barrier on powerpc

2013-11-02 Thread Paul E. McKenney
On Fri, Nov 01, 2013 at 03:56:34PM +0100, Peter Zijlstra wrote: > On Wed, Oct 30, 2013 at 11:40:15PM -0700, Paul E. McKenney wrote: > > > Now the whole crux of the question is if we need barrier A at all, since > > > the STORES issued by the @buf writes are dependent on the

Re: perf events ring buffer memory barrier on powerpc

2013-11-03 Thread Paul E. McKenney
On Sat, Nov 02, 2013 at 10:32:39AM -0700, Paul E. McKenney wrote: > On Fri, Nov 01, 2013 at 03:56:34PM +0100, Peter Zijlstra wrote: > > On Wed, Oct 30, 2013 at 11:40:15PM -0700, Paul E. McKenney wrote: > > > > Now the whole crux of the question is if we need barrier A at a

Re: [RFC] arch: Introduce new TSO memory barrier smp_tmb()

2013-11-03 Thread Paul E. McKenney
On Sun, Nov 03, 2013 at 09:01:24PM +0100, Peter Zijlstra wrote: > On Sun, Nov 03, 2013 at 10:08:14AM -0800, Linus Torvalds wrote: > > On Sun, Nov 3, 2013 at 7:17 AM, Peter Zijlstra wrote: > > > On Sun, Nov 03, 2013 at 06:40:17AM -0800, Paul E. McKenney wrote: > > >>

Re: [RFC] arch: Introduce new TSO memory barrier smp_tmb()

2013-11-03 Thread Paul E. McKenney
On Mon, Nov 04, 2013 at 07:59:23AM +1100, Benjamin Herrenschmidt wrote: > On Sun, 2013-11-03 at 16:17 +0100, Peter Zijlstra wrote: > > On Sun, Nov 03, 2013 at 06:40:17AM -0800, Paul E. McKenney wrote: > > > If there was an smp_tmb(), I would likely use it in rcu_assign_pointe

Re: perf events ring buffer memory barrier on powerpc

2013-11-04 Thread Paul E. McKenney
On Mon, Nov 04, 2013 at 10:07:44AM +0100, Peter Zijlstra wrote: > On Sat, Nov 02, 2013 at 08:20:48AM -0700, Paul E. McKenney wrote: > > On Fri, Nov 01, 2013 at 11:30:17AM +0100, Peter Zijlstra wrote: > > > Furthermore there's a gazillion parallel userspace programs. >

Re: [RFC] arch: Introduce new TSO memory barrier smp_tmb()

2013-11-04 Thread Paul E. McKenney
On Sun, Nov 03, 2013 at 03:34:00PM -0800, Linus Torvalds wrote: > On Sun, Nov 3, 2013 at 2:42 PM, Paul E. McKenney > wrote: > > > > smp_storebuffer_mb() -- A barrier that enforces those orderings > > that do not invalidate the hardware store-buffer optimization.

Re: [RFC] arch: Introduce new TSO memory barrier smp_tmb()

2013-11-04 Thread Paul E. McKenney
On Mon, Nov 04, 2013 at 12:22:54PM +0100, Peter Zijlstra wrote: > On Mon, Nov 04, 2013 at 02:51:00AM -0800, Paul E. McKenney wrote: > > OK, something like this for the definitions (though PowerPC might want > > to locally abstract the lwsync expansion): >

Re: [RFC] arch: Introduce new TSO memory barrier smp_tmb()

2013-11-04 Thread Paul E. McKenney
On Mon, Nov 04, 2013 at 11:05:53AM +, Will Deacon wrote: > On Sun, Nov 03, 2013 at 11:34:00PM +, Linus Torvalds wrote: > > So it would *kind* of act like a "smp_wmb() + smp_rmb()", but the > > problem is that a "smp_rmb()" doesn't really "attach" to the preceding > > write. > > Agreed. >

Re: [RFC] arch: Introduce new TSO memory barrier smp_tmb()

2013-11-04 Thread Paul E. McKenney
On Mon, Nov 04, 2013 at 08:11:27PM +0100, Peter Zijlstra wrote: > On Mon, Nov 04, 2013 at 08:27:32AM -0800, Paul E. McKenney wrote: > > All this is leading me to suggest the following shortenings of names: > > > > smp_load_with_acquire_semantics(

Re: [RFC] arch: Introduce new TSO memory barrier smp_tmb()

2013-11-04 Thread Paul E. McKenney
On Mon, Nov 04, 2013 at 08:18:11PM +0100, Peter Zijlstra wrote: > On Mon, Nov 04, 2013 at 08:11:27PM +0100, Peter Zijlstra wrote: > > +#define smp_load_acquire(p, v) > > \ > > I R idiot!! :-) OK, I did miss this one as well... :-/

Re: [RFC] arch: Introduce new TSO memory barrier smp_tmb()

2013-11-05 Thread Paul E. McKenney
On Tue, Nov 05, 2013 at 02:05:48PM +, Will Deacon wrote: > On Mon, Nov 04, 2013 at 08:53:44PM +0000, Paul E. McKenney wrote: > > On Mon, Nov 04, 2013 at 08:11:27PM +0100, Peter Zijlstra wrote: > > Some comments below. I believe that opcodes need to be fixed for IA64. > &g

Re: [RFC] arch: Introduce new TSO memory barrier smp_tmb()

2013-11-06 Thread Paul E. McKenney
ents in readability. It therefore seems likely that > replacing other explicit barriers with smp_load_acquire() and > smp_store_release() will provide similar benefits. It appears > that roughly half of the explicit barriers in core kernel code > might be so replaced. > > > Cc:

Re: [PATCH v5 04/45] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-02-08 Thread Paul E. McKenney
On Tue, Jan 29, 2013 at 08:12:37PM +0900, Namhyung Kim wrote: > On Thu, 24 Jan 2013 10:00:04 +0530, Srivatsa S. Bhat wrote: > > On 01/24/2013 01:27 AM, Tejun Heo wrote: > >> On Thu, Jan 24, 2013 at 01:03:52AM +0530, Srivatsa S. Bhat wrote: > >>> CPU 0 CPU 1 > >>> > >>> read

Re: [PATCH v5 04/45] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-02-08 Thread Paul E. McKenney
On Tue, Jan 22, 2013 at 01:03:53PM +0530, Srivatsa S. Bhat wrote: > Using global rwlocks as the backend for per-CPU rwlocks helps us avoid many > lock-ordering related problems (unlike per-cpu locks). However, global > rwlocks lead to unnecessary cache-line bouncing even when there are no > writers

Re: [PATCH v5 05/45] percpu_rwlock: Make percpu-rwlocks IRQ-safe, optimally

2013-02-08 Thread Paul E. McKenney
On Tue, Jan 22, 2013 at 01:04:11PM +0530, Srivatsa S. Bhat wrote: > If interrupt handlers can also be readers, then one of the ways to make > per-CPU rwlocks safe, is to disable interrupts at the reader side before > trying to acquire the per-CPU rwlock and keep it disabled throughout the > duratio

Re: [PATCH v5 06/45] percpu_rwlock: Allow writers to be readers, and add lockdep annotations

2013-02-08 Thread Paul E. McKenney
On Tue, Jan 22, 2013 at 01:04:23PM +0530, Srivatsa S. Bhat wrote: > CPU hotplug (which will be the first user of per-CPU rwlocks) has a special > requirement with respect to locking: the writer, after acquiring the per-CPU > rwlock for write, must be allowed to take the same lock for read, without

Re: [PATCH v5 07/45] CPU hotplug: Provide APIs to prevent CPU offline from atomic context

2013-02-08 Thread Paul E. McKenney
Miller" > Cc: "H. Peter Anvin" > Cc: x...@kernel.org > Cc: linux-arm-ker...@lists.infradead.org > Cc: uclinux-dist-de...@blackfin.uclinux.org > Cc: linux-i...@vger.kernel.org > Cc: linux-m...@linux-mips.org > Cc: linux-am33-l...@redhat.com > Cc: linux-par.

Re: [PATCH v5 08/45] CPU hotplug: Convert preprocessor macros to static inline functions

2013-02-08 Thread Paul E. McKenney
n the CPU hotplug code to static inline C functions. > > Signed-off-by: Srivatsa S. Bhat Reviewed-by: Paul E. McKenney > --- > > include/linux/cpu.h |8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/include/linux/cpu.h b/include/li

Re: [PATCH v5 09/45] smp, cpu hotplug: Fix smp_call_function_*() to prevent CPU offline properly

2013-02-08 Thread Paul E. McKenney
On Tue, Jan 22, 2013 at 01:05:10PM +0530, Srivatsa S. Bhat wrote: > Once stop_machine() is gone from the CPU offline path, we won't be able to > depend on preempt_disable() to prevent CPUs from going offline from under us. > > Use the get/put_online_cpus_atomic() APIs to prevent CPUs from going of

Re: [PATCH v5 44/45] CPU hotplug, stop_machine: Decouple CPU hotplug from stop_machine() in Kconfig

2013-02-08 Thread Paul E. McKenney
On Tue, Jan 22, 2013 at 01:15:22PM +0530, Srivatsa S. Bhat wrote: > ... and also cleanup a comment that refers to CPU hotplug being dependent on > stop_machine(). > > Cc: David Howells > Signed-off-by: Srivatsa S. Bhat Reviewed-by: Paul E. McKenney (Hey, I thought I owed mys

Re: [PATCH v5 45/45] Documentation/cpu-hotplug: Remove references to stop_machine()

2013-02-08 Thread Paul E. McKenney
> Reflect this in the documentation. > > Cc: Rob Landley > Cc: linux-...@vger.kernel.org > Signed-off-by: Srivatsa S. Bhat Reviewed-by: Paul E. McKenney > --- > > Documentation/cpu-hotplug.txt | 17 +++-- > 1 file changed, 11 insertions(+), 6 deletion

Re: [PATCH v5 14/45] rcu, CPU hotplug: Fix comment referring to stop_machine()

2013-02-08 Thread Paul E. McKenney
On Tue, Jan 22, 2013 at 01:06:34PM +0530, Srivatsa S. Bhat wrote: > Don't refer to stop_machine() in the CPU hotplug path, since we are going > to get rid of it. Also, move the comment referring to callback adoption > to the CPU_DEAD case, because that's where it happens now. > > Signed-off-by: Sr

Re: [PATCH v5 04/45] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-02-10 Thread Paul E. McKenney
On Mon, Feb 11, 2013 at 12:40:56AM +0530, Srivatsa S. Bhat wrote: > On 02/09/2013 04:40 AM, Paul E. McKenney wrote: > > On Tue, Jan 22, 2013 at 01:03:53PM +0530, Srivatsa S. Bhat wrote: > >> Using global rwlocks as the backend for per-CPU rwlocks helps us avoid many > >

Re: [PATCH v5 04/45] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-02-10 Thread Paul E. McKenney
On Sun, Feb 10, 2013 at 07:06:07PM +0100, Oleg Nesterov wrote: > On 02/08, Paul E. McKenney wrote: [ . . . ] > > > +static inline void sync_reader(struct percpu_rwlock *pcpu_rwlock, > > > +unsigned int cpu) > > > +{ > > > + s

Re: [PATCH v5 09/45] smp, cpu hotplug: Fix smp_call_function_*() to prevent CPU offline properly

2013-02-10 Thread Paul E. McKenney
On Mon, Feb 11, 2013 at 01:11:29AM +0530, Srivatsa S. Bhat wrote: > On 02/09/2013 05:37 AM, Paul E. McKenney wrote: > > On Tue, Jan 22, 2013 at 01:05:10PM +0530, Srivatsa S. Bhat wrote: > >> Once stop_machine() is gone from the CPU offline path, we won't be able to > &g

Re: [PATCH v5 04/45] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-02-10 Thread Paul E. McKenney
On Mon, Feb 11, 2013 at 01:39:24AM +0530, Srivatsa S. Bhat wrote: > On 02/11/2013 01:20 AM, Oleg Nesterov wrote: > > On 02/11, Srivatsa S. Bhat wrote: > >> > >> On 02/10/2013 11:36 PM, Oleg Nesterov wrote: > > +static void announce_writer_inactive(struct percpu_rwlock *pcpu_rwlock) > > +{ >

Re: [PATCH v5 00/45] CPU hotplug: stop_machine()-free CPU hotplug

2013-02-11 Thread Paul E. McKenney
On Mon, Feb 11, 2013 at 05:53:41PM +0530, Srivatsa S. Bhat wrote: > On 02/11/2013 05:28 PM, Vincent Guittot wrote: > > On 8 February 2013 19:09, Srivatsa S. Bhat > > wrote: [ . . . ] > >> Adding Vincent to CC, who had previously evaluated the performance and > >> latency implications of CPU hotp

Re: [PATCH v5 04/45] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-02-12 Thread Paul E. McKenney
On Sun, Feb 10, 2013 at 11:54:17AM -0800, Paul E. McKenney wrote: > On Sun, Feb 10, 2013 at 07:06:07PM +0100, Oleg Nesterov wrote: > > On 02/08, Paul E. McKenney wrote: > > [ . . . ] > > > > > +static inline void sync_reader(str

Re: [PATCH 1/9] powerpc,kvm: fix imbalance srcu_read_[un]lock()

2013-04-11 Thread Paul E. McKenney
On Mon, Mar 18, 2013 at 08:26:48AM +1100, Paul Mackerras wrote: > On Sat, Mar 16, 2013 at 12:50:49AM +0800, Lai Jiangshan wrote: > > At the point of up_out label in kvmppc_hv_setup_htab_rma(), > > srcu read lock is still held. > > > > We have to release it before return. > > > > Signed-off-by: La

Re: [PATCH] powerpc: irq work racing with timer interrupt can result in timer interrupt hang

2014-05-09 Thread Paul E. McKenney
On Fri, May 09, 2014 at 05:47:12PM +1000, Anton Blanchard wrote: > I am seeing an issue where a CPU running perf eventually hangs. > Traces show timer interrupts happening every 4 seconds even > when a userspace task is running on the CPU. Is this by chance every 4.2 seconds? The reason I ask is

Re: [PATCH] powerpc: irq work racing with timer interrupt can result in timer interrupt hang

2014-05-09 Thread Paul E. McKenney
On Fri, May 09, 2014 at 11:50:05PM +0200, Gabriel Paubert wrote: > On Fri, May 09, 2014 at 06:41:13AM -0700, Paul E. McKenney wrote: > > On Fri, May 09, 2014 at 05:47:12PM +1000, Anton Blanchard wrote: > > > I am seeing an issue where a CPU running perf eventually hangs. >

Re: [PATCH] powerpc: irq work racing with timer interrupt can result in timer interrupt hang

2014-05-10 Thread Paul E. McKenney
On Sat, May 10, 2014 at 04:33:37PM +1000, Paul Mackerras wrote: > On Fri, May 09, 2014 at 03:08:45PM -0700, Paul E. McKenney wrote: > > On Fri, May 09, 2014 at 11:50:05PM +0200, Gabriel Paubert wrote: > > > On Fri, May 09, 2014 at 06:41:13AM -0700, Paul E. McKenney wrote: >

Re: [PATCH] powernv: Add OPAL tracepoints

2014-07-09 Thread Paul E. McKenney
en the tracepoints are disabled. > > Signed-off-by: Anton Blanchard That is what I call invoking tracepoints the hard way -- from assembly! Just one question -- can these tracepoints be invoked from the idle loop? If so, you need to use the _rcuidle suffix, for example, as in trace_o

Re: [PATCH 2/2] powerpc: Add ppc64 hard lockup detector support

2014-08-11 Thread Paul E. McKenney
, so that the CPU detecting an RCU CPU stall does the stack dumping. Signed-off-by: Paul E. McKenney Reviewed-by: Lai Jiangshan diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 3f93033d3c61..8f3e4d43d736 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -1013,10 +1013

[PATCH v6 tip/core/locking 8/8] powerpc: Full barrier for smp_mb__after_unlock_lock()

2013-12-11 Thread Paul E. McKenney
From: "Paul E. McKenney" The powerpc lock acquisition sequence is as follows: lwarx; cmpwi; bne; stwcx.; lwsync; Lock release is as follows: lwsync; stw; If CPU 0 does a store (say, x=1) then a lock release, and CPU 1 does a lock acquisition then a load (say, r

[GIT PULL locking/mb] Locking/memory-barrier commits

2013-12-13 Thread Paul E. McKenney
-0800) Paul E. McKenney (7): Documentation/memory-barriers.txt: Add needed ACCESS_ONCE() calls to memory-barriers.txt Documentation/memory-barriers.txt: Add long atomic examples to memory-barriers.txt Documentation/memory-barriers.txt: Document ACCESS_ONCE() locking: A

Re: suspicious RCU usage clockevents_lock, tick_broadcast_lock, hrtimer_bases.lock

2015-02-13 Thread Paul E. McKenney
mer mode of broadcast queues hrtimers in the idle entry > path so as to wakeup cpus in deep idle states. hrtimer_{start/cancel} > functions call into tracing which uses RCU. But it is not legal to call > into RCU in cpuidle because it is one of the quiescent states. Hence > protect th

Re: [PATCH] powerpc: re-enable dynticks

2015-02-13 Thread Paul E. McKenney
h "nohz_full= list>" is displayed: > NO_HZ: Can't run full dynticks because arch doesn't support irq > work self-IPIs > > after this patch: > NO_HZ: Full dynticks CPUs: . > > Tested against 3.19. > > CC: Frederic Weisbecker > CC: Paul E. M

Re: suspicious RCU usage clockevents_lock, tick_broadcast_lock, hrtimer_bases.lock

2015-02-15 Thread Paul E. McKenney
On Mon, Feb 16, 2015 at 08:49:12AM +0530, Preeti U Murthy wrote: > On 02/13/2015 07:56 PM, Paul E. McKenney wrote: > > On Fri, Feb 13, 2015 at 12:52:45PM +0530, Preeti U Murthy wrote: > >> On 02/13/2015 10:57 AM, Preeti U Murthy wrote: > >>> On 02/13/2015 06:27 AM, S

Re: [PATCH v2] powerpc: re-enable dynticks

2015-02-20 Thread Paul E. McKenney
gt; Tested against 3.19. > > v2: changed "return 1" to "return true", per Michael Ellerman > > CC: Frederic Weisbecker > CC: Paul E. McKenney > Signed-off-by: Paul A. Clarke Reviewed-by: Paul E. McKenney > diff --git a/arch/powerpc/include/asm/irq_wor

Re: Writes, smp_wmb(), and transitivity?

2016-02-16 Thread Paul E. McKenney
On Tue, Feb 16, 2016 at 09:53:20AM +, Will Deacon wrote: > On Mon, Feb 15, 2016 at 12:35:12PM -0800, Paul E. McKenney wrote: > > On Mon, Feb 15, 2016 at 06:58:32PM +, Will Deacon wrote: > > > On Mon, Feb 15, 2016 at 09:58:25AM -0800, Paul E. McKenney wrote: > >

Re: Writes, smp_wmb(), and transitivity?

2016-02-16 Thread Paul E. McKenney
On Tue, Feb 16, 2016 at 10:59:08AM -0800, Linus Torvalds wrote: > On Mon, Feb 15, 2016 at 9:58 AM, Paul E. McKenney > wrote: > > > > Two threads: > > > > int a, b; > > > > void thread0(void) > > { > >

Re: [PATCH] documentation: Add disclaimer

2016-04-14 Thread Paul E. McKenney
On Wed, Jan 27, 2016 at 09:35:46AM +0100, Peter Zijlstra wrote: > On Tue, Jan 26, 2016 at 12:11:43PM -0800, Paul E. McKenney wrote: > > So Peter, would you like to update your patch to include yourself > > and Will as authors? > > Sure, here goes. > > --- > Subject:

Re: [PATCH] documentation: Add disclaimer

2016-04-14 Thread Paul E. McKenney
On Wed, Jan 27, 2016 at 02:57:07PM +, David Howells wrote: > Peter Zijlstra wrote: > > > +== > > +DISCLAIMER > > +== > > + > > +This document is not a specification; it is intentionally (for the sake of > > +brevity) and unintentionally (due to being human) incomplete. This >

Re: [RFC 3/5] powerpc: atomic: implement atomic{,64}_{add,sub}_return_* variants

2015-09-01 Thread Paul E. McKenney
On Tue, Sep 01, 2015 at 08:00:27PM +0100, Will Deacon wrote: > On Fri, Aug 28, 2015 at 04:39:21PM +0100, Peter Zijlstra wrote: > > On Fri, Aug 28, 2015 at 10:16:02PM +0800, Boqun Feng wrote: > > > Ah.. just read through the thread you mentioned, I might misunderstand > > > you, probably because I d

Re: [RFC 3/5] powerpc: atomic: implement atomic{,64}_{add,sub}_return_* variants

2015-09-02 Thread Paul E. McKenney
On Wed, Sep 02, 2015 at 10:59:06AM +0100, Will Deacon wrote: > Hi Paul, > > On Tue, Sep 01, 2015 at 10:45:40PM +0100, Paul E. McKenney wrote: > > On Tue, Sep 01, 2015 at 08:00:27PM +0100, Will Deacon wrote: > > > On Fri, Aug 28, 2015 at 04:39:21PM +0100, Peter Zijlstra

Re: [RFC 3/5] powerpc: atomic: implement atomic{,64}_{add,sub}_return_* variants

2015-09-11 Thread Paul E. McKenney
On Fri, Sep 11, 2015 at 01:45:07PM +0100, Will Deacon wrote: > [left the context in the hope that we can make some progress] > > On Wed, Sep 02, 2015 at 10:59:06AM +0100, Will Deacon wrote: > > On Tue, Sep 01, 2015 at 10:45:40PM +0100, Paul E. McKenney wrote: > > > On Tu

Re: [RFC 3/5] powerpc: atomic: implement atomic{,64}_{add,sub}_return_* variants

2015-09-14 Thread Paul E. McKenney
On Mon, Sep 14, 2015 at 04:38:48PM +0100, Will Deacon wrote: > On Mon, Sep 14, 2015 at 01:11:56PM +0100, Peter Zijlstra wrote: > > On Mon, Sep 14, 2015 at 02:01:53PM +0200, Peter Zijlstra wrote: > > > The scenario is: > > > > > > CPU0CPU1 > > > > > >

Re: [RFC v2 3/7] powerpc: atomic: Implement atomic{,64}_{add,sub}_return_* variants

2015-09-22 Thread Paul E. McKenney
On Tue, Sep 22, 2015 at 07:37:04AM +0800, Boqun Feng wrote: > On Tue, Sep 22, 2015 at 07:26:56AM +0800, Boqun Feng wrote: > > On Mon, Sep 21, 2015 at 11:24:27PM +0100, Will Deacon wrote: > > > Hi Boqun, > > > > > > On Sun, Sep 20, 2015 at 09:23:03AM +0100, Boqun Feng wrote: > > > > On Sat, Sep 19,

Re: [RFC v2 3/7] powerpc: atomic: Implement atomic{,64}_{add,sub}_return_* variants

2015-09-25 Thread Paul E. McKenney
On Wed, Sep 23, 2015 at 08:07:55AM +0800, Boqun Feng wrote: > On Tue, Sep 22, 2015 at 08:25:40AM -0700, Paul E. McKenney wrote: > > On Tue, Sep 22, 2015 at 07:37:04AM +0800, Boqun Feng wrote: > > > On Tue, Sep 22, 2015 at 07:26:56AM +0800, Boqun Feng wrote: > > > >

  1   2   3   4   5   >