[PATCH v2 0/2] bitops: Optimize fns() for improved performance

Kuan-Wei Chiu posted 2 patches 1 year, 7 months ago
There is a newer version of this series
include/linux/bitops.h   | 12 +++---------
lib/find_bit_benchmark.c | 25 +++++++++++++++++++++++++
2 files changed, 28 insertions(+), 9 deletions(-)
[PATCH v2 0/2] bitops: Optimize fns() for improved performance
Posted by Kuan-Wei Chiu 1 year, 7 months ago
Hello,

This patch series optimizes the fns() function by avoiding repeated
calls to __ffs(). Additionally, tests for fns() have been added in
lib/find_bit_benchmark.c.

Changes in v2:
- Add benchmark test for fns() in lib/find_bit_benchmark.c.
- Change the loop in fns() by counting down from n to 0.
- Add find_bit benchmark result for find_nth_bit in commit message.

Link to v1: https://lkml.kernel.org/20240406235532.613696-1-visitorckw@gmail.com

Kuan-Wei Chiu (2):
  lib/find_bit_benchmark: Add benchmark test for fns()
  bitops: Optimize fns() for improved performance

 include/linux/bitops.h   | 12 +++---------
 lib/find_bit_benchmark.c | 25 +++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 9 deletions(-)

-- 
2.34.1
Re: [PATCH v2 0/2] bitops: Optimize fns() for improved performance
Posted by Kuan-Wei Chiu 1 year, 7 months ago
On Tue, Apr 30, 2024 at 01:49:10PM +0800, Kuan-Wei Chiu wrote:
> Hello,
> 
> This patch series optimizes the fns() function by avoiding repeated
> calls to __ffs(). Additionally, tests for fns() have been added in
> lib/find_bit_benchmark.c.
> 
> Changes in v2:
> - Add benchmark test for fns() in lib/find_bit_benchmark.c.
> - Change the loop in fns() by counting down from n to 0.
> - Add find_bit benchmark result for find_nth_bit in commit message.
> 
> Link to v1: https://lkml.kernel.org/20240406235532.613696-1-visitorckw@gmail.com

Sorry for pasting the wrong link, the link to v1 should be:
https://lkml.kernel.org/20240426035152.956702-1-visitorckw@gmail.com

Regards,
Kuan-Wei
> 
> Kuan-Wei Chiu (2):
>   lib/find_bit_benchmark: Add benchmark test for fns()
>   bitops: Optimize fns() for improved performance
> 
>  include/linux/bitops.h   | 12 +++---------
>  lib/find_bit_benchmark.c | 25 +++++++++++++++++++++++++
>  2 files changed, 28 insertions(+), 9 deletions(-)
> 
> -- 
> 2.34.1
>