From owner-freebsd-fs@freebsd.org Thu May 9 15:41:19 2019 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AB661584A5A for ; Thu, 9 May 2019 15:41:19 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-eopbgr660076.outbound.protection.outlook.com [40.107.66.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 970E66DE3D; Thu, 9 May 2019 15:41:17 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YQBPR0101MB2260.CANPRD01.PROD.OUTLOOK.COM (52.132.70.13) by YQBPR0101MB1443.CANPRD01.PROD.OUTLOOK.COM (52.132.69.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.21; Thu, 9 May 2019 15:41:15 +0000 Received: from YQBPR0101MB2260.CANPRD01.PROD.OUTLOOK.COM ([fe80::e92e:7851:66e9:3967]) by YQBPR0101MB2260.CANPRD01.PROD.OUTLOOK.COM ([fe80::e92e:7851:66e9:3967%7]) with mapi id 15.20.1856.016; Thu, 9 May 2019 15:41:15 +0000 From: Rick Macklem To: "cem@freebsd.org" CC: "freebsd-fs@freebsd.org" Subject: Re: test hash functions for fsid Thread-Topic: test hash functions for fsid Thread-Index: AQHVBauTkubp5doP8E+dPPSC2TDxraZhYDeAgAGKXmU= Date: Thu, 9 May 2019 15:41:15 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fc8b4823-fc45-4d7b-7bc1-08d6d494c586 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:YQBPR0101MB1443; x-ms-traffictypediagnostic: YQBPR0101MB1443: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 003245E729 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(136003)(346002)(396003)(366004)(39860400002)(189003)(199004)(2351001)(46003)(9686003)(478600001)(6246003)(7696005)(33656002)(99286004)(14454004)(229853002)(74482002)(2906002)(786003)(55016002)(2501003)(486006)(74316002)(53936002)(68736007)(6436002)(11346002)(446003)(476003)(71190400001)(71200400001)(5640700003)(66476007)(66556008)(64756008)(66446008)(66946007)(76116006)(73956011)(4326008)(316002)(6916009)(25786009)(450100002)(6506007)(52536014)(102836004)(256004)(186003)(8936002)(5660300002)(8676002)(76176011)(305945005)(86362001)(81156014)(1730700003)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:YQBPR0101MB1443; H:YQBPR0101MB2260.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: X141XRsO/ogRJ1yTqzf3u5eZ4m8X2zTzDpbHgODdZgC+UIYrIZjYS+xsRezbPhiIf828lzzaHyn2+b4xwAPv3gXVBfn4XU6xaLO5E7OLRdyrqYQ15BpvoqF0KvGtX2PevEmKhGtT9bHzxx7Yaxy+JQ9IFs8Z1cqOvUq7ai6ynDIZNKl0b0782JFF+u3I80gv199KH383/jO4DHGlPOJGaozUYBpZ4EHasmGMgN42rXZn8S0AXBC8cs+9PpoetPsjZtz4lrEsKOLr9G8C5nL8/t3afuE5XrBfzTw7AqAOUMtlw7T7KLeHPgySUXgw5JRTUqHuRYvAbELbG70FERgyqyp3mMY7CE4YOhHB70A2l+hOzNygXrsnmMVr3MAkJN2SupLQoknaVostCo+eepckj0zXCi8wUcZXnoUWj6vuybo= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: fc8b4823-fc45-4d7b-7bc1-08d6d494c586 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 May 2019 15:41:15.3007 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: YQBPR0101MB1443 X-Rspamd-Queue-Id: 970E66DE3D X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of rmacklem@uoguelph.ca designates 40.107.66.76 as permitted sender) smtp.mailfrom=rmacklem@uoguelph.ca X-Spamd-Result: default: False [-1.98 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.91)[-0.915,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:40.107.0.0/16]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[uoguelph.ca]; NEURAL_HAM_LONG(-0.98)[-0.980,0]; NEURAL_SPAM_SHORT(0.23)[0.228,0]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[76.66.107.40.list.dnswl.org : 127.0.3.0]; TO_DN_EQ_ADDR_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[] X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 15:41:19 -0000 Conrad Meyer wrote: [good stuff snipped] >Usually it makes sense to size hash tables for the size of the data; >for direct insert tables you want to keep the load factor below 0.8 or >something like that. So the hardcoded 256 doesn't make a ton of >sense, IMO. I took a closer look at the code and I think I can delay use of the hash ta= bles until after getmntinfo() returns the number of file systems, with a little tweaki= ng. Since Peter already has a server with over 72000 file systems, setting it d= ynamically seems worth doing. I didn't understand what you meant by load factor below 0.8, but how does num / 20 (where "num" is the number of file systems->entries to be hash= ed) sound for the size of the tables. (There would be one table now and a secon= d one allocated for the patch that does updated changes to the kernel, for a tota= l of two of them malloc()d when the daemon starts up. The tables are just SLIST_HEAD= ()s or one pointer per table entry. Btw, I will post Peter's test results if he says that's ok, but the first t= hree hashes work about equally well. For his big 72532 file system server and H1 (which seems to be the winner by a small fraction): Mean: 283 Ave variation about the mean: 13 (or less than 5%) [more good stuff snipped] Thanks, rick