Re: [RFC PATCH 1/6] tracing: introduce sleepable tracepoints

2020-10-27 Thread Mathieu Desnoyers
iptive ? (a "faultable" tracepoint sounds weird though) Thanks, Mathieu > >> +rcu_read_lock_trace(); \ >> +} else {\ >> + /* keep srcu and sched-rcu usage consistent */ \ >> +preempt_disable_notrace(); \ > > + } \ -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [lttng-dev] [PATCH] call_rcu: Fix race between rcu_barrier() and call_rcu_data_free()

2020-10-26 Thread Mathieu Desnoyers via lttng-dev
liburcu master, stable-0.12, and stable-2.11. Out of curiosity, which test is hanging ? Is it a test which is part of the liburcu tree or some out-of-tree test ? I wonder why we did not catch it in our CI [1]. Thanks, Mathieu [1] https://ci.lttng.org/view/Liburcu/ > > Signed-off-by: P

Re: [PATCH] call_rcu: Fix race between rcu_barrier() and call_rcu_data_free()

2020-10-26 Thread Mathieu Desnoyers
liburcu master, stable-0.12, and stable-2.11. Out of curiosity, which test is hanging ? Is it a test which is part of the liburcu tree or some out-of-tree test ? I wonder why we did not catch it in our CI [1]. Thanks, Mathieu [1] https://ci.lttng.org/view/Liburcu/ > > Signed-off-by: P

Re: [RFC PATCH 0/6] Sleepable tracepoints

2020-10-26 Thread Mathieu Desnoyers
leepable tracepoint), but have a truncation behavior when called from non-sleepable context. This can actually be done by looking at the new "TRACEPOINT_MAYSLEEP" tp flag. Passing that tp_flags to code shared between sleepable and non-sleepable probes would allow the callee to know whether it can take a page fault or not. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH 6/6] tracing: use sched-RCU instead of SRCU for rcuidle tracepoints

2020-10-26 Thread Mathieu Desnoyers
- On Oct 26, 2020, at 4:20 AM, Peter Zijlstra pet...@infradead.org wrote: > On Fri, Oct 23, 2020 at 05:13:59PM -0400, Joel Fernandes wrote: >> On Fri, Oct 23, 2020 at 03:53:52PM -0400, Michael Jeanson wrote: >> > From: Mathieu Desnoyers >> > >> > Consider

Re: [LKP] Re: [sched] bdfcae1140: will-it-scale.per_thread_ops -37.0% regression

2020-10-23 Thread Mathieu Desnoyers
- On Oct 23, 2020, at 1:37 AM, Xing Zhengjun zhengjun.x...@linux.intel.com wrote: > On 10/22/2020 9:19 PM, Mathieu Desnoyers wrote: >> - On Oct 21, 2020, at 9:54 PM, Xing Zhengjun >> zhengjun.x...@linux.intel.com >> wrote: >> [...] >>> In fac

Re: [LKP] Re: [sched] bdfcae1140: will-it-scale.per_thread_ops -37.0% regression

2020-10-22 Thread Mathieu Desnoyers
tsuite, thus limiting the entire testsuite to a single CPU, or you expect that internally the will-it-scale context-switch1 test gets affined to a single specific CPU/core/hardware thread through use of hwloc ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH 1/2] rseq: Implement KTLS prototype for x86-64

2020-10-20 Thread Mathieu Desnoyers
- On Sep 29, 2020, at 4:13 AM, Florian Weimer fwei...@redhat.com wrote: > * Mathieu Desnoyers: > >>> So we have a bootstrap issue here that needs to be solved, I think. >> >> The one thing I'm not sure about is whether the vDSO interface is indeed >> s

Re: [PATCH 1/3] sched: fix exit_mm vs membarrier (v4)

2020-10-20 Thread Mathieu Desnoyers
- On Oct 20, 2020, at 10:36 AM, Peter Zijlstra pet...@infradead.org wrote: > On Tue, Oct 20, 2020 at 09:47:13AM -0400, Mathieu Desnoyers wrote: >> +void membarrier_update_current_mm(struct mm_struct *next_mm) >> +{ >> +struct rq *rq = this_rq(); >> +

Re: [lttng-dev] Error in lttng-modules after pulling in commit 'writeback: Fix sync livelock due to b_dirty_time processing'

2020-10-20 Thread Mathieu Desnoyers via lttng-dev
'TRACE_EVENT' > | TRACE_EVENT(writeback_queue_io, > Kindly look into it and do the needful. Thanks! > Regards, > Syeda Shagufta Naaz > Software Development Engineer | Mentor Embedded Linux > Mentor , A Siemens Business > ___ > l

[PATCH 2/3] sched: membarrier: cover kthread_use_mm (v4)

2020-10-20 Thread Mathieu Desnoyers
. Signed-off-by: Mathieu Desnoyers Cc: Peter Zijlstra (Intel) Cc: Boqun Feng Cc: Will Deacon Cc: Paul E. McKenney Cc: Nicholas Piggin Cc: Andy Lutomirski Cc: Andrew Morton --- Changes since v1: - Add WARN_ON_ONCE(current->mm) in play_idle_precise (PeterZ), - Use smp_mb__after_spinlock rat

[PATCH 1/3] sched: fix exit_mm vs membarrier (v4)

2020-10-20 Thread Mathieu Desnoyers
m is NULL r2 = load x BUG_ON(r1 == 1 && r2 == 0) Signed-off-by: Mathieu Desnoyers Cc: Peter Zijlstra (Intel) Cc: Boqun Feng Cc: Will Deacon Cc: Paul E. McKenney Cc: Nicholas Piggin Cc: Andy Lutomirski Cc: Thomas Gleixner Cc: Linus Torvalds Cc: Alan

[PATCH 0/3] Membarrier updates

2020-10-20 Thread Mathieu Desnoyers
Please find the following membarrier updates series posted for inclusion upstream. Thanks, Mathieu Mathieu Desnoyers (3): sched: fix exit_mm vs membarrier (v4) sched: membarrier: cover kthread_use_mm (v4) sched: membarrier: document memory ordering scenarios include/linux/sched/mm.h

[PATCH 3/3] sched: membarrier: document memory ordering scenarios

2020-10-20 Thread Mathieu Desnoyers
Document membarrier ordering scenarios in membarrier.c. Thanks to Alan Stern for refreshing my memory. Now that I have those in mind, it seems appropriate to serialize them to comments for posterity. Signed-off-by: Mathieu Desnoyers Cc: Peter Zijlstra (Intel) Cc: Boqun Feng Cc: Will Deacon Cc

Re: [LKP] Re: [sched] bdfcae1140: will-it-scale.per_thread_ops -37.0% regression

2020-10-20 Thread Mathieu Desnoyers
- On Oct 19, 2020, at 11:24 PM, Xing Zhengjun zhengjun.x...@linux.intel.com wrote: > On 10/7/2020 10:50 PM, Mathieu Desnoyers wrote: >> - On Oct 2, 2020, at 4:33 AM, Rong Chen rong.a.c...@intel.com wrote: >> >>> Greeting, >>> >&g

Re: [PATCH] drivers/virt: vmgenid: add vm generation id driver

2020-10-19 Thread Mathieu Desnoyers
1518.4141-1-mathieu.desnoy...@efficios.com/ There are a few ways we could wire things up. One might be to add the UUID field into the extended KTLS structure (so it's always updated after it changes on next return to user-space). For this I assume that the Linux scheduler within the guest VM always

Re: [PATCH] drivers/virt: vmgenid: add vm generation id driver

2020-10-19 Thread Mathieu Desnoyers
1518.4141-1-mathieu.desnoy...@efficios.com/ There are a few ways we could wire things up. One might be to add the UUID field into the extended KTLS structure (so it's always updated after it changes on next return to user-space). For this I assume that the Linux scheduler within the guest VM always

Re: [PATCH] drivers/virt: vmgenid: add vm generation id driver

2020-10-19 Thread Mathieu Desnoyers
1518.4141-1-mathieu.desnoy...@efficios.com/ There are a few ways we could wire things up. One might be to add the UUID field into the extended KTLS structure (so it's always updated after it changes on next return to user-space). For this I assume that the Linux scheduler within the guest VM always

Unreliable will-it-scale context_switch1 test on 0day bot

2020-10-19 Thread Mathieu Desnoyers
/1183082664.11002.1602082242482.javamail.zim...@efficios.com/ Who is maintaining those tests and the 0day bot ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [PATCH AUTOSEL 5.9 035/111] ipv6/icmp: l3mdev: Perform icmp error route lookup on source device routing table (v2)

2020-10-19 Thread Mathieu Desnoyers
gree there is no need to hurry. Letting those patches live through a few -rc releases before picking them into stable is a wise course of action. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

[PATCH 3/3] selftests: Add VRF route leaking tests

2020-10-12 Thread Mathieu Desnoyers
From: Michael Jeanson The objective of the tests is to check that ICMP errors generated while crossing between VRFs are properly routed back to the source host. The first ttl test sends a ping with a ttl of 1 from h1 to h2 and parses the output of the command to check that a ttl expired error

[PATCH 2/3] ipv6/icmp: l3mdev: Perform icmp error route lookup on source device routing table (v2)

2020-10-12 Thread Mathieu Desnoyers
. ] [ Testing shows that similar issues exist with ipv6 unreachable / fragmentation needed messages. However, investigation of this additional failure mode is beyond this investigation's scope. ] Link: https://tools.ietf.org/html/rfc4443 Signed-off-by: Mathieu Desnoyers Reviewed-by: David Ahern

[PATCH 1/3] ipv4/icmp: l3mdev: Perform icmp error route lookup on source device routing table (v2)

2020-10-12 Thread Mathieu Desnoyers
1a6c4ea43e ("net: icmp_route_lookup should use rt dev to determine L3 domain") Link: https://tools.ietf.org/html/rfc792 Signed-off-by: Mathieu Desnoyers Reviewed-by: David Ahern Cc: David Ahern Cc: Jakub Kicinski Cc: David S. Miller Cc: net...@vger.kernel.org --- Cha

[PATCH 0/3] l3mdev icmp error route lookup fixes

2020-10-12 Thread Mathieu Desnoyers
paths involved in sending TTL expired icmp errors. As detailed in the individual commit messages, those fixes do not address similar icmp errors related to network namespaces and unreachable / fragmentation needed messages, which appear to use different code paths. Thanks, Mathieu Mathieu

Re: [RFC PATCH 0/3] l3mdev icmp error route lookup fixes

2020-10-12 Thread Mathieu Desnoyers
- On Oct 12, 2020, at 9:45 AM, David Ahern dsah...@gmail.com wrote: > On 10/12/20 5:57 AM, Mathieu Desnoyers wrote: >> OK, do you want to pick up the RFC patch series, or should I re-send it >> without RFC tag ? > > you need to re-send for Dave or Jakub to pick them

Re: [lttng-dev] Deleted files held open by LTTng

2020-10-12 Thread Mathieu Desnoyers via lttng-dev
te this approach first. Thanks, Mathieu > > Best regards, > Nils Döring > ___ > lttng-dev mailing list > lttng-dev@lists.lttng.org > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com __

Re: [RFC PATCH 0/3] l3mdev icmp error route lookup fixes

2020-10-12 Thread Mathieu Desnoyers
- On Oct 11, 2020, at 7:56 PM, David Ahern dsah...@gmail.com wrote: > On 10/5/20 9:30 AM, David Ahern wrote: >> On 9/25/20 1:04 PM, Mathieu Desnoyers wrote: >>> Hi, >>> >>> Here is an updated series of fixes for ipv4 and ipv6 which which ensure >>&g

Re: [RFC PATCH 2/3] sched: membarrier: cover kthread_use_mm (v3)

2020-10-07 Thread Mathieu Desnoyers
- On Oct 7, 2020, at 12:08 PM, Peter Zijlstra pet...@infradead.org wrote: > On Wed, Oct 07, 2020 at 11:39:30AM -0400, Mathieu Desnoyers wrote: >> Moving the membarrier_switch_mm to cover kthread cases was to ensure (2), >> but if >> we >> add a p->mm NULL

Re: [RFC PATCH 2/3] sched: membarrier: cover kthread_use_mm (v3)

2020-10-07 Thread Mathieu Desnoyers
- On Oct 7, 2020, at 11:07 AM, Peter Zijlstra pet...@infradead.org wrote: > On Thu, Sep 24, 2020 at 01:25:07PM -0400, Mathieu Desnoyers wrote: > >> diff --git a/kernel/sched/core.c b/kernel/sched/core.c >> index 2d95dc3f4644..bab6f4f2809f 100644 >> --- a/kernel/sche

Re: [RFC PATCH 1/3] sched: fix exit_mm vs membarrier (v3)

2020-10-07 Thread Mathieu Desnoyers
- On Oct 7, 2020, at 10:29 AM, Peter Zijlstra pet...@infradead.org wrote: > On Thu, Sep 24, 2020 at 01:25:06PM -0400, Mathieu Desnoyers wrote: >> diff --git a/kernel/exit.c b/kernel/exit.c >> index 733e80f334e7..0767a2dbf245 100644 >> --- a/kernel/exit.c >> +++ b

Re: [sched] bdfcae1140: will-it-scale.per_thread_ops -37.0% regression

2020-10-07 Thread Mathieu Desnoyers
ier: cover kthread_use_mm (v3)") > url: > https://github.com/0day-ci/linux/commits/Mathieu-Desnoyers/Membarrier-updates/20200925-012549 > base: https://git.kernel.org/cgit/linux/kernel/git/tip/tip.git > 848785df48835eefebe0c4eb5da7690690b0a8b7 > > in testcase: will-it-scale >

[lttng-dev] [RELEASE] LTTng-modules 2.12.3 and 2.11.6 (Linux kernel tracer) (security fix)

2020-10-05 Thread Mathieu Desnoyers via lttng-dev
xploit" }, { dfd = -100, filename = "", flags = ( "O_RDONLY" : container = 0 ), mode = ( : container = 0 ) } [16:58:51.229348988] (+0.06260) compudjdev syscall_exit_openat: { cpu_id = 22 }, { procname = "exploit" }, { ret = -14 } Thanks, Mathieu Project

[RELEASE] LTTng-modules 2.12.3 and 2.11.6 (Linux kernel tracer) (security fix)

2020-10-05 Thread Mathieu Desnoyers
xploit" }, { dfd = -100, filename = "", flags = ( "O_RDONLY" : container = 0 ), mode = ( : container = 0 ) } [16:58:51.229348988] (+0.06260) compudjdev syscall_exit_openat: { cpu_id = 22 }, { procname = "exploit" }, { ret = -14 } Thanks, Mathieu Project

Re: [RFC PATCH 0/3] Membarrier updates

2020-09-29 Thread Mathieu Desnoyers
- On Sep 24, 2020, at 1:25 PM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > Please find the following membarrier updates series posted as RFC. Hi Peter, I did not get any feedback on this round of RFC. Is it because it is perfect, or because it is abysmally wrong ? :) If i

Re: [RFC PATCH 1/2] rseq: Implement KTLS prototype for x86-64

2020-09-28 Thread Mathieu Desnoyers
- On Sep 28, 2020, at 11:13 AM, Florian Weimer fwei...@redhat.com wrote: > * Mathieu Desnoyers: > >> Upstreaming efforts aiming to integrate rseq support into glibc led to >> interesting discussions, where we identified a clear need to extend the >> size of the per

Re: [lttng-dev] LTTng packages

2020-09-28 Thread Mathieu Desnoyers via lttng-dev
, Packaging is a commercial service offered by EfficiOS to its customers. We then publish the packages to all interested parties. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com ___ lttng-dev mailing list lttng-dev@lists.ltt

Re: [PATCH 0/3 v2] tracing/mm: Add tracepoint_enabled() helper function for headers

2020-09-25 Thread Mathieu Desnoyers
uot;trace_enabled()" instead of "tracepoint_enabled()" > >(Mathieu Desnoyers reported) > > > > - Reworded to include comments about bloating the kernel when tracepoints > >are used in commonly used inlined functions. > > > > - Added the ms

[RFC PATCH 0/3] l3mdev icmp error route lookup fixes

2020-09-25 Thread Mathieu Desnoyers
since the last round are updates to the selftests. Thanks, Mathieu Mathieu Desnoyers (2): ipv4/icmp: l3mdev: Perform icmp error route lookup on source device routing table (v2) ipv6/icmp: l3mdev: Perform icmp error route lookup on source device routing table (v2) Michael Jeanson (1

[RFC PATCH 1/3] ipv4/icmp: l3mdev: Perform icmp error route lookup on source device routing table (v2)

2020-09-25 Thread Mathieu Desnoyers
1a6c4ea43e ("net: icmp_route_lookup should use rt dev to determine L3 domain") Link: https://tools.ietf.org/html/rfc792 Signed-off-by: Mathieu Desnoyers Cc: David Ahern Cc: David S. Miller Cc: net...@vger.kernel.org --- Changes since v1: - Introduce icmp_get_route_lookup_dev.

[RFC PATCH 2/3] ipv6/icmp: l3mdev: Perform icmp error route lookup on source device routing table (v2)

2020-09-25 Thread Mathieu Desnoyers
. ] [ Testing shows that similar issues exist with ipv6 unreachable / fragmentation needed messages. However, investigation of this additional failure mode is beyond this investigation's scope. ] Link: https://tools.ietf.org/html/rfc4443 Signed-off-by: Mathieu Desnoyers Cc: David Ahern Cc

[RFC PATCH 3/3] selftests: Add VRF route leaking tests

2020-09-25 Thread Mathieu Desnoyers
From: Michael Jeanson The objective of the tests is to check that ICMP errors generated while crossing between VRFs are properly routed back to the source host. The first ttl test sends a ping with a ttl of 1 from h1 to h2 and parses the output of the command to check that a ttl expired error

[RFC PATCH 2/2] selftests/rseq: Adapt x86-64 rseq selftest to rseq KTLS prototype

2020-09-25 Thread Mathieu Desnoyers
to be performed by glibc through use of clone3 CLONE_RSEQ_KTLS. Signed-off-by: Mathieu Desnoyers Cc: Carlos O'Donell Cc: "Florian Weimer Cc: Peter Zijlstra (Intel) Cc: "Paul E. McKenney" Cc: Boqun Feng --- tools/testing/selftests/rseq/rseq-x86.h | 8 ++ tools/testing/selfte

[RFC PATCH 1/2] rseq: Implement KTLS prototype for x86-64

2020-09-25 Thread Mathieu Desnoyers
his appear as new system calls instead ? Signed-off-by: Mathieu Desnoyers Cc: Carlos O'Donell Cc: "Florian Weimer Cc: Peter Zijlstra (Intel) Cc: "Paul E. McKenney" Cc: Boqun Feng --- arch/x86/kernel/process_64.c | 1 + include/linux/sched.h| 122 +---

Re: [PATCH 1/2] tracepoints: Add helper to test if tracepoint is enabled in a header

2020-09-25 Thread Mathieu Desnoyers
- On Sep 25, 2020, at 12:26 PM, rostedt rost...@goodmis.org wrote: > On Fri, 25 Sep 2020 11:30:06 -0400 (EDT) > Mathieu Desnoyers wrote: > >> > Anyway, I don't see any issues with the current patch set as is >> > (besides the documentation fix, whic

Re: [PATCH 1/2] tracepoints: Add helper to test if tracepoint is enabled in a header

2020-09-25 Thread Mathieu Desnoyers
- On Sep 25, 2020, at 11:14 AM, rostedt rost...@goodmis.org wrote: > On Fri, 25 Sep 2020 10:41:56 -0400 (EDT) > Mathieu Desnoyers wrote: > >> With the current dependencies of tracepoint.h, I would argue that we should >> only do the trampoline work-a

Re: [PATCH 1/2] tracepoints: Add helper to test if tracepoint is enabled in a header

2020-09-25 Thread Mathieu Desnoyers
- On Sep 24, 2020, at 4:33 PM, rostedt rost...@goodmis.org wrote: > On Thu, 24 Sep 2020 16:27:34 -0400 (EDT) > Mathieu Desnoyers wrote: > >> I'd be a bit more specific: so far, the msr.h use-case requires to include >> directly tracepoint-defs.h and use a tracepoint_en

Re: [PATCH 1/2] tracepoints: Add helper to test if tracepoint is enabled in a header

2020-09-24 Thread Mathieu Desnoyers
- On Sep 24, 2020, at 4:13 PM, rostedt rost...@goodmis.org wrote: > On Thu, 24 Sep 2020 16:05:35 -0400 (EDT) > Mathieu Desnoyers wrote: > >> If headers which happens to be included by include/trace/events/ headers are >> the issue, and they happen to only be needed b

Re: [PATCH 1/2] tracepoints: Add helper to test if tracepoint is enabled in a header

2020-09-24 Thread Mathieu Desnoyers
racepoint.h from include/linux/page_ref.h and did not notice any compile issue. Am I missing something to trigger an issue related to that scenario ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [PATCH 1/2] tracepoints: Add helper to test if tracepoint is enabled in a header

2020-09-24 Thread Mathieu Desnoyers
- On Sep 24, 2020, at 3:35 PM, rostedt rost...@goodmis.org wrote: > On Thu, 24 Sep 2020 15:08:30 -0400 (EDT) > Mathieu Desnoyers wrote: > >> - On Sep 24, 2020, at 2:30 PM, rostedt rost...@goodmis.org wrote: >> >> > On Thu, 24 Sep 2020 13:42:25 -0400 (EDT)

Re: [PATCH 1/2] tracepoints: Add helper to test if tracepoint is enabled in a header

2020-09-24 Thread Mathieu Desnoyers
- On Sep 24, 2020, at 2:30 PM, rostedt rost...@goodmis.org wrote: > On Thu, 24 Sep 2020 13:42:25 -0400 (EDT) > Mathieu Desnoyers wrote: > >> > Signed-off-by: Steven Rostedt (VMware) >> > --- >> > Documentation/trace/tracepoints.rst | 25 +

Re: [PATCH 1/2] tracepoints: Add helper to test if tracepoint is enabled in a header

2020-09-24 Thread Mathieu Desnoyers
- On Sep 24, 2020, at 2:19 PM, Axel Rasmussen axelrasmus...@google.com wrote: > On Thu, Sep 24, 2020 at 10:42 AM Mathieu Desnoyers > wrote: >> >> - On Sep 24, 2020, at 1:09 PM, rostedt rost...@goodmis.org wrote: >> >> > From: "Steven Roste

Re: [PATCH 1/2] tracepoints: Add helper to test if tracepoint is enabled in a header

2020-09-24 Thread Mathieu Desnoyers
oo_enabled() is not. > + */ > +#define DECLARE_TRACEPOINT(tp) \ > + extern struct tracepoint __tracepoint_##tp > + > +#ifdef CONFIG_TRACEPOINTS > +# define tracepoint_enabled(tp) \ > + static_key_false(&(__tracepoint_##tp).key) > +#else > +# define tracepoint_enabled(tracepoint) false > +#endif > + > #endif > -- > 2.28.0 -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

[RFC PATCH 1/3] sched: fix exit_mm vs membarrier (v3)

2020-09-24 Thread Mathieu Desnoyers
m is NULL r2 = load x BUG_ON(r1 == 1 && r2 == 0) Signed-off-by: Mathieu Desnoyers Cc: Peter Zijlstra (Intel) Cc: Boqun Feng Cc: Will Deacon Cc: Paul E. McKenney Cc: Nicholas Piggin Cc: Andy Lutomirski Cc: Thomas Gleixner Cc: Linus Torvalds Cc: Alan

[RFC PATCH 3/3] sched: membarrier: document memory ordering scenarios

2020-09-24 Thread Mathieu Desnoyers
Document membarrier ordering scenarios in membarrier.c. Thanks to Alan Stern for refreshing my memory. Now that I have those in mind, it seems appropriate to serialize them to comments for posterity. Signed-off-by: Mathieu Desnoyers Cc: Peter Zijlstra (Intel) Cc: Boqun Feng Cc: Will Deacon Cc

[RFC PATCH 0/3] Membarrier updates

2020-09-24 Thread Mathieu Desnoyers
Please find the following membarrier updates series posted as RFC. Feedback is welcome, Thanks, Mathieu Mathieu Desnoyers (3): sched: fix exit_mm vs membarrier (v3) sched: membarrier: cover kthread_use_mm (v3) sched: membarrier: document memory ordering scenarios include/linux/sched

[RFC PATCH 2/3] sched: membarrier: cover kthread_use_mm (v3)

2020-09-24 Thread Mathieu Desnoyers
. Signed-off-by: Mathieu Desnoyers Cc: Peter Zijlstra (Intel) Cc: Boqun Feng Cc: Will Deacon Cc: Paul E. McKenney Cc: Nicholas Piggin Cc: Andy Lutomirski Cc: Andrew Morton --- Changes since v1: - Add WARN_ON_ONCE(current->mm) in play_idle_precise (PeterZ), - Use smp_mb__after_spinlock rat

Re: [RFC PATCH 2/3] sched: membarrier: cover kthread_use_mm (v2)

2020-09-24 Thread Mathieu Desnoyers
- On Aug 24, 2020, at 10:06 PM, Boqun Feng boqun.f...@gmail.com wrote: > On Mon, Aug 24, 2020 at 11:27:49AM -0400, Mathieu Desnoyers wrote: >> - On Aug 16, 2020, at 11:29 AM, Boqun Feng boqun.f...@gmail.com wrote: >> >> > On Fri, Aug 14, 2020 at 12:43:57PM -0400,

Re: [RFC PATCH 1/3] sched: fix exit_mm vs membarrier (v2)

2020-09-24 Thread Mathieu Desnoyers
- On Aug 16, 2020, at 11:23 AM, Boqun Feng boqun.f...@gmail.com wrote: > Hi Mathieu, > > On Fri, Aug 14, 2020 at 12:43:56PM -0400, Mathieu Desnoyers wrote: >> exit_mm should issue memory barriers after user-space memory accesses, >> before clearing current->mm, to

Re: [PATCH v8 2/3] rseq/selftests: add rseq_offset_deref_addv

2020-09-24 Thread Mathieu Desnoyers
- On Sep 24, 2020, at 9:33 AM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > - On Sep 23, 2020, at 7:36 PM, Peter Oskolkov p...@google.com wrote: > > The patch title should state that it only adds rseq_offset_deref_addv > to x86-64. Considering that other

Re: [PATCH v8 1/3] rseq/membarrier: add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-09-24 Thread Mathieu Desnoyers
, restarting > a potentially active RSEQ critical section on the CPU. > Acked-by: Mathieu Desnoyers For the next time, you should move the changelog below (vN->vN+1) after a "---" line, which comes after all the Signed-off-by, acked-by and others. Thanks, Mathieu > v1->v2: &g

Re: [PATCH v8 3/3] rseq/selftests: test MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-09-24 Thread Mathieu Desnoyers
gt; printf("[-v] Verbose output.\n"); > printf("[-h] Show this help.\n"); > @@ -1268,6 +1484,7 @@ int main(int argc, char **argv) > case 'i': > case 'b': > case 'm': > + case 'r': > break; > default: > show_usage(argc, argv); > @@ -1320,6 +1537,10 @@ int main(int argc, char **argv) > printf_verbose("counter increment\n"); > test_percpu_inc(); > break; > + case 'r': > + printf_verbose("membarrier\n"); > + test_membarrier(); > + break; > } > if (!opt_disable_rseq && rseq_unregister_current_thread()) > abort(); > diff --git a/tools/testing/selftests/rseq/run_param_test.sh > b/tools/testing/selftests/rseq/run_param_test.sh > index e426304fd4a0..f51bc83c9e41 100755 > --- a/tools/testing/selftests/rseq/run_param_test.sh > +++ b/tools/testing/selftests/rseq/run_param_test.sh > @@ -15,6 +15,7 @@ TEST_LIST=( > "-T m" > "-T m -M" > "-T i" > + "-T r" > ) > > TEST_NAME=( > @@ -25,6 +26,7 @@ TEST_NAME=( > "memcpy" > "memcpy with barrier" > "increment" > + "membarrier" > ) > IFS="$OLDIFS" > > -- > 2.28.0.709.gb0816b6eb0-goog -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [PATCH v8 2/3] rseq/selftests: add rseq_offset_deref_addv

2020-09-24 Thread Mathieu Desnoyers
+ ); > + return 0; > +abort: > + RSEQ_INJECT_FAILED > + return -1; > +#ifdef RSEQ_COMPARE_TWICE > +error1: > + rseq_bug("cpu_id comparison failed"); > +#endif > +} > + > static inline __attribute__((always_inline)) > int rseq_cmpeqv_trystorev_storev(intptr_t *v, intptr_t expect, >intptr_t *v2, intptr_t newv2, > -- > 2.28.0.709.gb0816b6eb0-goog -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH v2 0/3] l3mdev icmp error route lookup fixes

2020-09-21 Thread Mathieu Desnoyers
- On Sep 21, 2020, at 3:11 PM, David Ahern dsah...@gmail.com wrote: > On 9/21/20 12:44 PM, Mathieu Desnoyers wrote: >> - On Sep 21, 2020, at 2:36 PM, David Ahern dsah...@gmail.com wrote: >> >>> On 9/18/20 12:17 PM, Mathieu Desnoyers wrote: >>>> Hi,

Re: [RFC PATCH v2 0/3] l3mdev icmp error route lookup fixes

2020-09-21 Thread Mathieu Desnoyers
- On Sep 21, 2020, at 2:36 PM, David Ahern dsah...@gmail.com wrote: > On 9/18/20 12:17 PM, Mathieu Desnoyers wrote: >> Hi, >> >> Here is an updated series of fixes for ipv4 and ipv6 which which ensure >> the route lookup is performed on the right routing table in

[RFC PATCH v2 0/3] l3mdev icmp error route lookup fixes

2020-09-18 Thread Mathieu Desnoyers
Mathieu Desnoyers (2): ipv4/icmp: l3mdev: Perform icmp error route lookup on source device routing table (v2) ipv6/icmp: l3mdev: Perform icmp error route lookup on source device routing table (v2) Michael Jeanson (1): selftests: Add VRF icmp error route lookup test net/ipv4/icmp.c

[RFC PATCH v2 1/3] ipv4/icmp: l3mdev: Perform icmp error route lookup on source device routing table (v2)

2020-09-18 Thread Mathieu Desnoyers
1a6c4ea43e ("net: icmp_route_lookup should use rt dev to determine L3 domain") Link: https://tools.ietf.org/html/rfc792 Signed-off-by: Mathieu Desnoyers Cc: David Ahern Cc: David S. Miller Cc: net...@vger.kernel.org --- Changes since v1: - Introduce icmp_get_route_lookup_dev.

[RFC PATCH v2 3/3] selftests: Add VRF icmp error route lookup test

2020-09-18 Thread Mathieu Desnoyers
From: Michael Jeanson The objective is to check that the incoming vrf routing table is selected to send an ICMP error back to the source. We test two scenarios: when the ttl of a packet reaches 1 while it is forwarded between different vrfs and when a packet is bigger than the mtu of the second

[RFC PATCH v2 2/3] ipv6/icmp: l3mdev: Perform icmp error route lookup on source device routing table (v2)

2020-09-18 Thread Mathieu Desnoyers
. ] [ Testing shows that similar issues exist with ipv6 unreachable / fragmentation needed messages. However, investigation of this additional failure mode is beyond this investigation's scope. ] Link: https://tools.ietf.org/html/rfc4443 Signed-off-by: Mathieu Desnoyers Cc: David Ahern Cc

Re: [lttng-dev] Lttng-UST requires shared libraries

2020-09-18 Thread Mathieu Desnoyers via lttng-dev
> lttng-dev mailing list > lttng-dev@lists.lttng.org > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com ___ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Re: [PATCH 2/2 v7] rseq/selftests: test MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-09-15 Thread Mathieu Desnoyers
> + "addq %[off], %%rbx\n\t" > + /* get pv */ > + "movq (%%rbx), %%rcx\n\t" > + /* *pv += inc */ > + "addq %[inc], (%%rcx)\n\t" > + "2:\n\t" > + RSEQ_INJECT_ASM(4) > + RSEQ_ASM_DEFINE_ABORT(4, "", abort) > + : /* gcc asm goto does not allow outputs */ > + : [cpu_id] "r" (cpu), > + [rseq_abi]"r" (&__rseq_abi), > + /* final store input */ > + [ptr] "m" (*ptr), > + [off] "er" (off), > + [inc] "er" (inc) > + : "memory", "cc", "rax", "rbx", "rcx" > + RSEQ_INJECT_CLOBBER > + : abort > +#ifdef RSEQ_COMPARE_TWICE > + , error1 > +#endif > + ); > + return 0; > +abort: > + RSEQ_INJECT_FAILED > + return -1; > +#ifdef RSEQ_COMPARE_TWICE > +error1: > + rseq_bug("cpu_id comparison failed"); > +#endif > +} > + > static inline __attribute__((always_inline)) > int rseq_cmpeqv_trystorev_storev(intptr_t *v, intptr_t expect, >intptr_t *v2, intptr_t newv2, > -- > 2.28.0.618.gf4bc123cb7-goog -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [PATCH 1/2 v7] rseq/membarrier: add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-09-15 Thread Mathieu Desnoyers
BUG_ON(flags != 0); Usually BUG_ON() is really for utterly unrecoverable situations, which is not the case here. I am tempted to just use WARN_ON_ONCE(flags) instead to make dmesg yell (once) if an unexpected flags parameter is received. This is not a user-space input, so it should never trigge

Re: [PATCH 1/2 v6] rseq/membarrier: add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-09-15 Thread Mathieu Desnoyers
, int, flags) >> case MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED: >> return membarrier_register_global_expedited(); >> case MEMBARRIER_CMD_PRIVATE_EXPEDITED: >> - return membarrier_private_expedited(0); >> + return membarrier_private_expedited(0, cpu_id); >> case MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED: >> return membarrier_register_private_expedited(0); >> case MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE: >> - return >> membarrier_private_expedited(MEMBARRIER_FLAG_SYNC_CORE); >> + return >> membarrier_private_expedited(MEMBARRIER_FLAG_SYNC_CORE, >> cpu_id); >> case MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE: >> return >> membarrier_register_private_expedited(MEMBARRIER_FLAG_SYNC_CORE); >> + case MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ: >> + return membarrier_private_expedited(MEMBARRIER_FLAG_RSEQ, >> cpu_id); >> + case MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ: >> + return >> membarrier_register_private_expedited(MEMBARRIER_FLAG_RSEQ); >> default: >> return -EINVAL; >> } >> -- >> 2.28.0.402.g5ffc5be6b7-goog -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [lttng-dev] How to use the lttng-untrack command

2020-09-03 Thread Mathieu Desnoyers via lttng-dev
- On Sep 2, 2020, at 10:53 PM, 熊毓华 wrote: > Thanks,now I understand the tracking policy of lttng. > And I want to know,do you have any plans for "exclusion set"? Not at this point. None of our customers expressed interest in that feature so far. Thanks, Mathieu -- M

Re: [PATCH 1/2 v5] rseq/membarrier: add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-08-31 Thread Mathieu Desnoyers
_RSEQ: > + if (flags == 0) > + return > membarrier_private_expedited(MEMBARRIER_FLAG_RSEQ, -1); > + if (flags == MEMBARRIER_CMD_FLAG_CPU) > + return > membarrier_private_expedited(MEMBARRIER_FLAG_RSEQ, cpu_id); > + return -EINVAL; and here we can just call: return membarrier_private_expedited(MEMBARRIER_FLAG_RSEQ, cpu_id); Thanks, Mathieu > + case MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ: > + return > membarrier_register_private_expedited(MEMBARRIER_FLAG_RSEQ); > default: > return -EINVAL; > } > -- > 2.28.0.297.g1956fa8f8d-goog -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [PATCH 1/2 v3] rseq/membarrier: add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-08-25 Thread Mathieu Desnoyers
- On Aug 20, 2020, at 1:42 PM, Peter Oskolkov p...@posk.io wrote: > On Wed, Aug 12, 2020 at 12:44 PM Mathieu Desnoyers > wrote: >> > [...] >> >> > One way of doing what you suggest is to allow some commands to be >> > bitwise-ORed. >>

Re: [RFC PATCH 2/3] sched: membarrier: cover kthread_use_mm (v2)

2020-08-24 Thread Mathieu Desnoyers
- On Aug 16, 2020, at 11:29 AM, Boqun Feng boqun.f...@gmail.com wrote: > On Fri, Aug 14, 2020 at 12:43:57PM -0400, Mathieu Desnoyers wrote: >> Add comments and memory barrier to kthread_use_mm and kthread_unuse_mm >> to allow the effect of membarrier(2) to apply to kthreads ac

Re: [RFC PATCH 2/3] sched: membarrier: cover kthread_use_mm (v2)

2020-08-16 Thread Mathieu Desnoyers
- On Aug 16, 2020, at 3:09 AM, Hillf Danton hdan...@sina.com wrote: > On Fri, 14 Aug 2020 12:43:57 -0400 Mathieu Desnoyers wrote: >> >> Given that no prior kthread use this guarantee and that it only affects >> kthreads, adding this guarantee does not affect user-sp

[RFC PATCH 2/3] sched: membarrier: cover kthread_use_mm (v2)

2020-08-14 Thread Mathieu Desnoyers
ABI. Refine the check in membarrier_global_expedited to exclude runqueues running the idle thread rather than all kthreads from the IPI cpumask. Signed-off-by: Mathieu Desnoyers Cc: Peter Zijlstra (Intel) Cc: Will Deacon Cc: Paul E. McKenney Cc: Nicholas Piggin Cc: Andy Lutomirski Cc: Andrew

[RFC PATCH 3/3] sched: membarrier: document memory ordering scenarios

2020-08-14 Thread Mathieu Desnoyers
Document membarrier ordering scenarios in membarrier.c. Thanks to Alan Stern for refreshing my memory. Now that I have those in mind, it seems appropriate to serialize them to comments for posterity. Signed-off-by: Mathieu Desnoyers Cc: Peter Zijlstra (Intel) Cc: Will Deacon Cc: Paul E

[RFC PATCH 1/3] sched: fix exit_mm vs membarrier (v2)

2020-08-14 Thread Mathieu Desnoyers
mm = NULL; r1 = load y membarrier() skips CPU 0 (no IPI) because its current mm is NULL r2 = load x BUG_ON(r1 == 1 && r2 == 0) Signed-off-by: Mathieu Desnoyers Cc: Pete

[RFC PATCH 0/3] sched: membarrier updates

2020-08-14 Thread Mathieu Desnoyers
Hi, Please find those three changes based on our recent discussions about interaction between membarrier and exit_mm and kthread_use_mm. I added documentation of memory ordering scenarios to membarrier.c as well. Thanks, Mathieu Mathieu Desnoyers (3): sched: fix exit_mm vs membarrier (v2

Re: [PATCH 2/3] ipv4/icmp: l3mdev: Perform icmp error route lookup on source device routing table

2020-08-13 Thread Mathieu Desnoyers
- On Aug 12, 2020, at 5:43 PM, David S. Miller da...@davemloft.net wrote: > From: Mathieu Desnoyers > Date: Tue, 11 Aug 2020 15:50:02 -0400 > >> @@ -465,6 +465,7 @@ static struct rtable *icmp_route_lookup(struct net *net, >>

Re: [PATCH 2/2 v3] rseq/selftests: test MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-08-12 Thread Mathieu Desnoyers
; + ret = rseq_cmpeqv_cmpeqv_storev(>data, prev, > + >percpu_list_ptr, > + (intptr_t)list_ptr, prev + 1, cpu); > +#endif Please don't special-case the implementation of a test per archit

Re: [PATCH 1/2 v3] rseq/membarrier: add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-08-12 Thread Mathieu Desnoyers
- On Aug 12, 2020, at 2:48 PM, Peter Oskolkov p...@posk.io wrote: > On Wed, Aug 12, 2020 at 11:30 AM Mathieu Desnoyers > wrote: > > [...] > >> "flags" is there to allow extensibility without requiring to add new >> membarrier commands for every change.

Re: [PATCH 1/2 v3] rseq/membarrier: add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-08-12 Thread Mathieu Desnoyers
membarrier_private_expedited(MEMBARRIER_FLAG_SYNC_CORE, >> -1); >> case MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE: >> return >> membarrier_register_private_expedited(MEMBARRIER_FLAG_SYNC_CORE); >> - case MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ: >> - return membarrier_private_expedited(MEMBARRIER_FLAG_RSEQ, >> flags); >> case MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ: >> return >> membarrier_register_private_expedited(MEMBARRIER_FLAG_RSEQ); >> + >> + case MEMBARRIER_CMD_PRIVATE_EXPEDITED: >> + return membarrier_private_expedited(cflags, cpuid); >> + >> default: >> return -EINVAL; >> } -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

[PATCH 1/3] selftests: Add VRF icmp error route lookup test

2020-08-11 Thread Mathieu Desnoyers
From: Michael Jeanson The objective is to check that the incoming vrf routing table is selected to send an ICMP error back to the source when the ttl of a packet reaches 1 while it is forwarded between different vrfs. The first test sends a ping with a ttl of 1 from h1 to h2 and parses the

[PATCH 0/3] l3mdev icmp error route lookup fixes

2020-08-11 Thread Mathieu Desnoyers
Hi, Here is a series of fixes for ipv4 and ipv6 which which ensure the route lookup is performed on the right routing table in VRF configurations. It includes a test for both ipv4 and ipv6. The series has been rebased on the net tree. Thanks, Mathieu Mathieu Desnoyers (2): ipv4/icmp

[PATCH 3/3] ipv6/icmp: l3mdev: Perform icmp error route lookup on source device routing table

2020-08-11 Thread Mathieu Desnoyers
sending ICMPv6 error messages. If no source device is set, fall-back on the destination device routing table. Link: https://tools.ietf.org/html/rfc4443 Signed-off-by: Mathieu Desnoyers Cc: David Ahern Cc: David S. Miller Cc: net...@vger.kernel.org --- net/ipv6/icmp.c | 15

[PATCH 2/3] ipv4/icmp: l3mdev: Perform icmp error route lookup on source device routing table

2020-08-11 Thread Mathieu Desnoyers
ce device is set, fall-back on the destination device routing table. Fixes: 9d1a6c4ea43e ("net: icmp_route_lookup should use rt dev to determine L3 domain") Link: https://tools.ietf.org/html/rfc792 Signed-off-by: Mathieu Desnoyers Cc: David Ahern Cc: David S. Miller Cc: net...@vge

Re: [PATCH] selftests: Add VRF icmp error route lookup test

2020-08-11 Thread Mathieu Desnoyers
- On Aug 11, 2020, at 3:14 PM, David Ahern dsah...@gmail.com wrote: > On 8/11/20 1:11 PM, Mathieu Desnoyers wrote: >> One thing I am missing before this series can be considered for upstreaming >> is an Acked-by of the 2 fixes for ipv4 and ipv6 from you, as maintainer >&

Re: [PATCH] selftests: Add VRF icmp error route lookup test

2020-08-11 Thread Mathieu Desnoyers
missing before this series can be considered for upstreaming is an Acked-by of the 2 fixes for ipv4 and ipv6 from you, as maintainer of l3mdev, if you think the approach I am taking with those fixes makes sense. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [PATCH 2/2 v2] rseq/selftests: test MEMBARRIER_CMD_PRIVATE_RESTART_RSEQ_ON_CPU

2020-08-07 Thread Mathieu Desnoyers
- On Aug 7, 2020, at 2:47 PM, Peter Oskolkov p...@posk.io wrote: > On Fri, Aug 7, 2020 at 11:25 AM Mathieu Desnoyers > wrote: >> >> - On Aug 7, 2020, at 1:55 PM, Peter Oskolkov p...@posk.io wrote: >> >> > On Thu, Aug 6, 2020 at 5:27 PM Boqun

Re: [PATCH 2/2 v2] rseq/selftests: test MEMBARRIER_CMD_PRIVATE_RESTART_RSEQ_ON_CPU

2020-08-07 Thread Mathieu Desnoyers
ctions. AFAIU moving the atomic_load(>percpu_list_ptr) into the critical section should entirely solve this and guarantee exclusive access to the old list after the manager's rseq-fence. I wonder why this simpler approach is not favored ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [PATCH 1/2] membarrier: add MEMBARRIER_CMD_PRIVATE_RESTART_RSEQ_ON_CPU

2020-08-07 Thread Mathieu Desnoyers
- On Aug 7, 2020, at 1:48 PM, Peter Oskolkov p...@posk.io wrote: > On Thu, Aug 6, 2020 at 10:37 AM Mathieu Desnoyers > wrote: >> [...] >> Also, should this belong to the membarrier or the rseq system call ? It just >> looks like the membarrier happens to imple

Re: [lttng-dev] Using rculist for dirty tracking

2020-08-07 Thread Mathieu Desnoyers via lttng-dev
? > Meanwhile, that are some advance list operation API: > 1. list_first_entry > 2. list_first_entry_or_null > Is it possible to integrate these into current urcu? > Thanks > ___ > lttng-dev mailing list > lttng-dev@lists.lttng.o

Re: [PATCH 2/2 v2] rseq/selftests: test MEMBARRIER_CMD_PRIVATE_RESTART_RSEQ_ON_CPU

2020-08-07 Thread Mathieu Desnoyers
t_thread(...) >> failed(%d): >> %s\n", >> +errno, strerror(errno)); >> +abort(); >> +} >> +return NULL; >> +} >> + >> +/* Test MEMBARRIER_CMD_PRIVATE_RESTART_RSEQ_ON_CPU membarrier command. */ >> +void test_membarrier(void) >> +{ >> +struct test_membarrier_thread_args thread_args; >> +pthread_t worker_threads[CPU_SETSIZE]; >> +pthread_t manager_thread; >> +int i; >> + >> +thread_args.stop = 0; >> +thread_args.percpu_list_ptr = 0; >> +pthread_create(_thread, NULL, >> + test_membarrier_manager_thread, _args); >> + >> +for (i = 0; i < CPU_SETSIZE; i++) >> +pthread_create(_threads[i], NULL, >> + test_membarrier_worker_thread, _args); >> + >> +for (i = 0; i < CPU_SETSIZE; i++) >> +pthread_join(worker_threads[i], NULL); >> + >> +atomic_store(_args.stop, 1); >> +pthread_join(manager_thread, NULL); >> +} >> + >> int main(int argc, char **argv) >> { >> if (rseq_register_current_thread()) { >> @@ -300,6 +479,8 @@ int main(int argc, char **argv) >> test_percpu_spinlock(); >> printf("percpu_list\n"); >> test_percpu_list(); >> +printf("membarrier\n"); >> +test_membarrier(); >> if (rseq_unregister_current_thread()) { >> fprintf(stderr, "Error: rseq_unregister_current_thread(...) >> failed(%d): %s\n", >> errno, strerror(errno)); >> -- >> 2.28.0.163.g6104cc2f0b6-goog -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [PATCH 1/2] membarrier: add MEMBARRIER_CMD_PRIVATE_RESTART_RSEQ_ON_CPU

2020-08-06 Thread Mathieu Desnoyers
ly do. If cpu >= 0, only IPI that CPU if the thread currently running has the same mm. Also, should this belong to the membarrier or the rseq system call ? It just looks like the membarrier happens to implement very similar things for barriers, but arguably this is really about rseq. I wonder if we should expose this through rseq instead, even if we end up using membarrier code. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH 2/2] sched: membarrier: cover kthread_use_mm

2020-08-06 Thread Mathieu Desnoyers
- On Aug 6, 2020, at 8:13 AM, Will Deacon w...@kernel.org wrote: > On Wed, Aug 05, 2020 at 11:22:36AM -0400, Mathieu Desnoyers wrote: >> - On Aug 5, 2020, at 6:59 AM, Peter Zijlstra pet...@infradead.org wrote: >> > On Tue, Aug 04, 2020 at 07:01:53PM +0200, pet...@i

Re: [RFC PATCH 2/2] sched: membarrier: cover kthread_use_mm

2020-08-05 Thread Mathieu Desnoyers
- On Aug 5, 2020, at 6:59 AM, Peter Zijlstra pet...@infradead.org wrote: > On Tue, Aug 04, 2020 at 07:01:53PM +0200, pet...@infradead.org wrote: >> On Tue, Aug 04, 2020 at 10:59:33AM -0400, Mathieu Desnoyers wrote: >> > - On Aug 4, 2020, at 10:51 AM, Peter Zijlstra pe

Re: [RFC PATCH 1/2] sched: Fix exit_mm vs membarrier

2020-08-04 Thread Mathieu Desnoyers
- On Aug 4, 2020, at 12:51 PM, Peter Zijlstra pet...@infradead.org wrote: > On Tue, Aug 04, 2020 at 10:48:41AM -0400, Mathieu Desnoyers wrote: >> Here is the scenario I have in mind: > >> Userspace variables: >> >> int x = 0, y = 0; >> >&g

<    2   3   4   5   6   7   8   9   10   11   >