[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e9c66d506a614a7e95d039bea325c241@AcuMS.aculab.com>
Date: Mon, 1 Feb 2021 16:02:30 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Andy Shevchenko' <andriy.shevchenko@...ux.intel.com>,
Yury Norov <yury.norov@...il.com>
CC: "linux-m68k@...ts.linux-m68k.org" <linux-m68k@...ts.linux-m68k.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-sh@...r.kernel.org" <linux-sh@...r.kernel.org>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Yoshinori Sato <ysato@...rs.sourceforge.jp>,
"Rich Felker" <dalias@...c.org>, Arnd Bergmann <arnd@...db.de>,
Dennis Zhou <dennis@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Wolfram Sang <wsa+renesas@...g-engineering.com>,
David Sterba <dsterba@...e.com>,
"Stefano Brivio" <sbrivio@...hat.com>,
"Ma, Jianpeng" <jianpeng.ma@...el.com>,
"Wei Yang" <richard.weiyang@...ux.alibaba.com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>,
Joe Perches <joe@...ches.com>
Subject: RE: [PATCH 7/8] lib: add fast path for find_next_*_bit()
From: Andy Shevchenko
> Sent: 01 February 2021 13:49
>
> On Sat, Jan 30, 2021 at 11:17:18AM -0800, Yury Norov wrote:
> > Similarly to bitmap functions, find_next_*_bit() users will benefit
> > if we'll handle a case of bitmaps that fit into a single word. In the
> > very best case, the compiler may replace a function call with a
> > single ffs or ffz instruction.
>
> Would be nice to have the examples how it reduces the actual code size (based
> on the existing code in kernel, especially in widely used frameworks /
> subsystems, like PCI).
I bet it makes the kernel bigger but very slightly faster.
But the fact that the wrappers end up in the i-cache may
mean that inlining actually makes it slower for some calling
sequences.
If a bitmap fits in a single word (as a compile-time constant)
then you should (probably) be using different functions if
you care about performance.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists