[lttng-dev] Using rculist for dirty tracking

Lego Lin lego.lin at gmail.com
Fri Aug 7 03:24:22 EDT 2020


Hi,
I am new for using rcu and I need some helps for integrating user space rcu
into my project for solving performance issue.
In my project, I create 2 link list - one for free pool, one for using pool.
Free pool used to hold a segment of memory that no-one use.
Using pool used to hold a segment of memory that someone use.
Originally, I use a pthread_spin_lock to protect
1. alloc memory segment from free pool, and move memory segment from free
pool to using pool
2. free memory segment from using pool, and move memory segment from free
pool to using pool

For RCU, I change the list_move_tail as following
cds_list_for_each_entry_safe(cur, next, &(membk_pool->bk_free_pool),
entry_pool) {
    cds_list_del_rcu(&cur->entry_pool);
    urcu_bp_synchronize_rcu();
    cds_list_add_tail_rcu(&ret->entry_pool, &(membk_pool->bk_using_pool));
}

Is it ok to use scenario like this?

Meanwhile, that are some advance list operation API:
1. list_first_entry
2. list_first_entry_or_null
Is it possible to integrate these into current urcu?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20200807/36cfe38b/attachment.htm>


More information about the lttng-dev mailing list