[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D1CB079DB@AcuExch.aculab.com>
Date: Mon, 23 Mar 2015 14:29:41 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Herbert Xu' <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>,
Thomas Graf <tgraf@...g.ch>,
Eric Dumazet <eric.dumazet@...il.com>,
Patrick McHardy <kaber@...sh.net>,
Josh Triplett <josh@...htriplett.org>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [v2 PATCH 3/10] rhashtable: Allow hashfn to be unset
From: Herbert Xu
> Since every current rhashtable user uses jhash as their hash
> function, the fact that jhash is an inline function causes each
> user to generate a copy of its code.
>
> This function provides a solution to this problem by allowing
> hashfn to be unset. In which case rhashtable will automatically
> set it to jhash. Furthermore, if the key length is a multiple
> of 4, we will switch over to jhash2.
Would it make sense to do this as a run-time check for the NULL
function pointer so that the jhash code itself can be inlined?
The cost of the test is likely to be less that the indirect call.
David
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists