rculfhash: add TODO for resize worker threads
[urcu.git] / rculfhash.c
index 09840f2f75694529c17ab2ede16be0ec3b475bda..6ac53ea5bae5b1f3fea8ec1ecf98f5939110f25e 100644 (file)
@@ -813,7 +813,6 @@ struct cds_lfht_node *_cds_lfht_add(struct cds_lfht *ht,
                        new_next = flag_dummy(clear_flag(next));
                else
                        new_next = clear_flag(next);
-               assert(new_next != NULL);
                (void) uatomic_cmpxchg(&iter_prev->p.next, iter, new_next);
                /* retry */
        }
@@ -849,7 +848,6 @@ int _cds_lfht_remove(struct cds_lfht *ht, unsigned long size,
                        assert(is_dummy(next));
                else
                        assert(!is_dummy(next));
-               assert(next != NULL);
                old = uatomic_cmpxchg(&node->p.next, next,
                                      flag_removed(next));
        } while (old != next);
@@ -885,6 +883,12 @@ end:
  * Holding RCU read lock to protect _cds_lfht_add against memory
  * reclaim that could be performed by other call_rcu worker threads (ABA
  * problem).
+ *
+ * TODO: when we reach a certain length, we can split this population phase over
+ * many worker threads, based on the number of CPUs available in the system.
+ * This should therefore take care of not having the expand lagging behind too
+ * many concurrent insertion threads by using the scheduler's ability to
+ * schedule dummy node population fairly with insertions.
  */
 static
 void init_table_populate(struct cds_lfht *ht, unsigned long i, unsigned long len)
@@ -969,6 +973,11 @@ void init_table(struct cds_lfht *ht,
  *
  * Logical removal and garbage collection can therefore be done in batch or on a
  * node-per-node basis, as long as the guarantee above holds.
+ *
+ * TODO: when we reach a certain length, we can split this removal over many
+ * worker threads, based on the number of CPUs available in the system. This
+ * should take care of not letting resize process lag behind too many concurrent
+ * updater threads actively inserting into the hash table.
  */
 static
 void remove_table(struct cds_lfht *ht, unsigned long i, unsigned long len)
This page took 0.023396 seconds and 4 git commands to generate.