Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-21 Thread Mathieu Desnoyers
- On Jul 21, 2020, at 11:19 AM, Peter Zijlstra pet...@infradead.org wrote: > On Tue, Jul 21, 2020 at 11:15:13AM -0400, Mathieu Desnoyers wrote: >> - On Jul 21, 2020, at 11:06 AM, Peter Zijlstra pet...@infradead.org >> wrote: >> >> > On Tue, Jul 21, 2020

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-21 Thread Mathieu Desnoyers
thread implementations. > Also, I just realized, I still have a fix for use_mm() now > kthread_use_mm() that seems to have been lost. I suspect we need to at least document the memory barriers in kthread_use_mm and kthread_unuse_mm to state that they are required by membarrier if we want to ipi kthreads as well. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-21 Thread Mathieu Desnoyers
se-case to implement a different behavior which covers kthreads, this could be added consistently across membarrier commands with a flag (or by adding new commands). Does this approach make sense ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-20 Thread Mathieu Desnoyers
ers to support your concern. > so I really think > it's a fragile interface with no real way for the user to know how > kernel threads may use its mm for any particular reason, so membarrier > should synchronize all possible kernel users as well. I strongly doubt so, but perhaps something should be clarified in the documentation if you have that feeling. Thanks, Mathieu > > Thanks, > Nick -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-17 Thread Mathieu Desnoyers
- On Jul 17, 2020, at 1:44 PM, Alan Stern st...@rowland.harvard.edu wrote: > On Fri, Jul 17, 2020 at 12:22:49PM -0400, Mathieu Desnoyers wrote: >> - On Jul 17, 2020, at 12:11 PM, Alan Stern st...@rowland.harvard.edu >> wrote: >> >> >> > I agree w

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-17 Thread Mathieu Desnoyers
aller thread _after_ we finished * waiting for the last IPI. [...] However, it does not explain why it needs to be paired with a barrier in the scheduler, clearly for the case where the IPI is skipped. I wonder whether this part of the comment is factually correct: * [...] Matches memory barriers around rq->curr modification in scheduler. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-17 Thread Mathieu Desnoyers
- On Jul 17, 2020, at 10:51 AM, Alan Stern st...@rowland.harvard.edu wrote: > On Fri, Jul 17, 2020 at 09:39:25AM -0400, Mathieu Desnoyers wrote: >> - On Jul 16, 2020, at 5:24 PM, Alan Stern st...@rowland.harvard.edu >> wrote: >> >> > On Thu, Jul 16, 202

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-17 Thread Mathieu Desnoyers
hrough system calls from the context of user-space threads, which are called from the right mm. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-17 Thread Mathieu Desnoyers
- On Jul 16, 2020, at 5:24 PM, Alan Stern st...@rowland.harvard.edu wrote: > On Thu, Jul 16, 2020 at 02:58:41PM -0400, Mathieu Desnoyers wrote: >> - On Jul 16, 2020, at 12:03 PM, Mathieu Desnoyers >> mathieu.desnoy...@efficios.com wrote: >> >> >

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-16 Thread Mathieu Desnoyers
- On Jul 16, 2020, at 12:03 PM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > - On Jul 16, 2020, at 11:46 AM, Mathieu Desnoyers > mathieu.desnoy...@efficios.com wrote: > >> - On Jul 16, 2020, at 12:42 AM, Nicholas Piggin npig...@gmail.com wrote: >&

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-16 Thread Mathieu Desnoyers
- On Jul 16, 2020, at 11:46 AM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > - On Jul 16, 2020, at 12:42 AM, Nicholas Piggin npig...@gmail.com wrote: >> I should be more complete here, especially since I was complaining >> about unclear barrier comment :)

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-16 Thread Mathieu Desnoyers
he case of io_uring, submitting a request or returning from waiting on request completion appear to provide this causality relationship. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-16 Thread Mathieu Desnoyers
ario: * Frequent read / Infrequent write, communicating read completion through variable X load from X (waiting for X==1) -> membarrier -> submit io_uring write request with matching wait for io_uring read request completion -> asm volatile (::: "memory") -> store X=1 Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [PATCH v2] powerpc: select ARCH_HAS_MEMBARRIER_SYNC_CORE

2020-07-15 Thread Mathieu Desnoyers
ed more than just context sync after IPI. We need context sync in return path of any trap/interrupt/system call which returns to user-space, else we'd need to add the proper core serializing barriers in the scheduler, as we had to do for lazy tlb on x86. Or am I missing something ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-13 Thread Mathieu Desnoyers
does not need to be context serializing as long as kernel serializes before returning to user-space. However, return from interrupt to user-space needs to be context serializing. Thanks, Mathieu > > https://lists.ozlabs.org/pipermail/linuxppc-dev/2020-July/214171.html > > So you may not

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-10 Thread Mathieu Desnoyers
implicitly > - * provided by mmdrop(), > - * - a sync_core for SYNC_CORE. > + * switch_mm(). Membarrier requires a full barrier after storing to > + * rq->curr, before returning to userspace, for > + * {PRIVATE,GLOBAL}_EXPEDITED. This is implicitly provided by mmdrop(). >*/ > - if (mm) { > - membarrier_mm_sync_core_before_usermode(mm); > + if (mm) > mmdrop(mm); > - } > + > if (unlikely(prev_state == TASK_DEAD)) { > if (prev->sched_class->task_dead) > prev->sched_class->task_dead(prev); > @@ -6292,6 +6289,7 @@ void idle_task_exit(void) > BUG_ON(current != this_rq()->idle); > > if (mm != _mm) { > + /* enter_lazy_tlb is not done because we're about to go down */ > switch_mm(mm, _mm, current); > finish_arch_post_lock_switch(); > } > -- > 2.23.0 -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: Failure to build librseq on ppc

2020-07-09 Thread Mathieu Desnoyers
- On Jul 9, 2020, at 4:46 PM, Segher Boessenkool seg...@kernel.crashing.org wrote: > On Thu, Jul 09, 2020 at 01:56:19PM -0400, Mathieu Desnoyers wrote: >> > Just to make sure I understand your recommendation. So rather than >> > hard coding r17 as the temporary registers

Re: Failure to build librseq on ppc

2020-07-09 Thread Mathieu Desnoyers
- On Jul 9, 2020, at 1:42 PM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > - On Jul 9, 2020, at 1:37 PM, Segher Boessenkool > seg...@kernel.crashing.org > wrote: > >> On Thu, Jul 09, 2020 at 09:43:47AM -0400, Mathieu Desnoyers wrote: >>>

Re: Failure to build librseq on ppc

2020-07-09 Thread Mathieu Desnoyers
- On Jul 9, 2020, at 1:37 PM, Segher Boessenkool seg...@kernel.crashing.org wrote: > On Thu, Jul 09, 2020 at 09:43:47AM -0400, Mathieu Desnoyers wrote: >> > What protects r17 *after* this asm statement? >> >> As discussed in the other leg of the thread (with t

Re: Failure to build librseq on ppc

2020-07-09 Thread Mathieu Desnoyers
- On Jul 8, 2020, at 8:18 PM, Segher Boessenkool seg...@kernel.crashing.org wrote: > On Wed, Jul 08, 2020 at 08:01:23PM -0400, Mathieu Desnoyers wrote: >> > > #define RSEQ_ASM_OP_CMPEQ(var, expect, label) >> > > \ >> > > LOAD_

Re: Failure to build librseq on ppc

2020-07-09 Thread Mathieu Desnoyers
- On Jul 8, 2020, at 8:10 PM, Segher Boessenkool seg...@kernel.crashing.org wrote: > Hi! > > On Wed, Jul 08, 2020 at 10:00:01AM -0400, Mathieu Desnoyers wrote: [...] > >> -#define STORE_WORD "std " >> -#define LOAD_WORD "ld " &

Re: Failure to build librseq on ppc

2020-07-08 Thread Mathieu Desnoyers
long as your code (after inlining etc.!) stays > small, but there is Murphy's law. r17 is in the clobber list, so it should be ok. > > Anyway... something in rseq_str is wrong, missing %X. This may > have to do with the abuse of inline asm here, making a fix harder :-( I just committed a fix which enhances the macros. Thanks for your help! Mathieu > > > Segher -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

[PATCH 1/1] powerpc: Fix incorrect stw{, ux, u, x} instructions in __set_pte_at

2020-07-08 Thread Mathieu Desnoyers
r SMP support") Signed-off-by: Mathieu Desnoyers Cc: Christophe Leroy Cc: Kumar Gala Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org Cc: # v2.6.28+ --- arch/powerpc/include/asm/book3s/32/pgtable.h | 2 +- arch/powerpc/include/asm/nohash

powerpc: Incorrect stw operand modifier in __set_pte_at

2020-07-08 Thread Mathieu Desnoyers
uot; (*((unsigned char *)ptep+4)) : "r" (pte) : "memory"); where I would have expected: stw%U1%X1 %L2,%1" Is it a bug or am I missing something ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: Failure to build librseq on ppc

2020-07-08 Thread Mathieu Desnoyers
- On Jul 8, 2020, at 10:21 AM, Christophe Leroy christophe.le...@csgroup.eu wrote: > Le 08/07/2020 à 16:00, Mathieu Desnoyers a écrit : >> - On Jul 8, 2020, at 8:33 AM, Mathieu Desnoyers >> mathieu.desnoy...@efficios.com wrote: >> >>> - On Jul 7, 2020,

Re: [PATCH] powerpc: select ARCH_HAS_MEMBARRIER_SYNC_CORE

2020-07-08 Thread Mathieu Desnoyers
+ context synchronistaion by the time it has done" is not strictly correct: the context synchronizing instruction does not strictly need to happen on each core before membarrier returns. A similar line of thoughts can be followed for memory barriers. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: Failure to build librseq on ppc

2020-07-08 Thread Mathieu Desnoyers
- On Jul 8, 2020, at 8:33 AM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > - On Jul 7, 2020, at 8:59 PM, Segher Boessenkool > seg...@kernel.crashing.org > wrote: [...] >> >> So perhaps you have code like >> >> int *p; >> int x

Re: Failure to build librseq on ppc

2020-07-08 Thread Mathieu Desnoyers
- On Jul 7, 2020, at 8:59 PM, Segher Boessenkool seg...@kernel.crashing.org wrote: > Hi! > > On Tue, Jul 07, 2020 at 03:17:10PM -0400, Mathieu Desnoyers wrote: >> I'm trying to build librseq at: >> >> https://git.kernel.org/pub/scm/libs/librseq/librseq.git &

Failure to build librseq on ppc

2020-07-07 Thread Mathieu Desnoyers
ry operand addressed by just a base register." I suspect that lwz and stw don't expect some kind of immediate offset which can be kept with "m", and "Q" fixes this. Is that the right fix ? And should we change all operands passed to lwz and stw to a "Q"

Re: [PATCH] powerpc: select ARCH_HAS_MEMBARRIER_SYNC_CORE

2020-07-07 Thread Mathieu Desnoyers
ing case. I thought it was okay (because > the IPI would cause a hard interrupt which does do the rfi) but that > should at least be written. Yes. > The context synchronisation happens before > the Linux IPI function is called, but for the purpose of membarrier I > think that is okay

[PATCH for 5.2 10/12] rseq/selftests: powerpc code signature: generate valid instructions

2019-04-29 Thread Mathieu Desnoyers
Use "twui" as the guard instruction for the restartable sequence abort handler. Signed-off-by: Mathieu Desnoyers CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Michael Ellerman CC: Boqun Feng CC: Peter Zijlstra CC: "Paul E. McKenney" CC: Alan Modra CC: linuxppc-

[RFC PATCH for 5.2 09/10] rseq/selftests: powerpc code signature: generate valid instructions

2019-04-24 Thread Mathieu Desnoyers
Use "twui" as the guard instruction for the restartable sequence abort handler. Signed-off-by: Mathieu Desnoyers CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Michael Ellerman CC: Boqun Feng CC: Peter Zijlstra CC: "Paul E. McKenney" CC: Alan Modra CC: linuxppc-

[RFC PATCH for 4.21 09/16] powerpc: Wire up cpu_opv system call

2018-11-01 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Michael Ellerman CC: Boqun Feng CC: Peter Zijlstra CC: "Paul E. McKenney" CC: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/include/asm/systbl.h | 1 + arch/powerpc/include/uapi/asm/unistd.

[RFC PATCH for 4.21 09/16] powerpc: Wire up cpu_opv system call

2018-10-10 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Michael Ellerman CC: Boqun Feng CC: Peter Zijlstra CC: "Paul E. McKenney" CC: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/include/asm/systbl.h | 1 + arch/powerpc/include/uapi/asm/unistd.

Re: [RFC PATCH for 4.18 10/16] powerpc: Wire up restartable sequences system call

2018-06-05 Thread Mathieu Desnoyers
- On Jun 5, 2018, at 1:18 AM, Michael Ellerman m...@ellerman.id.au wrote: > Mathieu Desnoyers writes: > >> From: Boqun Feng >> >> Wire up the rseq system call on powerpc. >> >> This provides an ABI improving the speed of a user-space getcpu >> o

Re: [RFC PATCH for 4.18 09/16] powerpc: Add syscall detection for restartable sequences

2018-06-05 Thread Mathieu Desnoyers
- On Jun 5, 2018, at 1:21 AM, Michael Ellerman m...@ellerman.id.au wrote: > Mathieu Desnoyers writes: >> From: Boqun Feng >> >> Syscalls are not allowed inside restartable sequences, so add a call to >> rseq_syscall() at the very beginning

[RFC PATCH for 4.18 10/16] powerpc: Wire up restartable sequences system call

2018-06-02 Thread Mathieu Desnoyers
-reservation/store-conditional atomics. Signed-off-by: Boqun Feng Signed-off-by: Mathieu Desnoyers CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Michael Ellerman CC: Peter Zijlstra CC: "Paul E. McKenney" CC: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/include/asm/systbl.h |

[RFC PATCH for 4.18 09/16] powerpc: Add syscall detection for restartable sequences

2018-06-02 Thread Mathieu Desnoyers
-bit powerpc kernel by Mathieu Desnoyers. Still needs to be tested on 32-bit powerpc kernel. ] Signed-off-by: Boqun Feng Signed-off-by: Mathieu Desnoyers CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Michael Ellerman CC: Peter Zijlstra CC: "Paul E. McKenney" CC: li

[RFC PATCH for 4.18 08/16] powerpc: Add support for restartable sequences

2018-06-02 Thread Mathieu Desnoyers
From: Boqun Feng Call the rseq_handle_notify_resume() function on return to userspace if TIF_NOTIFY_RESUME thread flag is set. Perform fixup on the pre-signal when a signal is delivered on top of a restartable sequence critical section. Signed-off-by: Boqun Feng Signed-off-by: Mathieu

Re: [PATCH 07/14] powerpc: Add support for restartable sequences

2018-05-28 Thread Mathieu Desnoyers
- On May 24, 2018, at 3:03 AM, Michael Ellerman m...@ellerman.id.au wrote: > Mathieu Desnoyers <mathieu.desnoy...@efficios.com> writes: >> - On May 23, 2018, at 4:14 PM, Mathieu Desnoyers >> mathieu.desnoy...@efficios.com wrote: > ... >>> >>

Re: [PATCH 07/14] powerpc: Add support for restartable sequences

2018-05-23 Thread Mathieu Desnoyers
- On May 23, 2018, at 4:14 PM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > - On May 20, 2018, at 10:08 AM, Boqun Feng boqun.f...@gmail.com wrote: > >> On Fri, May 18, 2018 at 02:17:17PM -0400, Mathieu Desnoyers wrote: >>> - On May 17, 2018, a

Re: [PATCH 07/14] powerpc: Add support for restartable sequences

2018-05-23 Thread Mathieu Desnoyers
- On May 20, 2018, at 10:08 AM, Boqun Feng boqun.f...@gmail.com wrote: > On Fri, May 18, 2018 at 02:17:17PM -0400, Mathieu Desnoyers wrote: >> - On May 17, 2018, at 7:50 PM, Boqun Feng boqun.f...@gmail.com wrote: >> [...] >> >> > I think you're right. So

Re: [PATCH 07/14] powerpc: Add support for restartable sequences

2018-05-18 Thread Mathieu Desnoyers
YSCALL_DOTRACE|_TIF_SINGLESTEP|_TIF_USER_WORK_MASK|_TIF_PERSYSCALL_MASK) >> > By the way, I think this is not the right spot to call rseq_syscall, because interrupts are disabled. I think we should move this hunk right after system_call_exit. Would you like to implement and test an updated patch adding those calls for ppc 32 and 64 ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [PATCH 07/14] powerpc: Add support for restartable sequences

2018-05-17 Thread Mathieu Desnoyers
- On May 16, 2018, at 9:19 PM, Boqun Feng boqun.f...@gmail.com wrote: > On Wed, May 16, 2018 at 04:13:16PM -0400, Mathieu Desnoyers wrote: >> - On May 16, 2018, at 12:18 PM, Peter Zijlstra pet...@infradead.org >> wrote: >> >> > On Mon, Apr 30, 2018 at 06:44

Re: [PATCH 07/14] powerpc: Add support for restartable sequences

2018-05-16 Thread Mathieu Desnoyers
- On May 16, 2018, at 12:18 PM, Peter Zijlstra pet...@infradead.org wrote: > On Mon, Apr 30, 2018 at 06:44:26PM -0400, Mathieu Desnoyers wrote: >> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig >> index c32a181a7cbb..ed21a777e8c6 100644 >> --- a/arch/powerpc/

[PATCH 08/14] powerpc: Wire up restartable sequences system call

2018-04-30 Thread Mathieu Desnoyers
u data compared to using load-reservation/store-conditional atomics. TODO: wire up rseq_syscall() on return from system call. It is used with CONFIG_DEBUG_RSEQ=y to ensure system calls are not issued within rseq critical section Signed-off-by: Boqun Feng <boqun.f...@gmail.com> Signed-off-by: Mathi

[PATCH 07/14] powerpc: Add support for restartable sequences

2018-04-30 Thread Mathieu Desnoyers
t;boqun.f...@gmail.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Benjamin Herrenschmidt <b...@kernel.crashing.org> CC: Paul Mackerras <pau...@samba.org> CC: Michael Ellerman <m...@ellerman.id.au> CC: Peter Zijlstra <pet...@infr

[RFC PATCH for 4.18 14/23] powerpc: Wire up cpu_opv system call

2018-04-12 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Benjamin Herrenschmidt <b...@kernel.crashing.org> CC: Paul Mackerras <pau...@samba.org> CC: Michael Ellerman <m...@ellerman.id.au> CC: Boqun Feng <boqun.f...@gmail.com> CC: Peter Zijlstra <

[RFC PATCH for 4.18 07/23] powerpc: Add support for restartable sequences

2018-04-12 Thread Mathieu Desnoyers
t;boqun.f...@gmail.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Benjamin Herrenschmidt <b...@kernel.crashing.org> CC: Paul Mackerras <pau...@samba.org> CC: Michael Ellerman <m...@ellerman.id.au> CC: Peter Zijlstra <pet...@infr

[RFC PATCH for 4.18 08/23] powerpc: Wire up restartable sequences system call

2018-04-12 Thread Mathieu Desnoyers
u data compared to using load-reservation/store-conditional atomics. TODO: wire up rseq_syscall() on return from system call. It is used with CONFIG_DEBUG_RSEQ=y to ensure system calls are not issued within rseq critical section Signed-off-by: Boqun Feng <boqun.f...@gmail.com> Signed-off-by: Mathi

[RFC PATCH for 4.17 12/21] powerpc: Wire up cpu_opv system call

2018-03-27 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Benjamin Herrenschmidt <b...@kernel.crashing.org> CC: Paul Mackerras <pau...@samba.org> CC: Michael Ellerman <m...@ellerman.id.au> CC: Boqun Feng <boqun.f...@gmail.com> CC: Peter Zijlstra <

[RFC PATCH for 4.17 08/21] powerpc: Wire up restartable sequences system call

2018-03-27 Thread Mathieu Desnoyers
u data compared to using load-reservation/store-conditional atomics. Signed-off-by: Boqun Feng <boqun.f...@gmail.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Benjamin Herrenschmidt <b...@kernel.crashing.org> CC: Paul Mackerras <pau...@samba.o

[RFC PATCH for 4.17 07/21] powerpc: Add support for restartable sequences

2018-03-27 Thread Mathieu Desnoyers
ection. Signed-off-by: Boqun Feng <boqun.f...@gmail.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Benjamin Herrenschmidt <b...@kernel.crashing.org> CC: Paul Mackerras <pau...@samba.org> CC: Michael Ellerman <m...@ellerman.id.au> CC: Peter Zijlstr

Re: [PATCH for 4.16 v7 02/11] powerpc: membarrier: Skip memory barrier in switch_mm()

2018-02-05 Thread Mathieu Desnoyers
- On Feb 5, 2018, at 3:22 PM, Ingo Molnar mi...@kernel.org wrote: > * Mathieu Desnoyers <mathieu.desnoy...@efficios.com> wrote: > >> >> +config ARCH_HAS_MEMBARRIER_HOOKS >> +bool > > Yeah, so I have renamed this to ARCH_HAS_MEMBARRIER_CALLBACKS, and

[PATCH for 4.16 v7 02/11] powerpc: membarrier: Skip memory barrier in switch_mm()

2018-01-29 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> Acked-by: Peter Zijlstra (Intel) <pet...@infradead.org> CC: Paul E. McKenney <paul...@linux.vnet.ibm.com> CC: Boqun Feng <boqun.f...@gmail.com> CC: Andrew Hunter <a...@google.com> CC: Maged Michael

[PATCH 02/11] powerpc: membarrier: Skip memory barrier in switch_mm() (v7)

2018-01-23 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Peter Zijlstra <pet...@infradead.org> CC: Paul E. McKenney <paul...@linux.vnet.ibm.com> CC: Boqun Feng <boqun.f...@gmail.com> CC: Andrew Hunter <a...@google.com> CC: Maged Michael <maged.mich...@gmai

[PATCH for 4.16 02/11] powerpc: membarrier: Skip memory barrier in switch_mm() (v7)

2018-01-17 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Peter Zijlstra <pet...@infradead.org> CC: Paul E. McKenney <paul...@linux.vnet.ibm.com> CC: Boqun Feng <boqun.f...@gmail.com> CC: Andrew Hunter <a...@google.com> CC: Maged Michael <maged.mich...@gmai

[PATCH for 4.16 02/10] powerpc: membarrier: Skip memory barrier in switch_mm() (v7)

2018-01-15 Thread Mathieu Desnoyers
E_EXPEDITED. Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Peter Zijlstra <pet...@infradead.org> CC: Paul E. McKenney <paul...@linux.vnet.ibm.com> CC: Boqun Feng <boqun.f...@gmail.com> CC: Andrew Hunter <a...@google.com> CC: Maged Michael <maged

[PATCH v7 for 4.16 03/11] powerpc: membarrier: Skip memory barrier in switch_mm()

2018-01-10 Thread Mathieu Desnoyers
E_EXPEDITED. Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Peter Zijlstra <pet...@infradead.org> CC: Paul E. McKenney <paul...@linux.vnet.ibm.com> CC: Boqun Feng <boqun.f...@gmail.com> CC: Andrew Hunter <a...@google.com> CC: Maged Michael <maged

[RFC PATCH for 4.16 03/11] powerpc: membarrier: Skip memory barrier in switch_mm() (v7)

2017-12-22 Thread Mathieu Desnoyers
E_EXPEDITED. Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Peter Zijlstra <pet...@infradead.org> CC: Paul E. McKenney <paul...@linux.vnet.ibm.com> CC: Boqun Feng <boqun.f...@gmail.com> CC: Andrew Hunter <a...@google.com> CC: Maged Michael <maged

[RFC PATCH for 4.16 12/21] powerpc: Wire up cpu_opv system call

2017-12-14 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Benjamin Herrenschmidt <b...@kernel.crashing.org> CC: Paul Mackerras <pau...@samba.org> CC: Michael Ellerman <m...@ellerman.id.au> CC: Boqun Feng <boqun.f...@gmail.com> CC: Peter Zijlstra <

[RFC PATCH for 4.16 07/21] powerpc: Add support for restartable sequences

2017-12-14 Thread Mathieu Desnoyers
ection. Signed-off-by: Boqun Feng <boqun.f...@gmail.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Benjamin Herrenschmidt <b...@kernel.crashing.org> CC: Paul Mackerras <pau...@samba.org> CC: Michael Ellerman <m...@ellerman.id.au> CC: Peter Zijlstr

[RFC PATCH for 4.16 08/21] powerpc: Wire up restartable sequences system call

2017-12-14 Thread Mathieu Desnoyers
u data compared to using load-reservation/store-conditional atomics. Signed-off-by: Boqun Feng <boqun.f...@gmail.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Benjamin Herrenschmidt <b...@kernel.crashing.org> CC: Paul Mackerras <pau...@samba.o

[RFC PATCH for 4.15 v7 19/22] powerpc: membarrier: Skip memory barrier in switch_mm()

2017-11-21 Thread Mathieu Desnoyers
E_EXPEDITED. Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Peter Zijlstra <pet...@infradead.org> CC: Paul E. McKenney <paul...@linux.vnet.ibm.com> CC: Boqun Feng <boqun.f...@gmail.com> CC: Andrew Hunter <a...@google.com> CC: Maged Michael <maged

[RFC PATCH for 4.15 12/22] powerpc: Wire up cpu_opv system call

2017-11-21 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Benjamin Herrenschmidt <b...@kernel.crashing.org> CC: Paul Mackerras <pau...@samba.org> CC: Michael Ellerman <m...@ellerman.id.au> CC: Boqun Feng <boqun.f...@gmail.com> CC: Peter Zijlstra <

[RFC PATCH for 4.15 08/22] powerpc: Wire up restartable sequences system call

2017-11-21 Thread Mathieu Desnoyers
u data compared to using load-reservation/store-conditional atomics. Signed-off-by: Boqun Feng <boqun.f...@gmail.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Benjamin Herrenschmidt <b...@kernel.crashing.org> CC: Paul Mackerras <pau...@samba.o

[RFC PATCH for 4.15 07/22] powerpc: Add support for restartable sequences

2017-11-21 Thread Mathieu Desnoyers
ection. Signed-off-by: Boqun Feng <boqun.f...@gmail.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Benjamin Herrenschmidt <b...@kernel.crashing.org> CC: Paul Mackerras <pau...@samba.org> CC: Michael Ellerman <m...@ellerman.id.au> CC: Peter Zijlstr

[RFC PATCH v7 for 4.15 16/24] membarrier: powerpc: Skip memory barrier in switch_mm()

2017-11-14 Thread Mathieu Desnoyers
E_EXPEDITED. Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Peter Zijlstra <pet...@infradead.org> CC: Paul E. McKenney <paul...@linux.vnet.ibm.com> CC: Boqun Feng <boqun.f...@gmail.com> CC: Andrew Hunter <a...@google.com> CC: Maged Michael <maged

[RFC PATCH for 4.15 10/24] cpu_opv: Wire up powerpc system call

2017-11-14 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Benjamin Herrenschmidt <b...@kernel.crashing.org> CC: Paul Mackerras <pau...@samba.org> CC: Michael Ellerman <m...@ellerman.id.au> CC: Boqun Feng <boqun.f...@gmail.com> CC: Peter Zijlstra <

[RFC PATCH for 4.15 07/24] Restartable sequences: Wire up powerpc system call

2017-11-14 Thread Mathieu Desnoyers
u data compared to using load-reservation/store-conditional atomics. Signed-off-by: Boqun Feng <boqun.f...@gmail.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Benjamin Herrenschmidt <b...@kernel.crashing.org> CC: Paul Mackerras <pau...@samba.o

[RFC PATCH for 4.15 06/24] Restartable sequences: powerpc architecture support

2017-11-14 Thread Mathieu Desnoyers
ection. Signed-off-by: Boqun Feng <boqun.f...@gmail.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Benjamin Herrenschmidt <b...@kernel.crashing.org> CC: Paul Mackerras <pau...@samba.org> CC: Michael Ellerman <m...@ellerman.id.au> CC: Peter Zijlstr

[RFC PATCH v7 for 4.15 02/10] membarrier: powerpc: Skip memory barrier in switch_mm()

2017-11-10 Thread Mathieu Desnoyers
E_EXPEDITED. Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Peter Zijlstra <pet...@infradead.org> CC: Paul E. McKenney <paul...@linux.vnet.ibm.com> CC: Boqun Feng <boqun.f...@gmail.com> CC: Andrew Hunter <a...@google.com> CC: Maged Michael <maged

[RFC PATCH for 4.15 2/6] membarrier: powerpc: Skip memory barrier in switch_mm() (v6)

2017-11-08 Thread Mathieu Desnoyers
) to switch_mm(), based on feedback from Nicholas Piggin. Changes since v5: - Rebase on v4.14-rc6. - Fold "Fix: membarrier: Handle CLONE_VM + !CLONE_THREAD correctly on powerpc (v2)" Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Peter Zijlstra <pet...@in

[RFC PATCH for 4.15 07/14] Restartable sequences: Wire up powerpc system call

2017-11-06 Thread Mathieu Desnoyers
u data compared to using load-reservation/store-conditional atomics. Signed-off-by: Boqun Feng <boqun.f...@gmail.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Benjamin Herrenschmidt <b...@kernel.crashing.org> CC: Paul Mackerras <pau...@samba.o

[RFC PATCH for 4.15 10/14] cpu_opv: Wire up powerpc system call

2017-11-06 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Benjamin Herrenschmidt <b...@kernel.crashing.org> CC: Paul Mackerras <pau...@samba.org> CC: Michael Ellerman <m...@ellerman.id.au> CC: Boqun Feng <boqun.f...@gmail.com> CC: Peter Zijlstra <

[RFC PATCH for 4.15 06/14] Restartable sequences: powerpc architecture support

2017-11-06 Thread Mathieu Desnoyers
ection. Signed-off-by: Boqun Feng <boqun.f...@gmail.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Benjamin Herrenschmidt <b...@kernel.crashing.org> CC: Paul Mackerras <pau...@samba.org> CC: Michael Ellerman <m...@ellerman.id.au> CC: Peter Zijlstr

[RFC PATCH for 4.15 08/14] Restartable sequences: Wire up powerpc system call

2017-10-12 Thread Mathieu Desnoyers
u data compared to using load-reservation/store-conditional atomics. Signed-off-by: Boqun Feng <boqun.f...@gmail.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Benjamin Herrenschmidt <b...@kernel.crashing.org> CC: Paul Mackerras <pau...@samba.o

[RFC PATCH for 4.15 07/14] Restartable sequences: powerpc architecture support

2017-10-12 Thread Mathieu Desnoyers
ection. Signed-off-by: Boqun Feng <boqun.f...@gmail.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Benjamin Herrenschmidt <b...@kernel.crashing.org> CC: Paul Mackerras <pau...@samba.org> CC: Michael Ellerman <m...@ellerman.id.au> CC: Peter Zijlstr

[RFC PATCH for 4.15 11/14] cpu_opv: Wire up powerpc system call

2017-10-12 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Benjamin Herrenschmidt <b...@kernel.crashing.org> CC: Paul Mackerras <pau...@samba.org> CC: Michael Ellerman <m...@ellerman.id.au> CC: Boqun Feng <boqun.f...@gmail.com> CC: Peter Zijlstra <

Re: [RFC PATCH for 4.14 1/2] membarrier: Remove unused code for architectures without membarrier hooks

2017-10-06 Thread Mathieu Desnoyers
- On Oct 6, 2017, at 5:08 PM, Paul E. McKenney paul...@linux.vnet.ibm.com wrote: > On Thu, Oct 05, 2017 at 06:33:26PM -0400, Mathieu Desnoyers wrote: >> Architectures without membarrier hooks don't need to emit the >> empty membarrier_arch_switch_mm() static inline when >&

[RFC PATCH for 4.14 1/2] membarrier: Remove unused code for architectures without membarrier hooks

2017-10-05 Thread Mathieu Desnoyers
Piggin <npig...@gmail.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Peter Zijlstra <pet...@infradead.org> CC: Paul E. McKenney <paul...@linux.vnet.ibm.com> CC: Boqun Feng <boqun.f...@gmail.com> CC: Andrew Hunter <a...@google.com> CC: Ma

[RFC PATCH v2 for 4.14 2/2] Fix: membarrier: Handle CLONE_VM + !CLONE_THREAD correctly on powerpc

2017-10-05 Thread Mathieu Desnoyers
to succeed. membarrier_arch_switch_mm() now tests for the MEMBARRIER_STATE_SWITCH_MM flag. Changes since v1: - Remove membarrier thread flag on powerpc (now unused). Reported-by: Peter Zijlstra <pet...@infradead.org> Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC:

Re: [RFC PATCH for 4.14 2/2] Fix: membarrier: Handle CLONE_VM + !CLONE_THREAD correctly on powerpc

2017-10-05 Thread Mathieu Desnoyers
- On Oct 5, 2017, at 5:40 PM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > Threads targeting the same VM but which belong to different thread > groups is a tricky case. It has a few consequences: > > It turns out that we cannot rely on get_nr_threads(p) to count

Re: [PATCH tip/core/rcu 1/3] membarrier: Provide register expedited private command

2017-10-05 Thread Mathieu Desnoyers
- On Oct 5, 2017, at 6:02 PM, Andrea Parri parri.and...@gmail.com wrote: > On Thu, Oct 05, 2017 at 04:02:06PM +0000, Mathieu Desnoyers wrote: >> - On Oct 5, 2017, at 8:12 AM, Peter Zijlstra pet...@infradead.org wrote: >> >> > On Wed, Oct 04, 2017 at 02:37:53PM

Re: [PATCH tip/core/rcu 1/3] membarrier: Provide register expedited private command

2017-10-05 Thread Mathieu Desnoyers
- On Oct 5, 2017, at 12:21 PM, Peter Zijlstra pet...@infradead.org wrote: > On Thu, Oct 05, 2017 at 04:02:06PM +0000, Mathieu Desnoyers wrote: >> - On Oct 5, 2017, at 8:12 AM, Peter Zijlstra pet...@infradead.org wrote: >> >> > On Wed, Oct 04, 2017 at 02:37:53PM

[RFC PATCH for 4.14 2/2] Fix: membarrier: Handle CLONE_VM + !CLONE_THREAD correctly on powerpc

2017-10-05 Thread Mathieu Desnoyers
to succeed. membarrier_arch_switch_mm() now tests for the MEMBARRIER_STATE_SWITCH_MM flag. Reported-by: Peter Zijlstra <pet...@infradead.org> Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Paul E. McKenney <paul...@linux.vnet.ibm.com> CC: Boqun Feng <

[RFC PATCH for 4.14 1/2] membarrier: Remove unused code for architectures without membarrier hooks

2017-10-05 Thread Mathieu Desnoyers
Piggin <npig...@gmail.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Peter Zijlstra <pet...@infradead.org> CC: Paul E. McKenney <paul...@linux.vnet.ibm.com> CC: Boqun Feng <boqun.f...@gmail.com> CC: Andrew Hunter <a...@google.com> CC: Ma

Re: [PATCH tip/core/rcu 1/3] membarrier: Provide register expedited private command

2017-10-05 Thread Mathieu Desnoyers
pin_unlock(>sighand->siglock); >> > + /* >> > + * Ensure all future scheduler executions will observe the new >> > + * thread flag state for this process. >> > + */ >> > + synchronize_sched(); >> >> This relies on the flag being read inside rq->lock, right? >> > > > +} -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [PATCH tip/core/rcu 1/3] membarrier: Provide register expedited private command

2017-10-05 Thread Mathieu Desnoyers
right? Yes. The flag is read by membarrier_arch_switch_mm(), invoked within switch_mm_irqs_off(), called by context_switch() before finish_task_switch() releases the rq lock. Is the comment clear enough, or do you have suggestions for improvements ? Thanks, Mathieu > > > +} -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [PATCH tip/core/rcu 1/3] membarrier: Provide register expedited private command

2017-10-05 Thread Mathieu Desnoyers
- On Oct 5, 2017, at 8:22 AM, Avi Kivity a...@scylladb.com wrote: > On 10/05/2017 07:23 AM, Nicholas Piggin wrote: >> On Wed, 4 Oct 2017 14:37:53 -0700 >> "Paul E. McKenney" <paul...@linux.vnet.ibm.com> wrote: >> >>> From: Mathieu Desnoyers &l

Re: [PATCH tip/core/rcu 1/3] membarrier: Provide register expedited private command

2017-10-05 Thread Mathieu Desnoyers
- On Oct 5, 2017, at 12:23 AM, Nicholas Piggin npig...@gmail.com wrote: > On Wed, 4 Oct 2017 14:37:53 -0700 > "Paul E. McKenney" <paul...@linux.vnet.ibm.com> wrote: > >> From: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> >> >> Pro

[PATCH v5 for 4.14 1/3] membarrier: Provide register expedited private command

2017-09-29 Thread Mathieu Desnoyers
ess in membarrier_private_expedited. Matches WRITE_ONCE() performed in process registration. Changes since v4: - Move powerpc hook from sched_in() to switch_mm(), based on feedback from Nicholas Piggin. Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Peter Zijl

[RFC PATCH for 4.14] membarrier powerpc: Move hook to switch_mm()

2017-09-28 Thread Mathieu Desnoyers
is aimed at Paul's tree. It applies on top of "membarrier: Provide register expedited private command (v4)" and "membarrier: Document scheduler barrier requirements (v4)". ] Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Peter Zijlstra <pet

Re: [PATCH v4 for 4.14 1/3] membarrier: Provide register expedited private command

2017-09-28 Thread Mathieu Desnoyers
- On Sep 28, 2017, at 12:16 PM, Nicholas Piggin npig...@gmail.com wrote: > On Thu, 28 Sep 2017 15:29:50 + (UTC) > Mathieu Desnoyers <mathieu.desnoy...@efficios.com> wrote: > >> - On Sep 28, 2017, at 11:01 AM, Nicholas Piggin npig...@gmail.com wrote: >> >

Re: [PATCH v4 for 4.14 1/3] membarrier: Provide register expedited private command

2017-09-28 Thread Mathieu Desnoyers
- On Sep 28, 2017, at 11:01 AM, Nicholas Piggin npig...@gmail.com wrote: > On Thu, 28 Sep 2017 13:31:36 + (UTC) > Mathieu Desnoyers <mathieu.desnoy...@efficios.com> wrote: > >> - On Sep 27, 2017, at 9:04 AM, Nicholas Piggin npig...@gmail.com wrote: >> >

Re: [PATCH v4 for 4.14 1/3] membarrier: Provide register expedited private command

2017-09-28 Thread Mathieu Desnoyers
- On Sep 27, 2017, at 9:04 AM, Nicholas Piggin npig...@gmail.com wrote: > On Tue, 26 Sep 2017 20:43:28 + (UTC) > Mathieu Desnoyers <mathieu.desnoy...@efficios.com> wrote: > >> - On Sep 26, 2017, at 1:51 PM, Mathieu Desnoyers >> mathieu.desnoy...@efficios.

Re: [PATCH v4 for 4.14 1/3] membarrier: Provide register expedited private command

2017-09-26 Thread Mathieu Desnoyers
- On Sep 26, 2017, at 1:51 PM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > Provide a new command allowing processes to register their intent to use > the private expedited command. > I missed a few maintainers that should have been CC'd. Adding them now. This patch

[PATCH v2 1/9] [picked] powerpc: allocate sys_membarrier system call number

2015-09-07 Thread Mathieu Desnoyers
Allow it to be used from SPU, since it should not have unwanted side-effects. [ Picked-by: Michael Ellerman <m...@ellerman.id.au> ] Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> CC: Andrew Morton <a...@linux-foundation.org> CC: linux-...@vger.kerne

Re: [RFC PATCH 1/9] powerpc: allocate sys_membarrier system call number

2015-08-31 Thread Mathieu Desnoyers
- On Aug 31, 2015, at 2:54 AM, Michael Ellerman m...@ellerman.id.au wrote: > On Thu, 2015-08-27 at 13:56 -0400, Mathieu Desnoyers wrote: >> Allow it to be used from SPU, since it should not have unwanted >> side-effects. >> >> [ Untested on this architecture. To t

[RFC PATCH 1/9] powerpc: allocate sys_membarrier system call number

2015-08-27 Thread Mathieu Desnoyers
Allow it to be used from SPU, since it should not have unwanted side-effects. [ Untested on this architecture. To try it out: fetch linux-next/akpm, apply this patch, build/run a membarrier-enabled kernel, and do make kselftest. ] Signed-off-by: Mathieu Desnoyers mathieu.desnoy

  1   2   >