summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorMykyta Yatsenko <yatsenko@meta.com>2026-06-05 04:41:24 -0700
committerAlexei Starovoitov <ast@kernel.org>2026-06-05 08:00:08 -0700
commit9dcbb5045fe5a00f04c99aede5a10726f8bb937b (patch)
treeb98b7bad19f4c0aa205e73358bdb52191e506cfa /include/linux
parent6905f8601298ecd2d1932a4b4849bf265201118e (diff)
bpf: Optimize word-sized keys for resizable hashtable
Specialize the lookup/update/delete paths for keys whose size matches sizeof(long) (4 bytes on 32-bit, 8 bytes on 64-bit). A static-const rhashtable_params lets the compiler inline a custom XOR-fold hashfn and a single-word equality cmpfn, eliminating the indirect jhash dispatch. The same hashfn and cmpfn are installed into rhashtable's stored params at rhashtable_init time, so the rehash worker, slow-path inserts, and rhashtable_next_key() all agree with the inlined fast paths. The seq_file BPF iterator uses rhashtable_walk_* and is unaffected. Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com> Link: https://lore.kernel.org/r/20260605-rhash-v7-7-5b8e05f8630d@meta.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions