Thread (44 messages) flat view 44 messages, 5 authors, 2015-03-23

Re: [v2 PATCH 7/10] rhashtable: Disable automatic shrinking

From: Thomas Graf <tgraf@suug.ch>
Date: 2015-03-22 13:06:33

On 03/22/15 at 12:17pm, Thomas Graf wrote:
On 03/22/15 at 07:04pm, Herbert Xu wrote:
quoted
+	struct bucket_table *new_tbl;
+	struct bucket_table *tbl;
+	int err;
 
-	ASSERT_RHT_MUTEX(ht);
+	if (size < ht->p.min_size)
+		size = ht->p.min_size;
We should only shrink if size < old_tbl->size
I found the check further down. Any particular reason why check
after allocation and then free again? Why do you want to avoid
the allocation inside the mutex?
quoted
-	new_tbl = bucket_table_alloc(ht, old_tbl->size / 2);
+	new_tbl = bucket_table_alloc(ht, size);
 	if (new_tbl == NULL)
 		return -ENOMEM;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help