aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_rhashtable.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-03-23 09:50:26 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-23 22:07:52 -0400
commitb824478b2145be78ac19e1cf44e2b9036c7a9608 (patch)
tree19c7d4ad479fd987eef5fd9b6063df27fd26012a /lib/test_rhashtable.c
parent18093d1c0d1e032142ee24825678b0a8977d74ba (diff)
rhashtable: Add multiple rehash support
This patch adds the missing bits to allow multiple rehashes. The read-side as well as remove already handle this correctly. So it's only the rehasher and insertion that need modification to handle this. Note that this patch doesn't actually enable it so for now rehashing is still only performed by the worker thread. This patch also disables the explicit expand/shrink interface because the table is meant to expand and shrink automatically, and continuing to export these interfaces unnecessarily complicates the life of the rehasher since the rehash process is now composed of two parts. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/test_rhashtable.c')
-rw-r--r--lib/test_rhashtable.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/lib/test_rhashtable.c b/lib/test_rhashtable.c
index a2ba6adb60a2..a42a0d44e818 100644
--- a/lib/test_rhashtable.c
+++ b/lib/test_rhashtable.c
@@ -155,30 +155,6 @@ static int __init test_rhashtable(struct rhashtable *ht)
155 test_rht_lookup(ht); 155 test_rht_lookup(ht);
156 rcu_read_unlock(); 156 rcu_read_unlock();
157 157
158 for (i = 0; i < TEST_NEXPANDS; i++) {
159 pr_info(" Table expansion iteration %u...\n", i);
160 mutex_lock(&ht->mutex);
161 rhashtable_expand(ht);
162 mutex_unlock(&ht->mutex);
163
164 rcu_read_lock();
165 pr_info(" Verifying lookups...\n");
166 test_rht_lookup(ht);
167 rcu_read_unlock();
168 }
169
170 for (i = 0; i < TEST_NEXPANDS; i++) {
171 pr_info(" Table shrinkage iteration %u...\n", i);
172 mutex_lock(&ht->mutex);
173 rhashtable_shrink(ht);
174 mutex_unlock(&ht->mutex);
175
176 rcu_read_lock();
177 pr_info(" Verifying lookups...\n");
178 test_rht_lookup(ht);
179 rcu_read_unlock();
180 }
181
182 rcu_read_lock(); 158 rcu_read_lock();
183 test_bucket_stats(ht, true); 159 test_bucket_stats(ht, true);
184 rcu_read_unlock(); 160 rcu_read_unlock();