[PATCH man-pages] Add rseq manpage

2018-12-06 Thread Mathieu Desnoyers
[ Michael, rseq(2) was merged into 4.18. Can you have a look at this patch which adds rseq documentation to the man-pages project ? ] Signed-off-by: Mathieu Desnoyers CC: "Paul E. McKenney" CC: Peter Zijlstra CC: Paul Turner CC: Thomas Gleixner CC: Andy Lutomirski CC: Andi Kleen

Re: [RFC PATCH v4 1/5] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-12-05 Thread Mathieu Desnoyers
- On Nov 26, 2018, at 12:07 PM, Rich Felker dal...@libc.org wrote: > On Mon, Nov 26, 2018 at 11:30:51AM -0500, Mathieu Desnoyers wrote: >> - On Nov 26, 2018, at 10:51 AM, Mathieu Desnoyers >> mathieu.desnoy...@efficios.com wrote: >> >> > - On Nov

Re: [RFC PATCH glibc 1/4] glibc: Perform rseq(2) registration at nptl init and thread creation (v4)

2018-12-04 Thread Mathieu Desnoyers
- On Dec 4, 2018, at 2:44 PM, Florian Weimer fwei...@redhat.com wrote: > * Mathieu Desnoyers: > >> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist >> b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist >> index c370fda73d..9da78d59d2 100644 &g

[RFC PATCH glibc 1/4] glibc: Perform rseq(2) registration at nptl init and thread creation (v4)

2018-12-04 Thread Mathieu Desnoyers
ystem call was merged into Linux 4.18. Signed-off-by: Mathieu Desnoyers CC: Carlos O'Donell CC: Florian Weimer CC: Joseph Myers CC: Szabolcs Nagy CC: Thomas Gleixner CC: Ben Maurer CC: Peter Zijlstra CC: "Paul E. McKenney" CC: Boqun Feng CC: Will Deacon CC: Dave Watson CC: P

[RFC PATCH glibc 2/4] glibc: sched_getcpu(): use rseq cpu_id TLS on Linux

2018-12-04 Thread Mathieu Desnoyers
rseq: 2.5 ns (speedup: 5.5x) inline load cpuid from __rseq_abi TLS: 0.8 ns (speedup: 17.1x) Signed-off-by: Mathieu Desnoyers CC: Carlos O'Donell CC: Florian Weimer CC: Joseph Myers CC: Szabolcs Nagy CC: Thomas Gleixner CC: Ben Maurer CC: Peter Zijlstra CC: "Paul E. McK

Re: [RFC PATCH v4 1/5] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-12-03 Thread Mathieu Desnoyers
- On Nov 26, 2018, at 2:22 PM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > - On Nov 26, 2018, at 12:10 PM, Rich Felker dal...@libc.org wrote: > >> On Mon, Nov 26, 2018 at 05:03:02PM +0100, Florian Weimer wrote: >>> * Mathieu Desnoyers: >>>

Re: [RFC PATCH v4 1/5] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-11-26 Thread Mathieu Desnoyers
- On Nov 26, 2018, at 12:10 PM, Rich Felker dal...@libc.org wrote: > On Mon, Nov 26, 2018 at 05:03:02PM +0100, Florian Weimer wrote: >> * Mathieu Desnoyers: >> >> > So let's make __rseq_abi and __rseq_refcount strong symbols then ? >> >> Yes, plea

Re: [RFC PATCH v4 1/5] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-11-26 Thread Mathieu Desnoyers
- On Nov 26, 2018, at 10:51 AM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > - On Nov 26, 2018, at 3:28 AM, Florian Weimer fwei...@redhat.com wrote: > >> * Mathieu Desnoyers: >> >>> Using a "weak" symbol in early adopter libraries is

Re: [RFC PATCH v4 1/5] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-11-26 Thread Mathieu Desnoyers
- On Nov 26, 2018, at 3:28 AM, Florian Weimer fwei...@redhat.com wrote: > * Mathieu Desnoyers: > >> Using a "weak" symbol in early adopter libraries is important, so they >> can be loaded together into the same process without causing loader >> errors d

Re: [RFC PATCH v4 1/5] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-11-23 Thread Mathieu Desnoyers
- On Nov 23, 2018, at 1:35 PM, Rich Felker dal...@libc.org wrote: > On Fri, Nov 23, 2018 at 12:52:21PM -0500, Mathieu Desnoyers wrote: >> - On Nov 23, 2018, at 12:30 PM, Rich Felker dal...@libc.org wrote: >> >> > On Fri, Nov 23, 2018 at 12:05:20PM -0500,

Re: [RFC PATCH v4 1/5] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-11-23 Thread Mathieu Desnoyers
- On Nov 23, 2018, at 12:30 PM, Rich Felker dal...@libc.org wrote: > On Fri, Nov 23, 2018 at 12:05:20PM -0500, Mathieu Desnoyers wrote: >> - On Nov 23, 2018, at 9:28 AM, Rich Felker dal...@libc.org wrote: >> [...] >> > >> > Absolutely. As long as i

Re: [RFC PATCH v4 1/5] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-11-23 Thread Mathieu Desnoyers
where the signal handler nests over thread's execution ? This includes early start and just before invoking the exit system call. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH v4 1/5] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-11-22 Thread Mathieu Desnoyers
- On Nov 22, 2018, at 2:01 PM, Rich Felker dal...@libc.org wrote: > On Thu, Nov 22, 2018 at 01:35:44PM -0500, Mathieu Desnoyers wrote: >> - On Nov 22, 2018, at 11:24 AM, Szabolcs Nagy szabolcs.n...@arm.com >> wrote: >> >> > On 22/11/18 15:33, Mathieu Desno

Re: [RFC PATCH v4 1/5] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-11-22 Thread Mathieu Desnoyers
- On Nov 22, 2018, at 11:24 AM, Szabolcs Nagy szabolcs.n...@arm.com wrote: > On 22/11/18 15:33, Mathieu Desnoyers wrote: >> - On Nov 22, 2018, at 10:21 AM, Florian Weimer fwei...@redhat.com wrote: >>> Right, but in case of user-supplied stacks, we actual

Re: [RFC PATCH v4 1/5] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-11-22 Thread Mathieu Desnoyers
- On Nov 22, 2018, at 11:59 AM, Florian Weimer fwei...@redhat.com wrote: > * Mathieu Desnoyers: > >> - On Nov 22, 2018, at 11:28 AM, Florian Weimer fwei...@redhat.com wrote: >> >>> * Mathieu Desnoyers: >>> >>>> Here is one scenario: we

Re: [RFC PATCH v4 1/5] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-11-22 Thread Mathieu Desnoyers
- On Nov 22, 2018, at 11:28 AM, Florian Weimer fwei...@redhat.com wrote: > * Mathieu Desnoyers: > >> Here is one scenario: we have 2 early adopter libraries using rseq which >> are deployed in an environment with an older glibc (which does not >> support rseq). >&g

Re: [RFC PATCH v4 1/5] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-11-22 Thread Mathieu Desnoyers
- On Nov 22, 2018, at 10:14 AM, Rich Felker dal...@libc.org wrote: > On Thu, Nov 22, 2018 at 10:04:16AM -0500, Mathieu Desnoyers wrote: >> - On Nov 22, 2018, at 9:36 AM, Rich Felker dal...@libc.org wrote: >> >> > On Wed, Nov 21, 2018 at 01:39:32PM -0500,

Re: [RFC PATCH v4 1/5] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-11-22 Thread Mathieu Desnoyers
- On Nov 22, 2018, at 10:21 AM, Florian Weimer fwei...@redhat.com wrote: > * Rich Felker: > >> On Thu, Nov 22, 2018 at 04:11:45PM +0100, Florian Weimer wrote: >>> * Mathieu Desnoyers: >>> >>> > Thoughts ? >>> > >>>

Re: [RFC PATCH v4 1/5] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-11-22 Thread Mathieu Desnoyers
- On Nov 22, 2018, at 9:36 AM, Rich Felker dal...@libc.org wrote: > On Wed, Nov 21, 2018 at 01:39:32PM -0500, Mathieu Desnoyers wrote: >> Register rseq(2) TLS for each thread (including main), and unregister >> for each thread (excluding main). "rseq" stands for

[RFC PATCH v4 2/5] glibc: sched_getcpu(): use rseq cpu_id TLS on Linux

2018-11-21 Thread Mathieu Desnoyers
rseq: 2.5 ns (speedup: 5.5x) inline load cpuid from __rseq_abi TLS: 0.8 ns (speedup: 17.1x) Signed-off-by: Mathieu Desnoyers CC: Carlos O'Donell CC: Florian Weimer CC: Joseph Myers CC: Szabolcs Nagy CC: Thomas Gleixner CC: Ben Maurer CC: Peter Zijlstra CC: "Paul E. McK

[RFC PATCH v4 1/5] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-11-21 Thread Mathieu Desnoyers
ystem call was merged into Linux 4.18. Signed-off-by: Mathieu Desnoyers CC: Carlos O'Donell CC: Florian Weimer CC: Joseph Myers CC: Szabolcs Nagy CC: Thomas Gleixner CC: Ben Maurer CC: Peter Zijlstra CC: "Paul E. McKenney" CC: Boqun Feng CC: Will Deacon CC: Dave Watson CC: Paul

Re: [PATCH 1/1] stackleak: Disable ftrace for stackleak.c

2018-11-12 Thread Mathieu Desnoyers
ckleak_track_stack() as that may be very interesting to trace. > > I think it is not enough for stopping kprobes. If you want to stop the kprobes > (int3 version) on stackleak_erase(), you should use > NOKPROBE_SYMBOL(stackleak_erase), > since kprobes can work without ftrace. Just to clarify: AFAIU you guys are recommending to add _both_ a "notrace" annotation to stackleak_erase() _and_ a NOKPROBE_SYMBOL(stackleak_erase), so neither function tracing nor kprobes can hook on that function. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [PATCH tip/core/rcu 0/41] More RCU flavor consolidation cleanup for v4.21/v5.0

2018-11-12 Thread Mathieu Desnoyers
ng RCU from post-4.21 kernels back to older kernels. I fear that newer code will build just fine on older kernels, but will spectacularly fail in hard-to-debug ways at runtime. Renaming synchronize_rcu() and call_rcu() to something that did not exist in prior kernels would prevent that. It may no

Re: [RFC PATCH 1/2] glibc: Perform rseq(2) registration at nptl init and thread creation (v3)

2018-11-02 Thread Mathieu Desnoyers
- On Nov 2, 2018, at 4:20 PM, Andy Lutomirski l...@amacapital.net wrote: > On Fri, Nov 2, 2018 at 4:53 AM Mathieu Desnoyers > wrote: >> >> Here is a third round of prototype registering rseq(2) TLS for each >> thread (including main), and unregistering for each t

Supporting core-specific instruction sets (e.g. big.LITTLE) with restartable sequences

2018-11-02 Thread Mathieu Desnoyers
on the big core. Thoughts ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

[RFC PATCH 1/2] glibc: Perform rseq(2) registration at nptl init and thread creation (v3)

2018-11-02 Thread Mathieu Desnoyers
non-x86-64 architectures. Signed-off-by: Mathieu Desnoyers CC: Carlos O'Donell CC: Florian Weimer CC: Joseph Myers CC: Szabolcs Nagy CC: Thomas Gleixner CC: Ben Maurer CC: Peter Zijlstra CC: "Paul E. McKenney" CC: Boqun Feng CC: Will Deacon CC: Dave Watson CC: Paul Turner CC: libc-

[RFC PATCH 2/2] glibc: sched_getcpu(): use rseq cpu_id TLS on Linux

2018-11-02 Thread Mathieu Desnoyers
rseq: 2.5 ns (speedup: 5.5x) inline load cpuid from __rseq_abi TLS: 0.8 ns (speedup: 17.1x) Signed-off-by: Mathieu Desnoyers CC: Carlos O'Donell CC: Florian Weimer CC: Joseph Myers CC: Szabolcs Nagy CC: Thomas Gleixner CC: Ben Maurer CC: Peter Zijlstra CC: "Paul E. McK

Re: [RFC PATCH for 4.21 03/16] mm: Replace BUG_ON() by WARN_ON() in vm_unmap_ram()

2018-11-01 Thread Mathieu Desnoyers
- On Nov 1, 2018, at 11:00 PM, Linus Torvalds torva...@linux-foundation.org wrote: > On Thu, Nov 1, 2018 at 12:57 PM Mathieu Desnoyers > wrote: >> >> > I think the graceful recovery is to simply return: >> > >> > if (WARN_ON(cond)) >> >

Re: [RFC PATCH for 4.21 03/16] mm: Replace BUG_ON() by WARN_ON() in vm_unmap_ram()

2018-11-01 Thread Mathieu Desnoyers
- On Nov 1, 2018, at 7:46 PM, rostedt rost...@goodmis.org wrote: > On Thu, 1 Nov 2018 13:21:12 +0100 (CET) > Thomas Gleixner wrote: > >> Mathieu, >> >> On Thu, 1 Nov 2018, Mathieu Desnoyers wrote: >> >> > It is encouraged to warn and return rather

[RFC PATCH for 4.21 16/16] cpu-opv/selftests: Provide Makefile, scripts, gitignore

2018-11-01 Thread Mathieu Desnoyers
A run_param_test.sh script runs many variants of the parametrizable tests. Wire up the cpu-opv Makefile, add directory entry into MAINTAINERS file. Signed-off-by: Mathieu Desnoyers Cc: Thomas Gleixner Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Catalin Marinas Cc: Dave Watson Cc: Will Deacon

[RFC PATCH for 4.21 15/16] cpu-opv/selftests: Provide parametrized tests

2018-11-01 Thread Mathieu Desnoyers
e benchmarks. "param_test_compare_twice" is the same as "param_test", but it performs each comparison within rseq critical section twice, thus validating invariants. If any of the second comparisons fails, an error message is printed and the test aborts. Signed-off-by: Mathieu Desnoyers

[RFC PATCH for 4.21 12/16] cpu-opv/selftests: Provide basic test

2018-11-01 Thread Mathieu Desnoyers
"basic_cpu_opv_test" tests basic functionality of cpu_opv. Signed-off-by: Mathieu Desnoyers Cc: Thomas Gleixner Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Catalin Marinas Cc: Dave Watson Cc: Will Deacon Cc: Shuah Khan Cc: Andi Kleen Cc: linux-kselft...@vger.kernel.org Cc: "

[RFC PATCH for 4.21 13/16] cpu-opv/selftests: Provide percpu_op API

2018-11-01 Thread Mathieu Desnoyers
= percpu_current_cpu(); ret = percpu_addv(>c[cpu].count, 1, cpu); if (unlikely(ret)) { perror("percpu_addv"); return -1; } return 0; Signed-off-by: Mathieu Desnoyers CC: Shuah Khan CC: Russell King CC: Catalin Marinas CC: Will Deacon CC: Thomas Gleixner CC

[RFC PATCH for 4.21 14/16] cpu-opv/selftests: Provide basic percpu ops test

2018-11-01 Thread Mathieu Desnoyers
"basic_percpu_ops_test" implements a few simple per-cpu operations and testing their correctness. Signed-off-by: Mathieu Desnoyers CC: Thomas Gleixner Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Catalin Marinas Cc: Dave Watson Cc: Will Deacon Cc: Shuah Khan Cc: Andi Kleen Cc: li

[RFC PATCH for 4.21 11/16] cpu-opv/selftests: Provide cpu-op library

2018-11-01 Thread Mathieu Desnoyers
This cpu-op helper library provides a user-space API to the cpu_opv() system call. Signed-off-by: Mathieu Desnoyers Cc: Thomas Gleixner Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Catalin Marinas Cc: Dave Watson Cc: Will Deacon Cc: Shuah Khan Cc: Andi Kleen Cc: linux-kselft

[RFC PATCH for 4.21 10/16] arm: Wire up cpu_opv system call

2018-11-01 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers CC: Russell King CC: Catalin Marinas CC: Will Deacon CC: Thomas Gleixner CC: Paul Turner CC: Peter Zijlstra CC: Andy Lutomirski CC: Andi Kleen CC: Dave Watson CC: Chris Lameter CC: Ingo Molnar CC: Ben Maurer CC: Steven Rostedt CC: "Paul E. McK

[RFC PATCH for 4.21 07/16] cpu_opv: limit amount of virtual address space used by cpu_opv

2018-11-01 Thread Mathieu Desnoyers
Introduce sysctl cpu_opv_va_max_bytes, which limits the amount of virtual address space that can be used by cpu_opv. Its default value is the maximum amount of virtual address space which can be used by a single cpu_opv system call (e.g. 64 kB on x86). Signed-off-by: Mathieu Desnoyers CC: "

[RFC PATCH for 4.21 08/16] x86: Wire up cpu_opv system call

2018-11-01 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers CC: "Paul E. McKenney" CC: Peter Zijlstra CC: Paul Turner CC: Thomas Gleixner CC: Andy Lutomirski CC: Andi Kleen CC: Dave Watson CC: Chris Lameter CC: Ingo Molnar CC: "H. Peter Anvin" CC: Ben Maurer CC: Steven Rostedt CC: Josh

[RFC PATCH for 4.21 03/16] mm: Replace BUG_ON() by WARN_ON() in vm_unmap_ram()

2018-11-01 Thread Mathieu Desnoyers
It is encouraged to warn and return rather than use BUG_ON() when the condition can be recovered from in ways that are more graceful than halting the whole system. Signed-off-by: Mathieu Desnoyers Suggested-by: Steven Rostedt CC: Sergey Senozhatsky CC: Matthew Wilcox CC: "Paul E. McK

[RFC PATCH for 4.21 05/16] mm: Provide is_vma_noncached

2018-11-01 Thread Mathieu Desnoyers
Provide is_vma_noncached() static inline to allow generic code to check whether the given vma consists of noncached memory. Signed-off-by: Mathieu Desnoyers CC: "Paul E. McKenney" CC: Peter Zijlstra CC: Paul Turner CC: Thomas Gleixner CC: Andy Lutomirski CC: Andi Kleen CC: Dave

[RFC PATCH for 4.21 06/16] cpu_opv: Provide cpu_opv system call (v9)

2018-11-01 Thread Mathieu Desnoyers
me CPU and use rseq. In the unlikely event of a migration, the cpu_opv system call will ensure the commit can be performed on the right CPU by migrating the task to that CPU. On the consumer side, an alternative to using store-release and load-acquire on the commit counter would be to use cpu_opv to e

[RFC PATCH for 4.21 04/16] mm: Introduce vm_map_user_ram, vm_unmap_user_ram (v2)

2018-11-01 Thread Mathieu Desnoyers
and userspace mappings for virtually aliased architectures. Signed-off-by: Mathieu Desnoyers Reviewed-by: Matthew Wilcox CC: "Paul E. McKenney" CC: Peter Zijlstra CC: Paul Turner CC: Thomas Gleixner CC: Andy Lutomirski CC: Andi Kleen CC: Dave Watson CC: Chris Lameter CC: Ingo Molnar CC:

[RFC PATCH for 4.21 01/16] rseq/selftests: Expose reference counter to coexist with glibc (v2)

2018-11-01 Thread Mathieu Desnoyers
for the most early/late user for each thread, thus ensuring that rseq is registered across the lifetime of all rseq users for a given thread. Signed-off-by: Mathieu Desnoyers CC: Shuah Khan CC: Carlos O'Donell CC: Florian Weimer CC: Joseph Myers CC: Szabolcs Nagy CC: Thomas Gleixner CC: Ben

[RFC PATCH for 4.21 02/16] rseq/selftests: Adapt number of threads to the number of detected cpus

2018-11-01 Thread Mathieu Desnoyers
On smaller systems, running a test with 200 threads can take a long time on machines with smaller number of CPUs. Detect the number of online cpus at test runtime, and multiply that by 6 to have 6 rseq threads per cpu preempting each other. Signed-off-by: Mathieu Desnoyers Cc: Shuah Khan Cc

[RFC PATCH for 4.21 00/16] rseq updates, new cpu_opv system call (v2)

2018-11-01 Thread Mathieu Desnoyers
v system call (there is enough space on the stack). Add a new flag allowing user-space to query the maximum vector size supported by the kernel for future extensibility. Feedback is welcome! Thanks, Mathieu Mathieu Desnoyers (16): rseq/selftests: Expose reference counter to coexist with

Re: [PATCH 14/17] prmem: llist, hlist, both plain and rcu

2018-10-24 Thread Mathieu Desnoyers
n > CC: Philippe Ombredanne > CC: "Paul E. McKenney" > CC: Josh Triplett > CC: Steven Rostedt > CC: Mathieu Desnoyers > CC: Lai Jiangshan > CC: linux-kernel@vger.kernel.org > --- > MAINTAINERS| 1 + > include/linux/prlist.h | 934 +

Re: [RFC PATCH for 4.21 01/16] rseq/selftests: Add reference counter to coexist with glibc

2018-10-23 Thread Mathieu Desnoyers
- On Oct 12, 2018, at 10:59 AM, Szabolcs Nagy szabolcs.n...@arm.com wrote: > On 11/10/18 20:42, Mathieu Desnoyers wrote: >> - On Oct 11, 2018, at 1:04 PM, Szabolcs Nagy szabolcs.n...@arm.com wrote: >> >>> On 11/10/18 17:37, Mathieu Desnoyers wrote: >>>>

Re: [RFC PATCH for 4.21 06/16] cpu_opv: Provide cpu_opv system call (v8)

2018-10-17 Thread Mathieu Desnoyers
- On Oct 17, 2018, at 11:11 AM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > - On Oct 17, 2018, at 3:19 AM, Srikar Dronamraju sri...@linux.vnet.ibm.com > wrote: > >> Hi Mathieu, >> >>> +static int do_cpu_opv(struct cpu_op *cpuop, int cpuopcnt

Re: [RFC PATCH for 4.21 06/16] cpu_opv: Provide cpu_opv system call (v8)

2018-10-17 Thread Mathieu Desnoyers
ead(>mmap_sem); >> +return ret; >> + >> +check_online: >> +/* >> + * push_task_to_cpu() returns -EINVAL if the requested cpu is not part >> + * of the current thread's cpus_allowed mask. >> + */ >> +if (ret == -EINVAL) >> +return ret; >> +get_online_cpus(); >> +if (cpu_online(cpu)) { >> +put_online_cpus(); >> +goto retry; > > + } -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH for 4.21 03/16] sched: Implement push_task_to_cpu (v2)

2018-10-17 Thread Mathieu Desnoyers
t I think of it, we may not need to migrate the task at all. Now that cpu_opv implementation takes a temporary vmap() of the user-space pages, we can touch that virtual address range from interrupt context from another CPU. So cpu_opv can simply execute the vector of operations in IPI context rather than do all this silly dance with migration. Thoughts ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH for 4.21 04/16] mm: Introduce vm_map_user_ram, vm_unmap_user_ram

2018-10-17 Thread Mathieu Desnoyers
- On Oct 17, 2018, at 11:00 AM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > - On Oct 16, 2018, at 8:27 PM, Sergey Senozhatsky > sergey.senozhatsky.w...@gmail.com wrote: > >> On (10/16/18 14:30), Steven Rostedt wrote: >>> > +void vm_unmap_user_ra

Re: [RFC PATCH for 4.21 04/16] mm: Introduce vm_map_user_ram, vm_unmap_user_ram

2018-10-17 Thread Mathieu Desnoyers
why all these BUG_ON's can't be turned >> into: > > +1 > >> if (WARN_ON(x)) >> return; > > Given that this somewhat MM-related, I'd may be say VM_WARN_ON(). Good point, will do! So I'll do one cleanup patch for vm_unmap_ram(), and I'll modify the new vm_unmap_user_ram(). Thanks, Mathieu > > -ss -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH for 4.21 04/16] mm: Introduce vm_map_user_ram, vm_unmap_user_ram

2018-10-16 Thread Mathieu Desnoyers
- On Oct 16, 2018, at 2:30 PM, rostedt rost...@goodmis.org wrote: > On Wed, 10 Oct 2018 15:19:24 -0400 > Mathieu Desnoyers wrote: > >> + * vm_unmap_user_ram - unmap linear kernel address space set up by >> vm_map_user_ram >> + * @mem: the pointer returned by vm

Re: [RFC PATCH for 4.21 06/16] cpu_opv: Provide cpu_opv system call (v8)

2018-10-16 Thread Mathieu Desnoyers
- On Oct 16, 2018, at 4:10 AM, Sergey Senozhatsky sergey.senozhatsky.w...@gmail.com wrote: > Hi Mathieu, > > On (10/10/18 15:19), Mathieu Desnoyers wrote: > [..] >> +SYSCALL_DEFINE4(cpu_opv, struct cpu_op __user *, ucpuopv, int, cpuopcnt, >> +

rseq system call incompletely wired up in microblaze

2018-10-14 Thread Mathieu Desnoyers
system call Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky Also, please make sure the tools/testing/selftests/rseq/ tests pass before pushing a commit enabling it for your architecture. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

[PATCH for 4.19] tracepoint: Fix: tracepoint array element size mismatch

2018-10-13 Thread Mathieu Desnoyers
rc kernels, and should ideally be fixed before the end of the rc cycle. Signed-off-by: Mathieu Desnoyers Acked-by: Ard Biesheuvel Link: http://lkml.kernel.org/r/20180704083651.24360-7-ard.biesheu...@linaro.org Cc: Michael Ellerman Cc: Ingo Molnar Cc: Steven Rostedt (VMware) Cc: Ard Biesheuvel

Re: [PATCH for 4.19] tracepoint: Fix: out-of-bound tracepoint array iteration

2018-10-13 Thread Mathieu Desnoyers
- On Oct 13, 2018, at 2:34 PM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > - On Oct 13, 2018, at 11:24 AM, Ard Biesheuvel ard.biesheu...@linaro.org > wrote: > >> On 12 October 2018 at 23:07, Ard Biesheuvel >> wrote: >>> Hi Mathieu, >&

Re: [PATCH for 4.19] tracepoint: Fix: out-of-bound tracepoint array iteration

2018-10-13 Thread Mathieu Desnoyers
- On Oct 13, 2018, at 11:24 AM, Ard Biesheuvel ard.biesheu...@linaro.org wrote: > On 12 October 2018 at 23:07, Ard Biesheuvel wrote: >> Hi Mathieu, >> >> On 12 October 2018 at 22:05, Mathieu Desnoyers >> wrote: >>> commit 46e0c9be206f ("kern

Re: [PATCH for 4.19] tracepoint: Fix: out-of-bound tracepoint array iteration

2018-10-12 Thread Mathieu Desnoyers
- On Oct 12, 2018, at 4:05 PM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > commit 46e0c9be206f ("kernel: tracepoints: add support for relative > references") changes the layout of the __tracepoint_ptrs section on > architectures supporting relative reference

[PATCH for 4.19] tracepoint: Fix: out-of-bound tracepoint array iteration

2018-10-12 Thread Mathieu Desnoyers
epoint_range() implementation. This issue appears in 4.19-rc kernels, and should ideally be fixed before the end of the rc cycle. Signed-off-by: Mathieu Desnoyers Link: http://lkml.kernel.org/r/20180704083651.24360-7-ard.biesheu...@linaro.org Cc: Michael Ellerman Cc: Ingo Molnar Cc: Steven Rost

Re: [RFC PATCH for 4.21 01/16] rseq/selftests: Add reference counter to coexist with glibc

2018-10-11 Thread Mathieu Desnoyers
- On Oct 11, 2018, at 1:04 PM, Szabolcs Nagy szabolcs.n...@arm.com wrote: > On 11/10/18 17:37, Mathieu Desnoyers wrote: >> - On Oct 11, 2018, at 12:20 PM, Szabolcs Nagy szabolcs.n...@arm.com >> wrote: >>> On 11/10/18 16:13, Mathieu Desnoyers wrote: >>>&g

Re: [RFC PATCH for 4.21 01/16] rseq/selftests: Add reference counter to coexist with glibc

2018-10-11 Thread Mathieu Desnoyers
- On Oct 11, 2018, at 12:20 PM, Szabolcs Nagy szabolcs.n...@arm.com wrote: > On 11/10/18 16:13, Mathieu Desnoyers wrote: >> - On Oct 11, 2018, at 6:37 AM, Szabolcs Nagy szabolcs.n...@arm.com wrote: >> >>> On 10/10/18 20:19, Mathieu Desnoyers wrote: >>

Re: [RFC PATCH for 4.21 01/16] rseq/selftests: Add reference counter to coexist with glibc

2018-10-11 Thread Mathieu Desnoyers
- On Oct 11, 2018, at 6:37 AM, Szabolcs Nagy szabolcs.n...@arm.com wrote: > On 10/10/18 20:19, Mathieu Desnoyers wrote: >> In order to integrate rseq into user-space applications, add a reference >> counter field after the struct rseq TLS ABI so many rseq users can be >>

[RFC PATCH for 4.21 08/16] x86: Wire up cpu_opv system call

2018-10-10 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers CC: "Paul E. McKenney" CC: Peter Zijlstra CC: Paul Turner CC: Thomas Gleixner CC: Andy Lutomirski CC: Andi Kleen CC: Dave Watson CC: Chris Lameter CC: Ingo Molnar CC: "H. Peter Anvin" CC: Ben Maurer CC: Steven Rostedt CC: Josh

[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-...@lists.ozlabs.org --- arch/powerpc/include/asm/systbl.h | 1 + arch/powerpc/include/uapi/asm/unistd.

[RFC PATCH for 4.21 03/16] sched: Implement push_task_to_cpu (v2)

2018-10-10 Thread Mathieu Desnoyers
executes. Code invoking push_task_to_cpu() must be prepared to retry in that case. Signed-off-by: Mathieu Desnoyers CC: "Paul E. McKenney" CC: Peter Zijlstra CC: Paul Turner CC: Thomas Gleixner CC: Andy Lutomirski CC: Andi Kleen CC: Dave Watson CC: Chris Lameter CC: Ingo Moln

[RFC PATCH for 4.21 07/16] cpu_opv: limit amount of virtual address space used by cpu_opv

2018-10-10 Thread Mathieu Desnoyers
Introduce sysctl cpu_opv_va_max_bytes, which limits the amount of virtual address space that can be used by cpu_opv. Its default value is the maximum amount of virtual address space which can be used by a single cpu_opv system call (256 kB on x86). Signed-off-by: Mathieu Desnoyers CC: "P

[RFC PATCH for 4.21 04/16] mm: Introduce vm_map_user_ram, vm_unmap_user_ram

2018-10-10 Thread Mathieu Desnoyers
and userspace mappings for virtually aliased architectures. Signed-off-by: Mathieu Desnoyers Reviewed-by: Matthew Wilcox CC: "Paul E. McKenney" CC: Peter Zijlstra CC: Paul Turner CC: Thomas Gleixner CC: Andy Lutomirski CC: Andi Kleen CC: Dave Watson CC: Chris Lameter CC: Ingo Molnar CC:

[RFC PATCH for 4.21 14/16] cpu-opv/selftests: Provide basic percpu ops test

2018-10-10 Thread Mathieu Desnoyers
"basic_percpu_ops_test" implements a few simple per-cpu operations and testing their correctness. Signed-off-by: Mathieu Desnoyers CC: Thomas Gleixner Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Catalin Marinas Cc: Dave Watson Cc: Will Deacon Cc: Shuah Khan Cc: Andi Kleen Cc: li

[RFC PATCH for 4.21 10/16] arm: Wire up cpu_opv system call

2018-10-10 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers CC: Russell King CC: Catalin Marinas CC: Will Deacon CC: Thomas Gleixner CC: Paul Turner CC: Peter Zijlstra CC: Andy Lutomirski CC: Andi Kleen CC: Dave Watson CC: Chris Lameter CC: Ingo Molnar CC: Ben Maurer CC: Steven Rostedt CC: "Paul E. McK

[RFC PATCH for 4.21 16/16] cpu-opv/selftests: Provide Makefile, scripts, gitignore

2018-10-10 Thread Mathieu Desnoyers
A run_param_test.sh script runs many variants of the parametrizable tests. Wire up the cpu-opv Makefile, add directory entry into MAINTAINERS file. Signed-off-by: Mathieu Desnoyers Cc: Thomas Gleixner Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Catalin Marinas Cc: Dave Watson Cc: Will Deacon

[RFC PATCH for 4.21 00/16] rseq updates, new cpu_opv system call

2018-10-10 Thread Mathieu Desnoyers
interfering with cpu affinity masks, and using rseq from signal handlers nested between thread creation and rseq registration by glibc, or between rseq unregistration by glibc and thread teardown. Thanks, Mathieu Mathieu Desnoyers (16): rseq/selftests: Add reference counter to coexist with glibc

[RFC PATCH for 4.21 06/16] cpu_opv: Provide cpu_opv system call (v8)

2018-10-10 Thread Mathieu Desnoyers
formed on the same per-cpu ring buffer, even if a migration happens between those operations. In the typical case, both operations will happens on the same CPU and use rseq. In the unlikely event of a migration, the cpu_opv system call will ensure the commit can be performed on the right CPU by migrating

[RFC PATCH for 4.21 13/16] cpu-opv/selftests: Provide percpu_op API

2018-10-10 Thread Mathieu Desnoyers
= percpu_current_cpu(); ret = percpu_addv(>c[cpu].count, 1, cpu); if (unlikely(ret)) { perror("percpu_addv"); return -1; } return 0; Signed-off-by: Mathieu Desnoyers CC: Shuah Khan CC: Russell King CC: Catalin Marinas CC: Will Deacon CC: Thomas Gleixner CC

[RFC PATCH for 4.21 02/16] rseq/selftests: Adapt number of threads to the number of detected cpus

2018-10-10 Thread Mathieu Desnoyers
On smaller systems, running a test with 200 threads can take a long time on machines with smaller number of CPUs. Detect the number of online cpus at test runtime, and multiply that by 6 to have 6 rseq threads per cpu preempting each other. Signed-off-by: Mathieu Desnoyers Cc: Shuah Khan Cc

[RFC PATCH for 4.21 12/16] cpu-opv/selftests: Provide basic test

2018-10-10 Thread Mathieu Desnoyers
"basic_cpu_opv_test" tests basic functionality of cpu_opv. Signed-off-by: Mathieu Desnoyers Cc: Thomas Gleixner Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Catalin Marinas Cc: Dave Watson Cc: Will Deacon Cc: Shuah Khan Cc: Andi Kleen Cc: linux-kselft...@vger.kernel.org Cc: "

[RFC PATCH for 4.21 05/16] mm: Provide is_vma_noncached

2018-10-10 Thread Mathieu Desnoyers
Provide is_vma_noncached() static inline to allow generic code to check whether the given vma consists of noncached memory. Signed-off-by: Mathieu Desnoyers CC: "Paul E. McKenney" CC: Peter Zijlstra CC: Paul Turner CC: Thomas Gleixner CC: Andy Lutomirski CC: Andi Kleen CC: Dave

[RFC PATCH for 4.21 11/16] cpu-opv/selftests: Provide cpu-op library

2018-10-10 Thread Mathieu Desnoyers
This cpu-op helper library provides a user-space API to the cpu_opv() system call. Signed-off-by: Mathieu Desnoyers Cc: Thomas Gleixner Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Catalin Marinas Cc: Dave Watson Cc: Will Deacon Cc: Shuah Khan Cc: Andi Kleen Cc: linux-kselft

[RFC PATCH for 4.21 15/16] cpu-opv/selftests: Provide parametrized tests

2018-10-10 Thread Mathieu Desnoyers
e benchmarks. "param_test_compare_twice" is the same as "param_test", but it performs each comparison within rseq critical section twice, thus validating invariants. If any of the second comparisons fails, an error message is printed and the test aborts. Signed-off-by: Mathieu Desnoyers

[RFC PATCH for 4.21 01/16] rseq/selftests: Add reference counter to coexist with glibc

2018-10-10 Thread Mathieu Desnoyers
struct rseq is an ABI between user-space executable and libraries, but the kernel does not care about that field, so it is not part of the Linux uapi. Signed-off-by: Mathieu Desnoyers CC: Shuah Khan CC: Carlos O'Donell CC: Florian Weimer CC: Joseph Myers CC: Szabolcs Nagy CC: Thomas Gleixner CC

[RFC PATCH v2] glibc: Perform rseq(2) registration at nptl init and thread creation (v2)

2018-10-09 Thread Mathieu Desnoyers
NEWS entry. - Update ABI test baselines. - Update abilist for non-x86-64 architectures. Signed-off-by: Mathieu Desnoyers CC: Carlos O'Donell CC: Florian Weimer CC: Joseph Myers CC: Szabolcs Nagy CC: Thomas Gleixner CC: Ben Maurer CC: Peter Zijlstra CC: "Paul E. McKenney" CC: Boqun F

[PATCH backport for 4.18] rseq/selftests: fix parametrized test with -fpie

2018-10-04 Thread Mathieu Desnoyers
register to hold the address of the loop counter variable. Fix this by using a 64-bit register to calculate the address of the loop counter variables as an offset from rip. Signed-off-by: Mathieu Desnoyers Acked-by: "Paul E . McKenney" Cc: # v4.18 Cc: Shuah Khan Cc: Thomas Gleixner

[PATCH v2] rseq/selftests: fix parametrized test with -fpie

2018-09-27 Thread Mathieu Desnoyers
. Fix this by using a 64-bit register to calculate the address of the loop counter variables as an offset from rip. Signed-off-by: Mathieu Desnoyers Acked-by: "Paul E . McKenney" Cc: # v4.18 Cc: Shuah Khan Cc: Thomas Gleixner Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Catalin M

Re: [PATCH] rseq/selftests: fix parametrized test with -fpie

2018-09-27 Thread Mathieu Desnoyers
- On Sep 27, 2018, at 9:58 AM, Shuah Khan shuah...@samsung.com wrote: > On 09/27/2018 07:22 AM, Steven Rostedt wrote: >> On Tue, 25 Sep 2018 13:39:36 -0400 (EDT) >> Mathieu Desnoyers wrote: >> >>> - On Sep 18, 2018, at 9:53 AM, Mathieu Desnoyers >>&g

Re: [PATCH] rseq/selftests: fix parametrized test with -fpie

2018-09-25 Thread Mathieu Desnoyers
- On Sep 18, 2018, at 9:53 AM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > On x86-64, the parametrized selftest code for rseq crashes with a > segmentation fault when compiled with -fpie. This happens when the > param_test binary is loaded at an address beyond 32-bit

Re: [RFC PATCH] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-09-21 Thread Mathieu Desnoyers
- On Sep 20, 2018, at 4:20 PM, Joseph Myers jos...@codesourcery.com wrote: > On Thu, 20 Sep 2018, Mathieu Desnoyers wrote: > >> Are you saying glibc has an explicit check for the kernel version visible >> from /proc before using specific features ? If so,

Re: [RFC PATCH] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-09-20 Thread Mathieu Desnoyers
- On Sep 19, 2018, at 1:10 PM, Joseph Myers jos...@codesourcery.com wrote: > On Wed, 19 Sep 2018, Mathieu Desnoyers wrote: > >> > This looks like it's coming from the Linux kernel. Can't the relevant >> > uapi header just be used directly without copying into g

Re: [RFC PATCH] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-09-20 Thread Mathieu Desnoyers
- On Sep 19, 2018, at 12:37 PM, Joseph Myers jos...@codesourcery.com wrote: > On Wed, 19 Sep 2018, Mathieu Desnoyers wrote: > >> Here is a rough prototype registering rseq(2) TLS for each thread >> (including main), and unregistering for each thread (excluding >&

Re: [RFC PATCH] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-09-19 Thread Mathieu Desnoyers
- On Sep 19, 2018, at 1:38 PM, Szabolcs Nagy szabolcs.n...@arm.com wrote: > On 19/09/18 15:44, Mathieu Desnoyers wrote: >> Things to consider: >> >> - Move __rseq_refcount to an extra field at the end of __rseq_abi to >>eliminate one symbol. This would

Re: [RFC PATCH] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-09-19 Thread Mathieu Desnoyers
I'm using the initial-exec tls model rather than the global-dynamic: I want to make sure no function call is generated there. > The ABI tests have code that would list .tbss symbols as "T" in ABI test > baselines, but no existing ABI baselines use that. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-09-19 Thread Mathieu Desnoyers
- On Sep 19, 2018, at 12:37 PM, Joseph Myers jos...@codesourcery.com wrote: > On Wed, 19 Sep 2018, Mathieu Desnoyers wrote: > >> Here is a rough prototype registering rseq(2) TLS for each thread >> (including main), and unregistering for each thread (excluding >&

[RFC PATCH] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-09-19 Thread Mathieu Desnoyers
how late do we want to unregister it ? It's important to consider if we expect rseq to be used by the memory allocator and within destructor callbacks. Signed-off-by: Mathieu Desnoyers CC: Carlos O'Donell CC: Florian Weimer CC: Thomas Gleixner CC: Ben Maurer CC: Peter Zijlstra CC: "Paul E. McKe

[PATCH man-pages] Add rseq manpage

2018-09-19 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers CC: "Paul E. McKenney" CC: Peter Zijlstra CC: Paul Turner CC: Thomas Gleixner CC: Andy Lutomirski CC: Andi Kleen CC: Dave Watson CC: Chris Lameter CC: Ingo Molnar CC: "H. Peter Anvin" CC: Ben Maurer CC: Steven Rostedt CC: Josh

[PATCH] rseq/selftests: fix parametrized test with -fpie

2018-09-18 Thread Mathieu Desnoyers
. Fix this by using a 64-bit register to calculate the address of the loop counter variables as an offset from rip. Signed-off-by: Mathieu Desnoyers Cc: # v4.18 Cc: Thomas Gleixner Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Catalin Marinas Cc: Dave Watson Cc: Will Deacon Cc: Shuah Khan Cc

Re: [PATCH 0/1] rseq/selftests: add __rseq_abi misalignment check

2018-08-07 Thread Mathieu Desnoyers
erneath it ? Thanks, Mathieu > > Vasily Gorbik (1): > rseq/selftests: add __rseq_abi misalignment check > > tools/testing/selftests/rseq/rseq.c | 19 +++ > .../testing/selftests/rseq/run_param_test.sh | 4 ++-- > 2 files changed, 21 inserti

Re: [RFC PATCH for 4.18 00/16] Restartable Sequences

2018-07-30 Thread Mathieu Desnoyers
ucture has a fixed size of 32 bytes." > Now it says structure size is passed with every syscalls. Now I'm > confused (but maybe that's caused by reading source, not formatted > document). This is the layout for struct rseq_cs version 0. The variable-sized structure is struct rseq. struct rseq is typically in a TLS, and contains a "rseq_cs" field which is a pointer to the struct rseq_cs descriptor describing the currently active rseq critical section. Hoping this clears up the confusion. Thanks for the review! Mathieu > > Best regards, > Pavel > > -- > (english) http://www.livejournal.com/~pavelmachek > (cesky, pictures) > http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH for 4.18 00/16] Restartable Sequences

2018-07-30 Thread Mathieu Desnoyers
aligning struct rseq on larger boundaries, it is free to do so. It will still respect the requirement of alignment on 32 bytes boundaries. Thoughts ? Thanks, Mathieu > > Thanks, > Pavel > > -- > (english) http://www.livejournal.com/~pavelmachek > (cesky, pictures) > http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [PATCH] selftests: membarrier: fix test by checking supported commands

2018-07-30 Thread Mathieu Desnoyers
> Signed-off-by: Rafael David Tinoco > Cc: #v4.17 Acked-by: Mathieu Desnoyers Thanks! Mathieu > --- > .../selftests/membarrier/membarrier_test.c| 69 +++ > 1 file changed, 41 insertions(+), 28 deletions(-) > > diff --git a/tools/testing/selftests/memba

Re: [RFC PATCH for 4.18 00/16] Restartable Sequences

2018-07-28 Thread Mathieu Desnoyers
f rseq thread registration into glibc. Once this is settled, I plan to provide a librseq which will contain headers and documentation on how to use rseq without having to re-create the low-level assembly every time. Does this plan make sense to you ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [PATCH v10 2/3] tracepoint: Make rcuidle tracepoint callers use SRCU

2018-07-14 Thread Mathieu Desnoyers
sing irq tracepoints with SRCU implementation (this series): > Mean: 3.020 (I would consider the improvement against the "without > this series" case as just noise). > Median: 3.013 > Std Dev: 0.033 > > [1] https://patchwork.kernel.org/patch/10344297/ >

  1   2   3   4   5   6   7   8   9   10   >