Re: [RFC] Add BPF_SYNCHRONIZE bpf(2) command

2018-07-16 Thread Daniel Colascione
On Sat, Jul 14, 2018 at 11:18 AM, Joel Fernandes wrote: > On Tue, Jul 10, 2018 at 08:40:19PM -0700, Alexei Starovoitov wrote: > [..] >> > The kernel program might do: >> > >> > = >> > const int current_map_key = 1; >> > void *current_map = bpf_map_lookup_elem(outer_map, ¤t_map_key); >> > >> >

Re: [RFC] Add BPF_SYNCHRONIZE bpf(2) command

2018-07-09 Thread Paul E. McKenney
On Mon, Jul 09, 2018 at 05:35:34PM -0400, Mathieu Desnoyers wrote: > > > - On Jul 9, 2018, at 5:09 PM, Alexei Starovoitov > alexei.starovoi...@gmail.com wrote: > > > On Sun, Jul 08, 2018 at 04:54:38PM -0400, Mathieu Desnoyers wrote: > >> - On Jul 7, 2018, at 4:33 PM, Joel Fernandes joe.

Re: [RFC] Add BPF_SYNCHRONIZE bpf(2) command

2018-07-08 Thread Mathieu Desnoyers
- On Jul 7, 2018, at 4:33 PM, Joel Fernandes joe...@google.com wrote: > On Fri, Jul 06, 2018 at 07:54:28PM -0700, Alexei Starovoitov wrote: >> On Fri, Jul 06, 2018 at 06:56:16PM -0700, Daniel Colascione wrote: >> > BPF_SYNCHRONIZE waits for any BPF programs active at the time of >> > BPF_SYNCH

[RFC] Add BPF_SYNCHRONIZE bpf(2) command

2018-07-06 Thread Daniel Colascione
BPF_SYNCHRONIZE waits for any BPF programs active at the time of BPF_SYNCHRONIZE to complete, allowing userspace to ensure atomicity of RCU data structure operations with respect to active programs. For example, userspace can update a map->map entry to point to a new map, use BPF_SYNCHRONIZE to wai