Re: [PATCH bpf-next] bpf: make __htab_lookup_and_delete_batch faster when map is almost empty

2020-08-01 Thread Brian Vazquez
On Sat, Aug 1, 2020 at 9:59 AM Yonghong Song wrote: > > > > On 7/31/20 9:57 PM, Brian Vazquez wrote: > > While running some experiments it was observed that map_lookup_batch was > > much > > slower than get_next_key + lookup when the syscall overhead is minimal. > > This was because the

Re: [PATCH bpf-next] bpf: make __htab_lookup_and_delete_batch faster when map is almost empty

2020-08-01 Thread Yonghong Song
On 7/31/20 9:57 PM, Brian Vazquez wrote: While running some experiments it was observed that map_lookup_batch was much slower than get_next_key + lookup when the syscall overhead is minimal. This was because the map_lookup_batch implementation was more expensive traversing empty buckets, this

[PATCH bpf-next] bpf: make __htab_lookup_and_delete_batch faster when map is almost empty

2020-07-31 Thread Brian Vazquez
While running some experiments it was observed that map_lookup_batch was much slower than get_next_key + lookup when the syscall overhead is minimal. This was because the map_lookup_batch implementation was more expensive traversing empty buckets, this can be really costly when the pre-allocated