netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] New jhash function
@ 2010-11-25 13:15 Jozsef Kadlecsik
  2010-11-25 13:15 ` [PATCH 1/2] Prepare the tree for un-inlined jhash Jozsef Kadlecsik
  0 siblings, 1 reply; 18+ messages in thread
From: Jozsef Kadlecsik @ 2010-11-25 13:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: netdev, netfilter-devel, Linus Torvalds, Rusty Russell,
	Jozsef Kadlecsik

Hi,

Please consider applying the following patch:

The current jhash.h implements the lookup2() hash function by Bob Jenkins. 
However, lookup2() is outdated as Bob wrote a new hash function called 
lookup3(). The new hash function

- mixes better than lookup2(): it passes the check that every input bit 
  changes every output bit 50% of the time, while lookup2() failed it.
- performs better: compiled with -O2 on Core2 Duo, lookup3() 20-40% faster
  than lookup2() depending on the key length.

You can read a longer comparison of the two and other hash functions at 
http://burtleburtle.net/bob/hash/doobs.html.

jhash is widely used in the kernel and because the functions
are inlined, the cost in size is significant. The new functions
are slightly larger than the previous ones so the new implementation
uses non-inlined fucntions. (See
http://lkml.indiana.edu/hypermail//linux/kernel/0902.2/01149.html).
Therefore the first patch replaces the calls to the internal macros
of jhash with the jhash function calls and the second patch contains
the implementation of the new jhash functions.

Jozsef Kadlecsik (2):
  Prepare the tree for un-inlined jhash.
  The new jhash implementation

 include/linux/jhash.h            |  136 ++-------------------------------
 lib/Makefile                     |    2 +-
 lib/jhash.c                      |  153 ++++++++++++++++++++++++++++++++++++++
 net/ipv6/inet6_connection_sock.c |   18 ++---
 net/ipv6/reassembly.c            |   36 ++++-----
 5 files changed, 186 insertions(+), 159 deletions(-)
 create mode 100644 lib/jhash.c


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

end of thread, other threads:[~2010-12-10  4:19 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-25 13:15 [PATCH 0/2] New jhash function Jozsef Kadlecsik
2010-11-25 13:15 ` [PATCH 1/2] Prepare the tree for un-inlined jhash Jozsef Kadlecsik
2010-11-25 13:15   ` [PATCH 2/2] The new jhash implementation Jozsef Kadlecsik
2010-11-25 13:49     ` Eric Dumazet
2010-11-25 13:55       ` Changli Gao
2010-11-25 14:05         ` Eric Dumazet
2010-11-25 14:41       ` Jozsef Kadlecsik
2010-11-25 17:21         ` Eric Dumazet
2010-11-25 21:14           ` Jozsef Kadlecsik
2010-11-27  3:31     ` Rusty Russell
2010-12-03 12:38       ` [PATCH 0/2] New jhash function Jozsef Kadlecsik
2010-12-03 12:39         ` [PATCH 1/2] Remove calls to jhash internals Jozsef Kadlecsik
2010-12-03 12:39           ` [PATCH 2/2] The new jhash implementation Jozsef Kadlecsik
2010-12-08 17:09         ` [PATCH 0/2] New jhash function David Miller
2010-12-08 21:23           ` Rusty Russell
2010-12-10  4:19             ` David Miller
2010-11-25 13:39   ` [PATCH 1/2] Prepare the tree for un-inlined jhash Jan Engelhardt
2010-11-25 13:57     ` Jozsef Kadlecsik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).