Re: [PATCH bpf-next v4] bpf: using rcu_read_lock for bpf_sk_storage_map iterator

2020-09-21 Thread Alexei Starovoitov
On Thu, Sep 17, 2020 at 8:46 AM Yonghong Song wrote: > > If a bucket contains a lot of sockets, during bpf_iter traversing > a bucket, concurrent userspace bpf_map_update_elem() and > bpf program bpf_sk_storage_{get,delete}() may experience > some undesirable delays as they will compete with bpf_i

[PATCH bpf-next v4] bpf: using rcu_read_lock for bpf_sk_storage_map iterator

2020-09-17 Thread Yonghong Song
If a bucket contains a lot of sockets, during bpf_iter traversing a bucket, concurrent userspace bpf_map_update_elem() and bpf program bpf_sk_storage_{get,delete}() may experience some undesirable delays as they will compete with bpf_iter for bucket lock. Note that the number of buckets for bpf_sk

Re: [PATCH bpf-next v4] bpf: using rcu_read_lock for bpf_sk_storage_map iterator

2020-09-17 Thread Martin KaFai Lau
On Wed, Sep 16, 2020 at 03:46:45PM -0700, Yonghong Song wrote: > If a bucket contains a lot of sockets, during bpf_iter traversing > a bucket, concurrent userspace bpf_map_update_elem() and > bpf program bpf_sk_storage_{get,delete}() may experience > some undesirable delays as they will compete wit