summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/bin
diff options
context:
space:
mode:
authorMykyta Yatsenko <yatsenko@meta.com>2026-02-24 19:29:54 +0000
committerHerbert Xu <herbert@gondor.apana.org.au>2026-03-07 14:12:20 +0900
commitc9429bf56405a326845a8a35357b5bdf1dc4558c (patch)
treefe1de9364fbaec5e99dce19ead77667fe890042f /tools/perf/scripts/python/bin
parent68e96c97369e63414c2e02d1dcb92680ac60cd2f (diff)
rhashtable: consolidate hash computation in rht_key_get_hash()
The else-if and else branches in rht_key_get_hash() both compute a hash using either params.hashfn or jhash, differing only in the source of key_len (params.key_len vs ht->p.key_len). Merge the two branches into one by using the ternary `params.key_len ?: ht->p.key_len` to select the key length, removing the duplicated logic. This also improves the performance of the else branch which previously always used jhash and never fell through to jhash2. This branch is going to be used by BPF resizable hashmap, which wraps rhashtable: https://lore.kernel.org/bpf/20260205-rhash-v1-0-30dd6d63c462@meta.com/ Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions