Re: [PATCH v5 bpf-next] selftests/bpf: Add benchmark for local_storage get

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 9, 2022 at 7:27 AM Dave Marchevsky <davemarchevsky@xxxxxx> wrote:
> >> +
> >> +    if (use_hashmap) {
> >> +            idx = bpf_get_prandom_u32() % hashmap_num_keys;
> >> +            bpf_map_lookup_elem(inner_map, &idx);
> > Is the hashmap populated ?
> >
>
> Nope. Do you expect this to make a difference? Will try when confirming key /
> val size above.

Martin brought up an important point.
The map should be populated.
If the map is empty lookup_nulls_elem_raw() will select a bucket,
it will be empty and it will return NULL.
Whereas the more accurates apples to apples comparison
would be to find a task in a map, since bpf_task_storage_get(,F_CREATE);
will certainly find it.
Then if (l->hash == hash && !memcmp ... will be triggered.
When we're counting nsecs that should be noticeable.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux