On Fri, Sep 22, 2017 at 12:37:25AM +0300, Timofey Titovets wrote: > With defaults: > jhash2: ~4.7% > xxhash64: ~3.3% > > 3.3/4.7 ~= 0.7 -> Profit: ~30% > 11/18 ~= 0.6 -> Profit: ~40% > (if i calculate correctly of course) Sounds good. Please add all performance information to the changelog. > > >> >> @@ -51,6 +52,12 @@ > >> >> #define DO_NUMA(x) do { } while (0) > >> >> #endif > >> >> > >> >> +#if BITS_PER_LONG == 64 > >> >> +typedef u64 xxhash; > >> >> +#else > >> >> +typedef u32 xxhash; > >> >> +#endif > >> > > >> > This should be in xxhash.h ? > >> > >> This is a "hack", for compile time chose appropriate hash function. > >> xxhash ported from upstream code, > >> upstream version don't do that (IMHO), as this useless in most cases. > >> That only can be useful for memory only hashes. > >> Because for persistent data it's obvious to always use one hash type 32/64. > > > > I don't think it's a hack. It makes sense. Just should be done centrally > > in Linux, not in a specific user. > > So, i must add separate patch for xxhash.h? Yes. > If yes, may be you can suggest which list must be in copy? > (i can't find any info about maintainers of ./lib/ in MAINTAINERS) Just copy linux-kernel. It would be all merged together. > If we decide to patch xxhash.h, > may be that will be better to wrap above if-else by something like: > /* > * Only for in memory use > */ > xxhash_t xxhash(const void *input, size_t length, uint64_t seed); Yes that's fine. -Andi -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>