diff options
author | Thomas Graf <tgraf@suug.ch> | 2015-03-24 16:42:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-24 17:48:40 -0400 |
commit | b5e2c150ac914f28a28833b57397bec0b0a2bd5f (patch) | |
tree | d22f31d07f001ac2afb5ca7a15de3fee73e74ab6 /net | |
parent | ac833bddb591b9c7a0609f440f196375be184044 (diff) |
rhashtable: Disable automatic shrinking by default
Introduce a new bool automatic_shrinking to require the
user to explicitly opt-in to automatic shrinking of tables.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/nft_hash.c | 1 | ||||
-rw-r--r-- | net/netlink/af_netlink.c | 1 | ||||
-rw-r--r-- | net/tipc/socket.c | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/net/netfilter/nft_hash.c b/net/netfilter/nft_hash.c index ad3966976cf5..8577a37af18b 100644 --- a/net/netfilter/nft_hash.c +++ b/net/netfilter/nft_hash.c | |||
@@ -172,6 +172,7 @@ static const struct rhashtable_params nft_hash_params = { | |||
172 | .head_offset = offsetof(struct nft_hash_elem, node), | 172 | .head_offset = offsetof(struct nft_hash_elem, node), |
173 | .key_offset = offsetof(struct nft_hash_elem, key), | 173 | .key_offset = offsetof(struct nft_hash_elem, key), |
174 | .hashfn = jhash, | 174 | .hashfn = jhash, |
175 | .automatic_shrinking = true, | ||
175 | }; | 176 | }; |
176 | 177 | ||
177 | static int nft_hash_init(const struct nft_set *set, | 178 | static int nft_hash_init(const struct nft_set *set, |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index e2f7f28148e0..4caa809dbbe0 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -3142,6 +3142,7 @@ static const struct rhashtable_params netlink_rhashtable_params = { | |||
3142 | .obj_hashfn = netlink_hash, | 3142 | .obj_hashfn = netlink_hash, |
3143 | .obj_cmpfn = netlink_compare, | 3143 | .obj_cmpfn = netlink_compare, |
3144 | .max_size = 65536, | 3144 | .max_size = 65536, |
3145 | .automatic_shrinking = true, | ||
3145 | }; | 3146 | }; |
3146 | 3147 | ||
3147 | static int __init netlink_proto_init(void) | 3148 | static int __init netlink_proto_init(void) |
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 094710519477..ee90d74d7516 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -2297,6 +2297,7 @@ static const struct rhashtable_params tsk_rht_params = { | |||
2297 | .key_len = sizeof(u32), /* portid */ | 2297 | .key_len = sizeof(u32), /* portid */ |
2298 | .max_size = 1048576, | 2298 | .max_size = 1048576, |
2299 | .min_size = 256, | 2299 | .min_size = 256, |
2300 | .automatic_shrinking = true, | ||
2300 | }; | 2301 | }; |
2301 | 2302 | ||
2302 | int tipc_sk_rht_init(struct net *net) | 2303 | int tipc_sk_rht_init(struct net *net) |