From: Hannes Frederic Sowa Date: Tue, 4 Nov 2014 23:23:04 +0000 (+0100) Subject: fast_hash: avoid indirect function calls X-Git-Tag: omap-for-v3.19/fixes-rc1~125^2~270 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5a2c899957659cd1a9f789bc462f9c0b35f5150;p=pandora-kernel.git fast_hash: avoid indirect function calls 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. rhashtable as a user of arch_fast_hash e.g. stores pointers to hashing functions in its structure, too, causing two indirect branches per hashing operation. Using alternative_call we can get away with one of those indirect branches. Acked-by: Daniel Borkmann Cc: Thomas Graf Signed-off-by: Hannes Frederic Sowa Signed-off-by: David S. Miller --- Reading git-diff-tree failed