Re: [PATCH net-next] rhashtable: detect when object movement between tables might have invalidated a lookup

From: David Miller
Date: Thu Jul 26 2018 - 16:55:17 EST


From: NeilBrown <neilb@xxxxxxxx>
Date: Mon, 23 Jul 2018 11:56:14 +1000

> Some users of rhashtables might need to move an object from one table
> to another - this appears to be the reason for the incomplete usage
> of NULLS markers.
>
> To support these, we store a unique NULLS_MARKER at the end of
> each chain, and when a search fails to find a match, we check
> if the NULLS marker found was the expected one. If not,
> the search is repeated.
...
> This is a simplified version of a previous patch.
> It provides NULLS_MARKER support only for the specific use case
> which is currently thought be valuable to in-tree users
> of rhashtables.

Neil, this doesn't even compile:

In file included from lib/rhashtable.c:28:
lib/rhashtable.c: In function ʽrht_bucket_nestedʼ:
./include/linux/rhashtable.h:79:2: error: initializer element is not computable at load time
((void *)NULLS_MARKER(((unsigned long) (ptr)) >> 1))
^
lib/rhashtable.c:1178:43: note: in expansion of macro ʽRHT_NULLS_MARKERʼ
static struct rhash_head __rcu *rhnull = RHT_NULLS_MARKER(&rhnull);
^~~~~~~~~~~~~~~~
make[1]: *** [scripts/Makefile.build:318: lib/rhashtable.o] Error 1
make: *** [Makefile:1653: lib/rhashtable.o] Error 2

I imagine you have a mix of other changes or whatever in your tree, so I'll
give you the benefit of the doubt.

But this is the second time this has happened with your rhashtable changes,
so...