[ltt-dev] liburcu-defer: Userspace RCU "call_rcu()" API

Mathieu Desnoyers mathieu.desnoyers at polymtl.ca
Sat Sep 19 22:59:34 EDT 2009


* Mathieu Desnoyers (mathieu.desnoyers at polymtl.ca) wrote:
> Hi !
> 
> I just coded an "automated memory reclamation" library based on RCU.
> 
[snip]
> Note that I did a specialized library for
> memory reclamation rather than a generic "call_rcu()" because I wanted
> to have a simple array of pointers rather than tuples (function,
> pointer) to ensure we use the minimum amount of cache. So it's currently
> limited to "free()" calls. More flexibility might be welcome though, but
> not at the expense of cache if possible. I'm trying to come up with a
> cheap way to have per-callback queues.
> 

The library is renamed to liburcu-defer. I managed to find a way to
encode pointers to take very little space in the call_rcu queues:

commit 804b437535f97b519db3e8715807950f5818cf27
Author: Mathieu Desnoyers <mathieu.desnoyers at polymtl.ca>
Date:   Sat Sep 19 22:20:16 2009 -0400

    generic urcu deferral (call_rcu())
    
    Found out a way to encode the queues so the standard scenario is to use a single
    pointer per call_rcu().
    
    Uses more space for:
    - unaligned functions pointers.
    - unaligned data pointers.
    - function/data value : -2L. (this is arbitrary)
    
    Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at polymtl.ca>

Comments are welcome,

Mathieu

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68




More information about the lttng-dev mailing list