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

2020-09-15 Thread Yonghong Song
On 9/15/20 10:37 PM, Martin KaFai Lau wrote: On Tue, Sep 15, 2020 at 03:35:07PM -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

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

2020-09-15 Thread Martin KaFai Lau
On Tue, Sep 15, 2020 at 03:35:07PM -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

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

2020-09-15 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