lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aPH93n2tm4jlF5M7@gondor.apana.org.au>
Date: Fri, 17 Oct 2025 16:27:10 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Menglong Dong <menglong8.dong@...il.com>
Cc: neilb@...mail.net, tgraf@...g.ch, linux-crypto@...r.kernel.org,
	linux-kernel@...r.kernel.org, jiang.biao@...ux.dev
Subject: Re: [PATCH v2] rhashtable: use likely for rhashtable lookup

On Sat, Oct 11, 2025 at 09:48:55AM +0800, Menglong Dong wrote:
> Sometimes, the result of the rhashtable_lookup() is expected to be found.
> Therefore, we can use likely() for such cases.
> 
> Following new functions are introduced, which will use likely or unlikely
> during the lookup:
> 
>  rhashtable_lookup_likely
>  rhltable_lookup_likely
> 
> A micro-benchmark is made for these new functions: lookup a existed entry
> repeatedly for 100000000 times, and rhashtable_lookup_likely() gets ~30%
> speedup.
> 
> Signed-off-by: Menglong Dong <dongml2@...natelecom.cn>
> ---
> v2:
> - remove the unlikely, as it's not suitable
> 
> This patch base on the patch that I commit before:
>   rhashtable: use __always_inline for rhashtable
> 
> The new functions that we introduced can be used by other modules, and I'm
> not sure if it is a good idea to do it in this series, as they belong to
> different tree. So I decide to do it in the target tree after this patch
> merged.
> ---
>  include/linux/rhashtable.h | 70 +++++++++++++++++++++++++++++++-------
>  1 file changed, 58 insertions(+), 12 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ