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: <ZtGjUeJOy_-C7Gae@gondor.apana.org.au>
Date: Fri, 30 Aug 2024 18:47:45 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Kuan-Wei Chiu <visitorckw@...il.com>
Cc: shenyang39@...wei.com, wangzhou1@...ilicon.com, davem@...emloft.net,
	jserv@...s.ncku.edu.tw, linux-crypto@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] crypto: hisilicon/zip - Optimize performance by
 replacing rw_lock with spinlock

On Sat, Aug 24, 2024 at 02:38:56AM +0800, Kuan-Wei Chiu wrote:
> The req_lock is currently implemented as a rw_lock, but there are no
> instances where read_lock() is called. This means that the lock is
> effectively only used by writers, making it functionally equivalent to
> a simple spinlock.
> 
> As stated in Documentation/locking/spinlocks.rst:
> "Reader-writer locks require more atomic memory operations than simple
> spinlocks. Unless the reader critical section is long, you are better
> off just using spinlocks."
> 
> Since the rw_lock in this case incurs additional atomic memory
> operations without any benefit from reader-writer locking, it is more
> efficient to replace it with a spinlock. This patch implements that
> replacement to optimize the driver's performance.
> 
> Signed-off-by: Kuan-Wei Chiu <visitorckw@...il.com>
> ---
> Note: Build test only.
> 
>  drivers/crypto/hisilicon/zip/zip_crypto.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 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