public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH net-next] arch_fast_hash: avoid indirect function calls and implement hash in asm
       [not found] <e77237174e1b8d743ef5171e05abde82bc54af37.1417696901.git.hannes@stressinduktion.org>
@ 2014-12-04 15:56 ` Herbert Xu
  2014-12-04 16:37   ` Hannes Frederic Sowa
  0 siblings, 1 reply; 2+ messages in thread
From: Herbert Xu @ 2014-12-04 15:56 UTC (permalink / raw)
  To: Hannes Frederic Sowa
  Cc: netdev, Jay Vosburgh, Thomas Graf, Daniel Borkmann, Eric Dumazet,
	Linux Kernel Mailing List

On Thu, Dec 04, 2014 at 02:08:50PM +0100, Hannes Frederic Sowa wrote:
> By default the arch_fast_hash hashing function pointers are initialized
> to jhash(2). If during boot-up a CPU with SSE4.2 is detected they get
> updated to the CRC32 ones. This dispatching scheme incurs a function
> pointer lookup and indirect call for every hashing operation.

Just curious, is jhash actually faster than generic C CRC32 on
common platforms?

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* Re: [PATCH net-next] arch_fast_hash: avoid indirect function calls and implement hash in asm
  2014-12-04 15:56 ` [PATCH net-next] arch_fast_hash: avoid indirect function calls and implement hash in asm Herbert Xu
@ 2014-12-04 16:37   ` Hannes Frederic Sowa
  0 siblings, 0 replies; 2+ messages in thread
From: Hannes Frederic Sowa @ 2014-12-04 16:37 UTC (permalink / raw)
  To: Herbert Xu
  Cc: netdev, Jay Vosburgh, Thomas Graf, Daniel Borkmann, Eric Dumazet,
	Linux Kernel Mailing List

On Do, 2014-12-04 at 23:56 +0800, Herbert Xu wrote:
> On Thu, Dec 04, 2014 at 02:08:50PM +0100, Hannes Frederic Sowa wrote:
> > By default the arch_fast_hash hashing function pointers are initialized
> > to jhash(2). If during boot-up a CPU with SSE4.2 is detected they get
> > updated to the CRC32 ones. This dispatching scheme incurs a function
> > pointer lookup and indirect call for every hashing operation.
> 
> Just curious, is jhash actually faster than generic C CRC32 on
> common platforms?

Yes, jhash always beats crc32 in software on x86_64 and ia32.

Bye,
Hannes



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

end of thread, other threads:[~2014-12-04 16:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <e77237174e1b8d743ef5171e05abde82bc54af37.1417696901.git.hannes@stressinduktion.org>
2014-12-04 15:56 ` [PATCH net-next] arch_fast_hash: avoid indirect function calls and implement hash in asm Herbert Xu
2014-12-04 16:37   ` Hannes Frederic Sowa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox