Received: by 10.192.165.148 with SMTP id m20csp1529776imm; Sat, 5 May 2018 14:40:07 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqfZmiCtn3hZsjBsM1LZnMm226Lywp4t3z0yyIAdcKiZU55Jw9yXpSzZcc+MJzl8TBjXtsh X-Received: by 2002:a65:4c82:: with SMTP id m2-v6mr26426015pgt.23.1525556407238; Sat, 05 May 2018 14:40:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525556407; cv=none; d=google.com; s=arc-20160816; b=lUSLN4tWLCxCTArgReXL+n/7ZEg3SQKvJOKs93bzR5O/VMnDMYTaJIY/Cd02iCPy5F 5Pf/dJusP7viMj2h+BYlQ4jyOBAInR2czzUqc3E+DtAdP2uQRrdMHTNCGFV32Gzw+pYp hFO7mfRsSZmfcFyn4+KNbThNuJOnJFMWdDhTqAUDmXtBKOuCYc3BsQtPMyIO5tZdqJwb 1HlybnNkewnUG1pDQ3WGnchfzrgGM4zNTuCF595+gF+PqfMC3BhMAsvsVHmYCLKL8s0o mgJUY0YLorGpzF9e9Ju3iZW/vdx/jiBHsqvEbEpVyeFCgmUMQRIIQXauOvaXpNF2mVuk 6UuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:references :in-reply-to:subject:cc:date:to:from:arc-authentication-results; bh=ZCbrIq5r49fmlalc+Upv+LmvT9v96dEwGRDcE/05DmU=; b=eDOR+7VgwCBVz2keKTEC51WccUJmOxwoEEpe41VFrcx1VOuTSpWMytvJZicwohWbNQ x6NH1Na2EEuJkkiueys+5Rxrm9mrgETbCYJEt6IuYxOExSlBwmNl9y4q8sVg9TRz+QOU QEY2YqFvOCY/yfGwhId8WLtY/9P1kYO7jqQmqw59gCgc6AWGb+mL01aLmnHZ/ODsd5u2 v0mU336zkEFsKG+D2fbX/99oChNS+LGSOe7C25kQChTadrybPKRwxQg6upy3hZsznGag Z2MapYu2t6jPD8hT6+85KwT3Q5BfqbjRCkN2GvAi1JF9oCL2SXS+Uq4FfSteyU6t0jQ/ GLQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p188-v6si15266253pga.255.2018.05.05.14.39.52; Sat, 05 May 2018 14:40:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751941AbeEEViD (ORCPT + 99 others); Sat, 5 May 2018 17:38:03 -0400 Received: from mx2.suse.de ([195.135.220.15]:46783 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750967AbeEEVh7 (ORCPT ); Sat, 5 May 2018 17:37:59 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 14627ACBA; Sat, 5 May 2018 21:37:58 +0000 (UTC) From: NeilBrown To: Herbert Xu Date: Sun, 06 May 2018 07:37:49 +1000 Cc: Thomas Graf , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/8] rhashtable: remove nulls_base and related code. In-Reply-To: <20180505091208.tnsxi6hdpjn456yz@gondor.apana.org.au> References: <152540595840.18473.11298241115621799037.stgit@noble> <152540605427.18473.12277050439942480863.stgit@noble> <20180505091208.tnsxi6hdpjn456yz@gondor.apana.org.au> Message-ID: <877eoheqc2.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sat, May 05 2018, Herbert Xu wrote: > On Fri, May 04, 2018 at 01:54:14PM +1000, NeilBrown wrote: >> This "feature" is unused, undocumented, and untested and so >> doesn't really belong. If a use for the nulls marker >> is found, all this code would need to be reviewed to >> ensure it works as required. It would be just as easy to >> just add the code if/when it is needed instead. >>=20 >> This patch actually fixes a bug too. The table resizing allows a >> table to grow to 2^31 buckets, but the hash is truncated to 27 bits - >> any growth beyond 2^27 is wasteful an ineffective. >>=20 >> This patch result in NULLS_MARKER(0) being used for all chains, >> and leave the use of rht_is_a_null() to test for it. >>=20 >> Signed-off-by: NeilBrown > > I disagree. This is a fundamental requirement for the use of > rhashtable in certain networking systems such as TCP/UDP. So > we know that there will be a use for this. I can see no evidence that this is required for anything, as it isn't use and I'm fairly sure that in it's current form - it cannot be used. Based on my best guess about how you might intend to use it, I suspect it would be simpler to store the address of the bucket head in the nuls rather than the hash and a magic number. This would make it just as easy to detect when a search reaches the end of the wrong chain, which I presume is the purpose. I would find that useful myself - if the search would repeat when that happened - as I could then use SLAB_TYPESAFE_BY_RCU. Were we to take this approach, all the code I've removed here would still need to be removed. > > As to the bug fix, please separate it out of the patch and resubmit. I don't know how to do that. I don't know what is safe to change without "breaking" the nulls_base code because that code is undocumented and unused, so unmaintainable. In general the kernel has, I believe, a policy against keeping unused interfaces. While that isn't firm and universal, is seems to apply particularly well to unusable interfaces. Thanks, NeilBrown > > Thanks, > --=20 > Email: Herbert Xu > Home Page: http://gondor.apana.org.au/~herbert/ > PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG8Yp69OQ2HB7X0l6Oeye3VZigbkFAlruJC0ACgkQOeye3VZi gbkMohAAhXfoRwWCgDRqVNy0SaQP0Rn7E69Zw7ZID9bEYv6NC/yHNHSShs7YJ2Wn tHpqDvaOwuwE19cSHmUdOqvg/yVdsO+RlX31I4iR7MnVqfB5pg7msNYq58uUV+NE EAKEyxwgv1a+7npX4urd7+gpZ/bNIv7hOQRr+CPPOibqN2sjHdzLT4QbF/plb27e V012V0tSHF3OquF7HWZjl1VvdbfkFrXcwXYZH9X8X2N18oyMHhu5CrouvuDxDqDs XKH3F4/EWT5ybL0WUfIzLNN71Zx3i+L8bnTWyefW1UmiJL/omrYShn1MMDNPstRq t1QB4zjn0oi1r6DWda3QwAbh3s9QBOusCbUudPhZKY/eH6bqJ6pBKMT31aKyGfb3 Gi2xRibuVkmRfTmF0Z1JEZQa4HvOlXzmSxDw3l2eC9+RbZds4kPpklTEL0IDnf6N dMg3DllJtvEUo5EYi24JdO9tTTNdgMrl/JJQzJYHcJunYyx7EXpAMJdMpw+un4oX LqMWfxeAvPBg8RdnUDAJe07faO4YEMyE9jHNBjY8KYJJr7ZD3JFwkwCmsH/eRckt Dhf+uFtM8wBJ+j3nv+0ZxXUJuFw9IgBI3HJ5xIw+MRz/8tRfxGwWFn5epGknHA9R ahiw9196F9vFhNiKfl5zfvXTaTqXi5WKwBIcdDmi8eupknCzlsU= =E1IN -----END PGP SIGNATURE----- --=-=-=--