All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lib: Make _find_next_bit helper function inline
@ 2015-07-28 19:09 ` Cassidy Burden
  0 siblings, 0 replies; 18+ messages in thread
From: Cassidy Burden @ 2015-07-28 19:09 UTC (permalink / raw)
  To: yury.norov, akpm
  Cc: linux-arm-msm, linux-kernel, linux-arm-kernel, Cassidy Burden,
	Alexey Klimov, David S. Miller, Daniel Borkmann,
	Hannes Frederic Sowa, Lai Jiangshan, Mark Salter,
	AKASHI Takahiro, Thomas Graf, Valentin Rothberg, Chris Wilson

I've tested Yury Norov's find_bit reimplementation with the test_find_bit
module (https://lkml.org/lkml/2015/3/8/141) and measured about 35-40%
performance degradation on arm64 3.18 run with fixed CPU frequency.

The performance degradation appears to be caused by the
helper function _find_next_bit. After inlining this function into
find_next_bit and find_next_zero_bit I get slightly better performance
than the old implementation:

find_next_zero_bit          find_next_bit
old      new     inline     old      new     inline
26       36      24         24       33      23
25       36      24         24       33      23
26       36      24         24       33      23
25       36      24         24       33      23
25       36      24         24       33      23
25       37      24         24       33      23
25       37      24         24       33      23
25       37      24         24       33      23
25       36      24         24       33      23
25       37      24         24       33      23

Signed-off-by: Cassidy Burden <cburden@codeaurora.org>
Cc: Alexey Klimov <klimov.linux@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Daniel Borkmann <dborkman@redhat.com>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Mark Salter <msalter@redhat.com>
Cc: AKASHI Takahiro <takahiro.akashi@linaro.org>
Cc: Thomas Graf <tgraf@suug.ch>
Cc: Valentin Rothberg <valentinrothberg@gmail.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/find_bit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/find_bit.c b/lib/find_bit.c
index 18072ea..d0e04f9 100644
--- a/lib/find_bit.c
+++ b/lib/find_bit.c
@@ -28,7 +28,7 @@
  * find_next_zero_bit.  The difference is the "invert" argument, which
  * is XORed with each fetched word before searching it for one bits.
  */
-static unsigned long _find_next_bit(const unsigned long *addr,
+static inline unsigned long _find_next_bit(const unsigned long *addr,
 		unsigned long nbits, unsigned long start, unsigned long invert)
 {
 	unsigned long tmp;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-08-30 21:47 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-28 19:09 [PATCH] lib: Make _find_next_bit helper function inline Cassidy Burden
2015-07-28 19:09 ` Cassidy Burden
2015-07-28 21:23 ` Yury
2015-07-28 21:23   ` Yury
2015-07-28 21:38   ` Yury
2015-07-28 21:38     ` Yury
2015-07-28 21:45   ` Andrew Morton
2015-07-28 21:45     ` Andrew Morton
2015-07-29 13:30     ` Alexey Klimov
2015-07-29 13:30       ` Alexey Klimov
2015-07-29 20:40       ` Cassidy Burden
2015-07-29 20:40         ` Cassidy Burden
2015-08-23 22:53         ` Alexey Klimov
2015-08-23 22:53           ` Alexey Klimov
2015-08-29 15:15           ` Yury
2015-08-29 15:15             ` Yury
2015-08-30 21:47             ` Rasmus Villemoes
2015-08-30 21:47               ` Rasmus Villemoes

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.