[ltt-dev] [PATCH 5/9] rculfhash: avoid unneed garbage collect

Lai Jiangshan laijs at cn.fujitsu.com
Mon Oct 10 21:23:55 EDT 2011


Signed-off-by: Lai Jiangshan <laijs at cn.fujitsu.com>
---
 rculfhash.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/rculfhash.c b/rculfhash.c
index 1c859ed..f901ded 100644
--- a/rculfhash.c
+++ b/rculfhash.c
@@ -850,7 +850,7 @@ struct cds_lfht_node *_cds_lfht_add(struct cds_lfht *ht,
 				enum add_mode mode, int dummy)
 {
 	struct cds_lfht_node *iter_prev, *iter, *next, *new_node, *new_next,
-			*dummy_node, *return_node;
+			*return_node;
 	struct _cds_lfht_node *lookup;
 
 	assert(!is_dummy(node));
@@ -919,7 +919,7 @@ struct cds_lfht_node *_cds_lfht_add(struct cds_lfht *ht,
 				return_node = NULL;
 			else	/* ADD_DEFAULT and ADD_UNIQUE */
 				return_node = node;
-			goto gc_end;
+			goto end;
 		}
 
 	replace:
@@ -941,10 +941,6 @@ struct cds_lfht_node *_cds_lfht_add(struct cds_lfht *ht,
 		(void) uatomic_cmpxchg(&iter_prev->p.next, iter, new_next);
 		/* retry */
 	}
-gc_end:
-	/* Garbage collect logically removed nodes in the bucket */
-	dummy_node = (struct cds_lfht_node *) lookup;
-	_cds_lfht_gc_bucket(dummy_node, node);
 end:
 	return return_node;
 }
-- 
1.7.4.4





More information about the lttng-dev mailing list