From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932541AbcENSf2 (ORCPT ); Sat, 14 May 2016 14:35:28 -0400 Received: from mail-io0-f177.google.com ([209.85.223.177]:34249 "EHLO mail-io0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932385AbcENSf0 (ORCPT ); Sat, 14 May 2016 14:35:26 -0400 MIME-Version: 1.0 In-Reply-To: <20160514035403.365.qmail@ns.horizon.com> References: <20160514035403.365.qmail@ns.horizon.com> Date: Sat, 14 May 2016 11:35:25 -0700 X-Google-Sender-Auth: CcxLu2TQFtvZe0C7ueetEQ7jl2w Message-ID: Subject: Re: [patch 2/7] lib/hashmod: Add modulo based hash mechanism From: Linus Torvalds To: George Spelvin Cc: Eric Dumazet , Linux Kernel Mailing List , Rik van Riel , Thomas Gleixner Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 13, 2016 at 8:54 PM, George Spelvin 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