Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp583860rbb; Sat, 24 Feb 2024 14:10:51 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUzksurbYOT8k2ZwIu6oVxbmjIqIq8U03zawLVuulMosbmGa1KW9hvZyKei4NfW5x3X1LPLa3u1gS+0QRVH0nX4ejczAoiZc68cNw7z2w== X-Google-Smtp-Source: AGHT+IFYk1AZlSkKAPW1SMIiQjMihGrE6ilI52YeVYVLcAmlTrlv+Dzgfk0wteIM8lv/8SF4nWE1 X-Received: by 2002:a17:903:26c9:b0:1db:55cc:d226 with SMTP id jg9-20020a17090326c900b001db55ccd226mr2700262plb.66.1708812650964; Sat, 24 Feb 2024 14:10:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708812650; cv=pass; d=google.com; s=arc-20160816; b=hCIiVQZLd+kg6Tc0uKl/qv70xl1kUmH/mtqQizMyhLNdRNW0mYaKiFABQT9dqnW0KE /6r5GLLeZRwUcYfRySw8gSFBruPfOIMYK7mLnTN7wR8epeXD//9EoeWK+6/TqrSiBYU1 bXtdKzdmtQOj65phXum1ixx4vKwwKWK41HHqXQ4HCOTyIa/BsZ4S+1ghnLupe0lE6bA+ pqJpR6lGdCI9/Yz2HGValtsaUzGYJNbsbQLuv8rGn7n1Q3y/xZ/vkyFdYK5qQxkP4MF1 KlxAtFkiFly1jVASRfBy3DxmmcOYqJIwfPjEKq9dnPeTUJo4Ry0fmQ+a8+W4ZUSXy6um dWJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from; bh=7BhrrikZ+pEeByoYVNLsftCFetg4rFV7hLBImoQqOjk=; fh=RPAl0LgFPR0XZena0NZJy4J1jhLiZ/eRV7yy/piq7Fc=; b=Pj4ZnJfQQLuaapKlD7Jc3uSvk7qaD3zcXB4Jalzsn2D3pYwqPQBR8+rSIApWD0nAZd VCrh9LdohQbcz1Zb4MF7imdmj6NoQcM/Y3Wm20EjR/3sesbfQ6tVgJJq+tSTcYogTUE9 EA/tC6zpdCtoobjGOaFD3Qer9iinLJGo6YXqKsx7W3dU4jRqYISUBxu5oIY7OEQVTGSb VV0p0l6j+Ub86JoapRUBYV/WCCbLduZ5g6DSpPyAAQtC0uSATv17w4fhSID5pLLD4Gwm 6ZFDII0PtZf+ummtdsrIrYy0AmyW0Tc6tyzeOvMZ8lrSLtWoyMDaTHwIoIArYQJMA00Z AGPA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=aculab.com dmarc=pass fromdomain=aculab.com); spf=pass (google.com: domain of linux-kernel+bounces-79887-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79887-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id z2-20020a170902834200b001dbf2d899c3si1267654pln.67.2024.02.24.14.10.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 14:10:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79887-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=aculab.com dmarc=pass fromdomain=aculab.com); spf=pass (google.com: domain of linux-kernel+bounces-79887-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79887-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A8A8E28209C for ; Sat, 24 Feb 2024 22:10:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E13FB4D9E9; Sat, 24 Feb 2024 22:10:40 +0000 (UTC) Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) (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 886854D11B for ; Sat, 24 Feb 2024 22:10:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.58.86.151 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708812640; cv=none; b=spC+rWerabZUgXVLgrNhSTvcVyIiA937RmV6zRcC9K6KiST77zf/gdG312KvwXoQcmN+TdL/7AZdL3DstrGcHOPbM3d3VXZIR1lmTRkX02jqNh0cWGgatsnuLh2kOGShmS6jAULSjp3j+3ShytC2C1BFJbb5gk+Xx4nHfSvn6/s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708812640; c=relaxed/simple; bh=3ptU5r2TNQLqAXFUNm3uyWN2DrpdKyRJ6+9DsuJYWIM=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: MIME-Version:Content-Type; b=Y+kir8CJEsVCY9jeOSXaa4aSAG3b/BgUOy9sL+eTEuoZigT2joUWJrijVimGzT5bcW0yXkIfANH7OEFy1WHaJvFh/iLVRD+f1w2vKoycb04jHDM5n92V8hWQdKKX/J1SKAJ9rGwHKX+W1K1N5LN92vFXF2HdM4gMZ/le16+/mDI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ACULAB.COM; spf=pass smtp.mailfrom=aculab.com; arc=none smtp.client-ip=185.58.86.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ACULAB.COM Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aculab.com Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-209-K7PK0T93M2GOk-Vn9vdHcA-1; Sat, 24 Feb 2024 22:10:28 +0000 X-MC-Unique: K7PK0T93M2GOk-Vn9vdHcA-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Sat, 24 Feb 2024 22:10:27 +0000 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Sat, 24 Feb 2024 22:10:27 +0000 From: David Laight To: 'Herbert Xu' , "Matthew Wilcox (Oracle)" CC: "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 Thread-Topic: [PATCH 0/1] Rosebush, a new hash table Thread-Index: AQHaZrdg3OPv1gzlbEiBbQpUz0xlprEaCpvw Date: Sat, 24 Feb 2024 22:10:27 +0000 Message-ID: <4a1416fcb3c547eb9612ce07da6a77ed@AcuMS.aculab.com> References: <20240222203726.1101861-1-willy@infradead.org> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable From: Herbert Xu > Sent: 24 February 2024 00:21 >=20 > On Thu, Feb 22, 2024 at 08:37:23PM +0000, Matthew Wilcox (Oracle) wrote: > > > > Where I expect rosebush to shine is on dependent cache misses. > > I've assumed an average chain length of 10 for rhashtable in the above > > memory calculations. That means on average a lookup would take five ca= che > > misses that can't be speculated. Rosebush does a linear walk of 4-byte >=20 > Normally an rhashtable gets resized when it reaches 75% capacity > so the average chain length should always be one. The average length of non-empty hash chains is more interesting. You don't usually search for items in empty chains. The only way you'll get all the chains of length one is if you've carefully picked the data so that it hashed that way. I remember playing around with the elf symbol table for a browser and all its shared libraries. While the hash function is pretty trivial, it really didn't matter whether you divided 2^n, 2^n-1 or 'the prime below 2^n' some hash chains were always long. =09David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1= PT, UK Registration No: 1397386 (Wales)