diff options
author | Kuan-Wei Chiu <visitorckw@gmail.com> | 2024-08-24 02:38:56 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2024-08-30 18:23:43 +0800 |
commit | be9c336852056e2c34369de79fd938dc21a2d5cf (patch) | |
tree | 416a9b8ff31a027320ee489e39a7153b839ffba3 /drivers/crypto/omap-des.c | |
parent | 407f8cf8e6875fc8fb3c0cda193f310340122060 (diff) |
crypto: hisilicon/zip - Optimize performance by replacing rw_lock with spinlock
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@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/omap-des.c')
0 files changed, 0 insertions, 0 deletions