[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53DB864B.2070205@redhat.com>
Date: Fri, 01 Aug 2014 14:21:31 +0200
From: Nikolay Aleksandrov <nikolay@...hat.com>
To: Thomas Graf <tgraf@...g.ch>, davem@...emloft.net,
netdev@...r.kernel.org
CC: linux-kernel@...r.kernel.org, kaber@...sh.net,
paulmck@...ux.vnet.ibm.com, josh@...htriplett.org,
challa@...ronetworks.com, walpole@...pdx.edu, dev@...nvswitch.org,
tklauser@...tanz.ch, netfilter-devel@...r.kernel.org
Subject: Re: [PATCH net-next 3/3] nftables: Convert nft_hash to use generic
rhashtable
On 08/01/2014 01:58 PM, Thomas Graf wrote:
> The sizing of the hash table and the practice of requiring a lookup
> to retrieve the pprev to be stored in the element cookie before the
> deletion of an entry is left intact.
>
> Signed-off-by: Thomas Graf <tgraf@...g.ch>
> Acked-by: Patrick McHardy <kaber@...sh.net>
> ---
<<snip>>
> @@ -257,36 +82,28 @@ static void nft_hash_elem_destroy(const struct nft_set *set,
> static void nft_hash_remove(const struct nft_set *set,
> const struct nft_set_elem *elem)
> {
> - struct nft_hash *priv = nft_set_priv(set);
> - struct nft_hash_table *tbl = nft_dereference(priv->tbl);
> - struct nft_hash_elem *he, __rcu **pprev;
> + struct rhashtable *priv = nft_set_priv(set);
> + struct rhash_head *he, __rcu **pprev;
>
> pprev = elem->cookie;
> - he = nft_dereference((*pprev));
> -
> - RCU_INIT_POINTER(*pprev, he->next);
> - synchronize_rcu();
> - kfree(he);
> + he = rht_dereference((*pprev), priv);
>
> - /* Shrink table beneath 30% load */
> - if (set->nelems - 1 < tbl->size * 3 / 10 &&
> - tbl->size > NFT_HASH_MIN_SIZE)
> - nft_hash_tbl_shrink(set, priv);
> + rhashtable_remove_pprev(priv, he, pprev, GFP_KERNEL);
> }
<<snip>>
Hi again,
Sorry for the late response but I just got around to check the 3rd patch now,
so my question about this fragment is: before nft_hash_remove() would free the
element after removal, but after this change I don't see where and when the
removed element would get freed ?
Nik
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists