netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [RFC] Add BPF_SYNCHRONIZE bpf(2) command
@ 2018-07-29 15:57 Alexei Starovoitov
  2018-07-30 22:26 ` Joel Fernandes
  0 siblings, 1 reply; 30+ messages in thread
From: Alexei Starovoitov @ 2018-07-29 15:57 UTC (permalink / raw)
  To: Daniel Colascione
  Cc: Joel Fernandes, Lorenzo Colitti, Chenbo Feng, Mathieu Desnoyers,
	Joel Fernandes, Alexei Starovoitov, lkml, Tim Murray,
	Daniel Borkmann, netdev

On Fri, Jul 27, 2018 at 10:17 PM, Daniel Colascione <dancol@google.com> wrote:
> On Sat, Jul 14, 2018 at 11:18 AM, Joel Fernandes <joel@joelfernandes.org>
> wrote:
>>
>> By the way just curious I was briefly going through kernel/bpf/arraymap.c.
>> How are you protecting against load-store tearing of values of array map
>> updates/lookups?
>>
>> For example, if userspace reads an array map at a particular index, while
>> another CPU is updating it, then userspace can read partial values /
>> half-updated values right? Since rcu_read_lock is in use, I was hoping to
>> find something like rcu_assign_pointer there to protect readers against
>> concurrent updates.  Thanks for any clarification.
>
>
> I'm also curious about the answer to this question.

i'm not sure I understand the question.
bpf_map_type_array is a C-like array.
There is no locking of elements.
If single program executing on two cpus
and accesses the same value it will collide.
Same goes for user space vs prog parallel access.
bpf long_memcpy is an attempt to provide minimal
level of automicity when values are aligned and
size==long.

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2018-07-30 22:26 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20180707015616.25988-1-dancol@google.com>
2018-07-07  2:54 ` [RFC] Add BPF_SYNCHRONIZE bpf(2) command Alexei Starovoitov
2018-07-07  3:22   ` Daniel Colascione
2018-07-07 20:33   ` Joel Fernandes
2018-07-08 20:54     ` Mathieu Desnoyers
2018-07-09 21:09       ` Alexei Starovoitov
2018-07-09 21:35         ` Mathieu Desnoyers
2018-07-09 22:19           ` Paul E. McKenney
2018-07-09 22:19             ` Alexei Starovoitov
2018-07-09 22:48               ` Paul E. McKenney
2018-07-09 21:36         ` Daniel Colascione
2018-07-09 22:10           ` Alexei Starovoitov
2018-07-09 22:21             ` Daniel Colascione
2018-07-09 22:34               ` Alexei Starovoitov
2018-07-10  5:25                 ` Chenbo Feng
2018-07-10 23:52                   ` Alexei Starovoitov
2018-07-11  2:46                     ` Lorenzo Colitti
2018-07-11  3:40                       ` Alexei Starovoitov
2018-07-14 18:18                         ` Joel Fernandes
2018-07-16 15:29                           ` Daniel Colascione
2018-07-16 20:23                             ` Joel Fernandes
2018-07-26 16:51                               ` [PATCH v2] Add BPF_SYNCHRONIZE_MAPS " Daniel Colascione
2018-07-27 19:17                           ` [RFC] Add BPF_SYNCHRONIZE " Daniel Colascione
2018-07-10  5:13       ` Joel Fernandes
2018-07-10 16:42         ` Paul E. McKenney
2018-07-10 16:57           ` Joel Fernandes
2018-07-10 17:12             ` Paul E. McKenney
2018-07-10 17:29               ` Joel Fernandes
2018-07-10 17:42                 ` Paul E. McKenney
2018-07-29 15:57 Alexei Starovoitov
2018-07-30 22:26 ` Joel Fernandes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).