From: NeilBrown <neilb@suse.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Thomas Graf <tgraf@suug.ch>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/8] rhashtable: remove nulls_base and related code.
Date: Sun, 06 May 2018 07:37:49 +1000 [thread overview]
Message-ID: <877eoheqc2.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <20180505091208.tnsxi6hdpjn456yz@gondor.apana.org.au>
[-- Attachment #1: Type: text/plain, Size: 2289 bytes --]
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.
>>
>> 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.
>>
>> 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.
>>
>> Signed-off-by: NeilBrown <neilb@suse.com>
>
> 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,
> --
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next prev parent reply other threads:[~2018-05-05 21:38 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-04 3:54 [PATCH 0/8] Assorted rhashtable fixes and cleanups NeilBrown
2018-05-04 3:54 ` [PATCH 8/8] rhashtable: don't hold lock on first table throughout insertion NeilBrown
2018-05-05 9:41 ` Herbert Xu
2018-05-05 22:00 ` NeilBrown
2018-05-06 5:20 ` Herbert Xu
2018-05-06 22:24 ` NeilBrown
2018-05-07 9:29 ` Herbert Xu
2018-05-08 0:23 ` NeilBrown
2018-05-04 3:54 ` [PATCH 6/8] rhashtable: further improve stability of rhashtable_walk NeilBrown
2018-05-05 9:42 ` Herbert Xu
2018-05-05 21:50 ` NeilBrown
2018-05-07 9:30 ` Herbert Xu
2018-05-08 0:54 ` NeilBrown
2018-05-04 3:54 ` [PATCH 1/8] rhashtable: silence RCU warning in rhashtable_test NeilBrown
2018-05-05 9:10 ` Herbert Xu
2018-05-05 21:49 ` NeilBrown
2018-05-04 3:54 ` [PATCH 2/8] rhashtable: remove nulls_base and related code NeilBrown
2018-05-05 9:12 ` Herbert Xu
2018-05-05 21:37 ` NeilBrown [this message]
2018-05-07 9:27 ` Herbert Xu
2018-05-08 1:14 ` NeilBrown
2018-05-04 3:54 ` [PATCH 5/8] rhashtable: remove rhashtable_walk_peek() NeilBrown
2018-05-05 9:30 ` Herbert Xu
2018-05-04 3:54 ` [PATCH 7/8] rhashtable: add rhashtable_walk_prev() NeilBrown
2018-05-05 9:43 ` Herbert Xu
2018-05-05 15:40 ` Tom Herbert
2018-05-06 22:16 ` NeilBrown
2018-05-04 3:54 ` [PATCH 4/8] rhashtable: fix race in nested_table_alloc() NeilBrown
2018-05-05 9:29 ` Herbert Xu
2018-05-05 21:48 ` NeilBrown
2018-05-06 5:18 ` Herbert Xu
2018-05-06 22:02 ` NeilBrown
2018-05-04 3:54 ` [PATCH 3/8] rhashtable: use cmpxchg() to protect ->future_tbl NeilBrown
2018-05-05 9:27 ` Herbert Xu
2018-05-05 21:45 ` NeilBrown
2018-05-04 17:07 ` [PATCH 0/8] Assorted rhashtable fixes and cleanups David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877eoheqc2.fsf@notabene.neil.brown.name \
--to=neilb@suse.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tgraf@suug.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).