[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFwKhMxfgTAZYwDFTmpZcpUf=gCYeV0ARikJ7aXvbdfEkA@mail.gmail.com>
Date: Sat, 14 May 2016 11:35:25 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: George Spelvin <linux@...izon.com>
Cc: Eric Dumazet <eric.dumazet@...il.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Rik van Riel <riel@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [patch 2/7] lib/hashmod: Add modulo based hash mechanism
On Fri, May 13, 2016 at 8:54 PM, George Spelvin <linux@...izon.com> wrote:
>
> There are exactly three architectures which (some models) don't have
> an efficient 32x32->32-bit multiply:
>
> - arch/m58k: MC68000 (and 68010 and 68328) no-mmu
> - arch/h8300: Most (all?) of the H8 processor series
> - arch/microblaze: Depending on Verilog compilation options
I wouldn't worry about it too much.
The architectures where performance really matters are x86, ARM and powerpc.
The rest need to *work* and not suck horribly, but we're not going to
try to do cycle counting for them. It's not worth the pain.
If an architecture doesn't have a barrel shifter, it's not going to
have fast hash functions.
So I'd be ok with just saying "32-bit architectures are going to use a
multiply with non-sparse bits". Not a problem.
We do want to make sure that hash_64 isn't totally disgusting on
32-bit architectures (but that's a fairly rare case), so we probably
do want to have that function fall back on something else than a 64x64
multiply on a 32-bit architecture. Presumably just "mix the two 32-bit
words into one, then use hash_32() on that" is good enough.
Linus
Powered by blists - more mailing lists