[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181116055551.zxfydbpoicslsfkg@gondor.apana.org.au>
Date: Fri, 16 Nov 2018 13:55:51 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: NeilBrown <neilb@...e.com>
Cc: David Miller <davem@...emloft.net>, tgraf@...g.ch,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
eric.dumazet@...il.com
Subject: Re: [PATCH] rhashtable: detect when object movement between tables
might have invalidated a lookup
On Thu, Nov 15, 2018 at 10:32:13AM +1100, NeilBrown wrote:
>
> +#define RHT_NULLS_MARKER(ptr) \
> + ((void *)NULLS_MARKER(((unsigned long) (ptr)) >> 1))
> #define INIT_RHT_NULLS_HEAD(ptr) \
> - ((ptr) = (typeof(ptr)) NULLS_MARKER(0))
> + ((ptr) = RHT_NULLS_MARKER(&(ptr)))
Why are you shifting this by one?
> diff --git a/lib/rhashtable.c b/lib/rhashtable.c
> index 30526afa8343..852ffa5160f1 100644
> --- a/lib/rhashtable.c
> +++ b/lib/rhashtable.c
> @@ -1179,8 +1179,7 @@ struct rhash_head __rcu **rht_bucket_nested(const struct bucket_table *tbl,
> unsigned int hash)
> {
> const unsigned int shift = PAGE_SHIFT - ilog2(sizeof(void *));
> - static struct rhash_head __rcu *rhnull =
> - (struct rhash_head __rcu *)NULLS_MARKER(0);
> + static struct rhash_head __rcu *rhnull;
I don't understand why you can't continue to do NULLS_MARKER(0) or
RHT_NULLS_MARKER(0).
Cheers,
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists