Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp694838rbb; Sat, 24 Feb 2024 22:14:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVCIxVVIgNiGuDEZA+s27sUqlEMP9Sc2DYiEn2Q0Sz3UuVpKN2muNjGtYgPV5ny0z+X2Eqgvmex7x/+pYeGWZk9s/oVMH5rUhlTl46Y5A== X-Google-Smtp-Source: AGHT+IHjc0V1NhW77G+HqmLZf9oSU8jzexaVz0+2W8i+QsL78HfAagozf/jU/fjQ4CqtoM/AZV/e X-Received: by 2002:ac8:5dcc:0:b0:42e:7e8e:8d06 with SMTP id e12-20020ac85dcc000000b0042e7e8e8d06mr907259qtx.54.1708841698603; Sat, 24 Feb 2024 22:14:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708841698; cv=pass; d=google.com; s=arc-20160816; b=qUFCgafBABcmTbU/qrWzRno5bqFzAbziy8rAI+O7gTPknrMdvMVr9D4O4dVHqrnbW4 e8rIzQY9aEJR+Ou4VUtDer1sq8CfzOlalIXQ1K8eC3xeRx6hMby49Mx/Zs46AyhGKrPg p3XL+eyJh8Cyd4eU3g98hSXBm0StNssf+VOBrkp4ua12zW2eA3Coaxr3AXZ3i6z6LX/n gLMOuEYDcUkmg5N60gbjfLlb6ZQW0Og8O10gCMzAiu4c8dAmws58rBVD7LvN5I6LIswI 3H1RKsZygrKtRCVeBF5jviWydxMG/3kFadyAqHILyivT8spp0AZiYAeFkMCUXVo2URhY xstQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=fUUif9KcYlLFn7lITsjP4DXv1Tc/bfc10B0pakN5FX0=; fh=aNsIVRK2FhynRrFtGLldZlIQk/VWpI/9SW8v8dVxjUk=; b=Nvd64vMnl9x6p5rhONFEXYRf6xnt271JWjVu8EhFVTimf0oVlJwaQkhg4WyamUoPzb 1e98jNcDeomqQT7/CjE9yC8ni+LKw3MufM44zYDOXRDFouC/p8dDvFHmdFwA0RML5iZv N/P7TpbtbEmQaJ1KL5245hOBxmqXvK8scEmEDD62nNWq4yHkdCGBPSudiypqYWyjTxZU Xbtgw+zwY9dkhmGigej2WaVASHai+xKZYBZiEMa1PXbfpLduZ9LZ+v6Q6fMgkbu0lPAd knDR62e41KTSJ30z/x2kABVwuhuH5IVqNx9LzyplzrcfdABlftQydaFQfeSOspefIuEM bBvA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=WQf5+p03; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-79988-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79988-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f25-20020ac84659000000b0042e77905e5csi1910331qto.275.2024.02.24.22.14.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 22:14:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79988-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=WQf5+p03; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-79988-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79988-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 437521C20B30 for ; Sun, 25 Feb 2024 06:14:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 39F6BD27A; Sun, 25 Feb 2024 06:14:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="WQf5+p03" Received: from out-189.mta0.migadu.com (out-189.mta0.migadu.com [91.218.175.189]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B77CD944E for ; Sun, 25 Feb 2024 06:14:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708841685; cv=none; b=H4b9h+kIfxniScmyQKWHt/HuYRuIF9YVIJBdxXXVi6b5w3yj0U94qwKEYMtvf7/3LlGmDEgV/ud6Y3E9e0zSadxnq/xgcJPzqPUfqJjRPj7TlbHVmnGrrBwQjbTx6Xz521wKD0i1nLXwZcVWlAJapEGPEe6ZpEOBY3kRguo5AfQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708841685; c=relaxed/simple; bh=Thhad8bOoqBfWRyLRqhOVbSKV7YzETTjZwmrfCBuc+w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JgbwImpTJABef3V1B+f1+bxyWFXpNACiMCHKgehWpoUAZh5+GUG45A1NsRofTpjfJBGy/6+2ctjsTj5Va46GymO0wPWYWpumpGctULAwqLgvaVf33lckfN+zDmZrcTwhP0o+5GAS32U2+Nhqt2d4px/HQhWLKH5tMBAVMLeTbHM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=WQf5+p03; arc=none smtp.client-ip=91.218.175.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Sun, 25 Feb 2024 01:14:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1708841682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fUUif9KcYlLFn7lITsjP4DXv1Tc/bfc10B0pakN5FX0=; b=WQf5+p03sTi/0WL/y9jKjAJvaQTUQiPIImuFYpcY5QqD/vQIjhCnXfZfAdTODQ4DnIxPz0 0IejpthyZSx3chxfUEWymAtMRGpn0FI6lWZnp29OGxEODUkmWyNYK0hvBRvlvBs7ragNM6 9kyb9LoPtTgc/zu4+l5LOHw78ysYvO4= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Herbert Xu Cc: Matthew Wilcox , David Laight , "linux-kernel@vger.kernel.org" , Thomas Graf , "netdev@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "maple-tree@lists.infradead.org" , "rcu@vger.kernel.org" Subject: Re: [PATCH 0/1] Rosebush, a new hash table Message-ID: References: <20240222203726.1101861-1-willy@infradead.org> <4a1416fcb3c547eb9612ce07da6a77ed@AcuMS.aculab.com> <2s73sed5n6kxg42xqceenjtcwxys4j2r5dc5x4fdtwkmhkw3go@7viy7qli43wd> <5p5sypt3y643rr7kp66lhmgksgtuvdgijrryh53mqiiqkrgyty@d4zcnya22owg> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT On Sun, Feb 25, 2024 at 01:53:35PM +0800, Herbert Xu wrote: > On Sun, Feb 25, 2024 at 12:51:06AM -0500, Kent Overstreet wrote: > > > > but your distribution actually is accurate in general, golden ratio hash > > is relly nice for sequential integers. the actual problem with your test > > is that you're testing 100% occupancy - no one does that. > > > > 75% occupancy, siphash: > > 0: 933 > > 1: 60 > > 2: 6 > > 3: 1 > > 4: 0 > > > > that looks about right to me. > > The point is that the worst-case length grows with the size of > the table so it won't always be 3. You need to take into account > the largest table size that you will support. ok, but - one million entries, siphash, 75% fill factor 0: 472053 1: 354786 2: 132663 3: 33267 4: 6218 5: 884 6: 110 7: 17 8: 2 9: 0 100 million: 0: 51342703 1: 34224025 2: 11413241 3: 2534946 4: 421816 5: 56271 6: 6346 7: 593 8: 56 9: 3 10: 0 it's a log curve - chain length of 16 means you picked a bad hash function.