Re: Some -serious- BPF-related litmus tests

2020-05-29 Thread Peter Zijlstra
On Fri, May 29, 2020 at 01:01:51PM -0700, Andrii Nakryiko wrote: > > question though; why are you using xchg() for the commit? Isn't that > > more expensive than it should be? > > > > That is, why isn't that: > > > > smp_store_release(&hdr->len, new_len); > > > > ? Or are you needing the smp_mb(

Re: Some -serious- BPF-related litmus tests

2020-05-29 Thread Andrii Nakryiko
On Fri, May 29, 2020 at 10:23 AM Joel Fernandes wrote: > > On Thu, May 28, 2020 at 09:38:35PM -0700, Andrii Nakryiko wrote: > > On Thu, May 28, 2020 at 2:48 PM Joel Fernandes > > wrote: > > > > > > On Mon, May 25, 2020 at 11:38:23AM -0700, Andrii Nakryiko wrote: > > > > On Mon, May 25, 2020 at 7

Re: Some -serious- BPF-related litmus tests

2020-05-29 Thread Andrii Nakryiko
On Fri, May 29, 2020 at 5:36 AM Peter Zijlstra wrote: > > On Thu, May 28, 2020 at 10:14:21PM -0700, Andrii Nakryiko wrote: > > > There is another cluster of applications which are unnecessarily more > > complicated just for the fact that there is no ordering between > > correlated events that happ

Re: Some -serious- BPF-related litmus tests

2020-05-29 Thread Joel Fernandes
On Thu, May 28, 2020 at 09:38:35PM -0700, Andrii Nakryiko wrote: > On Thu, May 28, 2020 at 2:48 PM Joel Fernandes wrote: > > > > On Mon, May 25, 2020 at 11:38:23AM -0700, Andrii Nakryiko wrote: > > > On Mon, May 25, 2020 at 7:53 AM Boqun Feng wrote: > > > > > > > > Hi Andrii, > > > > > > > > On F

Re: Some -serious- BPF-related litmus tests

2020-05-29 Thread Peter Zijlstra
On Thu, May 28, 2020 at 10:14:21PM -0700, Andrii Nakryiko wrote: > There is another cluster of applications which are unnecessarily more > complicated just for the fact that there is no ordering between > correlated events that happen on different CPUs. Per-CPU buffers are > not well suited for su

Re: Some -serious- BPF-related litmus tests

2020-05-28 Thread Andrii Nakryiko
On Thu, May 28, 2020 at 3:17 PM Peter Zijlstra wrote: > > On Thu, May 28, 2020 at 06:00:47PM -0400, Joel Fernandes wrote: > > > Any idea why this choice of locking-based ring buffer implementation in BPF? > > The ftrace ring buffer can support NMI interruptions as well for writes. > > > > Also, is

Re: Some -serious- BPF-related litmus tests

2020-05-28 Thread Andrii Nakryiko
On Thu, May 28, 2020 at 2:48 PM Joel Fernandes wrote: > > On Mon, May 25, 2020 at 11:38:23AM -0700, Andrii Nakryiko wrote: > > On Mon, May 25, 2020 at 7:53 AM Boqun Feng wrote: > > > > > > Hi Andrii, > > > > > > On Fri, May 22, 2020 at 12:38:21PM -0700, Andrii Nakryiko wrote: > > > > On 5/22/20 1

Re: Some -serious- BPF-related litmus tests

2020-05-28 Thread Peter Zijlstra
On Thu, May 28, 2020 at 06:00:47PM -0400, Joel Fernandes wrote: > Any idea why this choice of locking-based ring buffer implementation in BPF? > The ftrace ring buffer can support NMI interruptions as well for writes. > > Also, is it possible for BPF to reuse the ftrace ring buffer implementation

Re: Some -serious- BPF-related litmus tests

2020-05-28 Thread Joel Fernandes
On Mon, May 25, 2020 at 10:21:54AM -0700, Paul E. McKenney wrote: > On Mon, May 25, 2020 at 07:02:57PM +0200, Peter Zijlstra wrote: > > On Mon, May 25, 2020 at 08:47:30AM -0700, Paul E. McKenney wrote: > > > On Mon, May 25, 2020 at 01:25:21PM +0200, Peter Zijlstra wrote: > > > > > > That is; how c

Re: Some -serious- BPF-related litmus tests

2020-05-28 Thread Joel Fernandes
On Mon, May 25, 2020 at 11:38:23AM -0700, Andrii Nakryiko wrote: > On Mon, May 25, 2020 at 7:53 AM Boqun Feng wrote: > > > > Hi Andrii, > > > > On Fri, May 22, 2020 at 12:38:21PM -0700, Andrii Nakryiko wrote: > > > On 5/22/20 10:43 AM, Paul E. McKenney wrote: > > > > On Fri, May 22, 2020 at 10:32:

Re: Some -serious- BPF-related litmus tests

2020-05-26 Thread Andrii Nakryiko
On Tue, May 26, 2020 at 4:00 PM Akira Yokosawa wrote: > > On Tue, 26 May 2020 13:19:36 -0700, Andrii Nakryiko wrote: > > On Tue, May 26, 2020 at 7:02 AM Akira Yokosawa wrote: > >> > >> On Tue, 26 May 2020 19:50:47 +0900, Akira Yokosawa wrote: > >>> On Mon, 25 May 2020 16:31:05 -0700, Andrii Nakry

Re: Some -serious- BPF-related litmus tests

2020-05-26 Thread Akira Yokosawa
On Tue, 26 May 2020 13:19:36 -0700, Andrii Nakryiko wrote: > On Tue, May 26, 2020 at 7:02 AM Akira Yokosawa wrote: >> >> On Tue, 26 May 2020 19:50:47 +0900, Akira Yokosawa wrote: >>> On Mon, 25 May 2020 16:31:05 -0700, Andrii Nakryiko wrote: On Mon, May 25, 2020 at 3:01 PM Akira Yokosawa wro

Re: Some -serious- BPF-related litmus tests

2020-05-26 Thread Akira Yokosawa
On Tue, 26 May 2020 13:15:49 -0700, Andrii Nakryiko wrote: > On Tue, May 26, 2020 at 3:50 AM Akira Yokosawa wrote: >> >> On Mon, 25 May 2020 16:31:05 -0700, Andrii Nakryiko wrote: >>> On Mon, May 25, 2020 at 3:01 PM Akira Yokosawa wrote: >> [...] Yes, that should work. >>> >>> Ok, assig

Re: Some -serious- BPF-related litmus tests

2020-05-26 Thread Andrii Nakryiko
On Tue, May 26, 2020 at 7:02 AM Akira Yokosawa wrote: > > On Tue, 26 May 2020 19:50:47 +0900, Akira Yokosawa wrote: > > On Mon, 25 May 2020 16:31:05 -0700, Andrii Nakryiko wrote: > >> On Mon, May 25, 2020 at 3:01 PM Akira Yokosawa wrote: > >>> > > [...] > >>> Yes, that should work. > >> > >> Ok,

Re: Some -serious- BPF-related litmus tests

2020-05-26 Thread Andrii Nakryiko
On Tue, May 26, 2020 at 3:50 AM Akira Yokosawa wrote: > > On Mon, 25 May 2020 16:31:05 -0700, Andrii Nakryiko wrote: > > On Mon, May 25, 2020 at 3:01 PM Akira Yokosawa wrote: > >> > [...] > >> Yes, that should work. > > > > Ok, assigning to zero didn't work (it still complained about > > uninitia

Re: Some -serious- BPF-related litmus tests

2020-05-26 Thread Akira Yokosawa
On Tue, 26 May 2020 19:50:47 +0900, Akira Yokosawa wrote: > On Mon, 25 May 2020 16:31:05 -0700, Andrii Nakryiko wrote: >> On Mon, May 25, 2020 at 3:01 PM Akira Yokosawa wrote: >>> > [...] >>> Yes, that should work. >> >> Ok, assigning to zero didn't work (it still complained about >> uninitialized

Re: Some -serious- BPF-related litmus tests

2020-05-26 Thread Akira Yokosawa
On Mon, 25 May 2020 16:31:05 -0700, Andrii Nakryiko wrote: > On Mon, May 25, 2020 at 3:01 PM Akira Yokosawa wrote: >> [...] >> Yes, that should work. > > Ok, assigning to zero didn't work (it still complained about > uninitialized read), but using a separate int *lenFail to assign to > rLenPtr wo

Re: Some -serious- BPF-related litmus tests

2020-05-25 Thread Andrii Nakryiko
On Mon, May 25, 2020 at 3:01 PM Akira Yokosawa wrote: > > On Mon, 25 May 2020 11:31:27 -0700, Andrii Nakryiko wrote: > > On Sun, May 24, 2020 at 5:09 AM Akira Yokosawa wrote: > >> > >> On Fri, 22 May 2020 12:38:21 -0700, Andrii Nakryiko wrote: > >>> On 5/22/20 10:43 AM, Paul E. McKenney wrote: >

Re: Some -serious- BPF-related litmus tests

2020-05-25 Thread Akira Yokosawa
On Mon, 25 May 2020 11:31:27 -0700, Andrii Nakryiko wrote: > On Sun, May 24, 2020 at 5:09 AM Akira Yokosawa wrote: >> >> On Fri, 22 May 2020 12:38:21 -0700, Andrii Nakryiko wrote: >>> On 5/22/20 10:43 AM, Paul E. McKenney wrote: On Fri, May 22, 2020 at 10:32:01AM -0400, Alan Stern wrote:

Re: Some -serious- BPF-related litmus tests

2020-05-25 Thread Andrii Nakryiko
On Mon, May 25, 2020 at 7:53 AM Boqun Feng wrote: > > Hi Andrii, > > On Fri, May 22, 2020 at 12:38:21PM -0700, Andrii Nakryiko wrote: > > On 5/22/20 10:43 AM, Paul E. McKenney wrote: > > > On Fri, May 22, 2020 at 10:32:01AM -0400, Alan Stern wrote: > > > > On Fri, May 22, 2020 at 11:44:07AM +0200,

Re: Some -serious- BPF-related litmus tests

2020-05-25 Thread Andrii Nakryiko
On Sun, May 24, 2020 at 5:09 AM Akira Yokosawa wrote: > > On Fri, 22 May 2020 12:38:21 -0700, Andrii Nakryiko wrote: > > On 5/22/20 10:43 AM, Paul E. McKenney wrote: > >> On Fri, May 22, 2020 at 10:32:01AM -0400, Alan Stern wrote: > >>> On Fri, May 22, 2020 at 11:44:07AM +0200, Peter Zijlstra wrot

Re: Some -serious- BPF-related litmus tests

2020-05-25 Thread Paul E. McKenney
On Mon, May 25, 2020 at 10:21:54AM -0700, Paul E. McKenney wrote: > On Mon, May 25, 2020 at 07:02:57PM +0200, Peter Zijlstra wrote: > > On Mon, May 25, 2020 at 08:47:30AM -0700, Paul E. McKenney wrote: > > > On Mon, May 25, 2020 at 01:25:21PM +0200, Peter Zijlstra wrote: > > > > > > That is; how c

Re: Some -serious- BPF-related litmus tests

2020-05-25 Thread Paul E. McKenney
On Mon, May 25, 2020 at 07:02:57PM +0200, Peter Zijlstra wrote: > On Mon, May 25, 2020 at 08:47:30AM -0700, Paul E. McKenney wrote: > > On Mon, May 25, 2020 at 01:25:21PM +0200, Peter Zijlstra wrote: > > > > That is; how can you use a spinlock on the producer side at all? > > > > So even trylock

Re: Some -serious- BPF-related litmus tests

2020-05-25 Thread Peter Zijlstra
On Mon, May 25, 2020 at 08:47:30AM -0700, Paul E. McKenney wrote: > On Mon, May 25, 2020 at 01:25:21PM +0200, Peter Zijlstra wrote: > > That is; how can you use a spinlock on the producer side at all? > > So even trylock is now forbidden in NMI handlers? If so, why? The litmus tests don't have

Re: Some -serious- BPF-related litmus tests

2020-05-25 Thread Paul E. McKenney
On Mon, May 25, 2020 at 01:25:21PM +0200, Peter Zijlstra wrote: > On Fri, May 22, 2020 at 12:38:21PM -0700, Andrii Nakryiko wrote: > > On 5/22/20 10:43 AM, Paul E. McKenney wrote: > > > On Fri, May 22, 2020 at 10:32:01AM -0400, Alan Stern wrote: > > > > > Also, what use is a spinlock that is acces

Re: Some -serious- BPF-related litmus tests

2020-05-25 Thread Boqun Feng
Hi Andrii, On Fri, May 22, 2020 at 12:38:21PM -0700, Andrii Nakryiko wrote: > On 5/22/20 10:43 AM, Paul E. McKenney wrote: > > On Fri, May 22, 2020 at 10:32:01AM -0400, Alan Stern wrote: > > > On Fri, May 22, 2020 at 11:44:07AM +0200, Peter Zijlstra wrote: > > > > On Thu, May 21, 2020 at 05:38:50P

Re: Some -serious- BPF-related litmus tests

2020-05-25 Thread Peter Zijlstra
On Fri, May 22, 2020 at 12:38:21PM -0700, Andrii Nakryiko wrote: > On 5/22/20 10:43 AM, Paul E. McKenney wrote: > > On Fri, May 22, 2020 at 10:32:01AM -0400, Alan Stern wrote: > > > Also, what use is a spinlock that is accessed in only one thread? > > > > Multiple writers synchronize via the spin

Re: Some -serious- BPF-related litmus tests

2020-05-24 Thread Akira Yokosawa
On Fri, 22 May 2020 12:38:21 -0700, Andrii Nakryiko wrote: > On 5/22/20 10:43 AM, Paul E. McKenney wrote: >> On Fri, May 22, 2020 at 10:32:01AM -0400, Alan Stern wrote: >>> On Fri, May 22, 2020 at 11:44:07AM +0200, Peter Zijlstra wrote: On Thu, May 21, 2020 at 05:38:50PM -0700, Paul E. McKenne

Re: Some -serious- BPF-related litmus tests

2020-05-22 Thread Andrii Nakryiko
On 5/22/20 10:43 AM, Paul E. McKenney wrote: On Fri, May 22, 2020 at 10:32:01AM -0400, Alan Stern wrote: On Fri, May 22, 2020 at 11:44:07AM +0200, Peter Zijlstra wrote: On Thu, May 21, 2020 at 05:38:50PM -0700, Paul E. McKenney wrote: Hello! Just wanted to call your attention to some pretty c

Re: Some -serious- BPF-related litmus tests

2020-05-22 Thread Paul E. McKenney
On Fri, May 22, 2020 at 10:36:09AM -0400, Alan Stern wrote: > On Fri, May 22, 2020 at 03:56:59AM -0700, Paul E. McKenney wrote: > > On Fri, May 22, 2020 at 11:44:07AM +0200, Peter Zijlstra wrote: > > > On Thu, May 21, 2020 at 05:38:50PM -0700, Paul E. McKenney wrote: > > > > Hello! > > > > > > > >

Re: Some -serious- BPF-related litmus tests

2020-05-22 Thread Paul E. McKenney
On Fri, May 22, 2020 at 10:32:01AM -0400, Alan Stern wrote: > On Fri, May 22, 2020 at 11:44:07AM +0200, Peter Zijlstra wrote: > > On Thu, May 21, 2020 at 05:38:50PM -0700, Paul E. McKenney wrote: > > > Hello! > > > > > > Just wanted to call your attention to some pretty cool and pretty serious > >

Re: Some -serious- BPF-related litmus tests

2020-05-22 Thread Alan Stern
On Fri, May 22, 2020 at 03:56:59AM -0700, Paul E. McKenney wrote: > On Fri, May 22, 2020 at 11:44:07AM +0200, Peter Zijlstra wrote: > > On Thu, May 21, 2020 at 05:38:50PM -0700, Paul E. McKenney wrote: > > > Hello! > > > > > > Just wanted to call your attention to some pretty cool and pretty serio

Re: Some -serious- BPF-related litmus tests

2020-05-22 Thread Alan Stern
On Fri, May 22, 2020 at 11:44:07AM +0200, Peter Zijlstra wrote: > On Thu, May 21, 2020 at 05:38:50PM -0700, Paul E. McKenney wrote: > > Hello! > > > > Just wanted to call your attention to some pretty cool and pretty serious > > litmus tests that Andrii did as part of his BPF ring-buffer work: > >

Re: Some -serious- BPF-related litmus tests

2020-05-22 Thread Paul E. McKenney
On Fri, May 22, 2020 at 11:44:07AM +0200, Peter Zijlstra wrote: > On Thu, May 21, 2020 at 05:38:50PM -0700, Paul E. McKenney wrote: > > Hello! > > > > Just wanted to call your attention to some pretty cool and pretty serious > > litmus tests that Andrii did as part of his BPF ring-buffer work: > >

Re: Some -serious- BPF-related litmus tests

2020-05-22 Thread Peter Zijlstra
On Thu, May 21, 2020 at 05:38:50PM -0700, Paul E. McKenney wrote: > Hello! > > Just wanted to call your attention to some pretty cool and pretty serious > litmus tests that Andrii did as part of his BPF ring-buffer work: > > https://lore.kernel.org/bpf/20200517195727.279322-3-andr...@fb.com/ > >

Some -serious- BPF-related litmus tests

2020-05-21 Thread Paul E. McKenney
Hello! Just wanted to call your attention to some pretty cool and pretty serious litmus tests that Andrii did as part of his BPF ring-buffer work: https://lore.kernel.org/bpf/20200517195727.279322-3-andr...@fb.com/ Thoughts? Thanx, Paul