• Mathieu Desnoyers's avatar
    markers: use synchronize_sched() · 6496968e
    Mathieu Desnoyers authored
    Markers do not mix well with CONFIG_PREEMPT_RCU because it uses
    preempt_disable/enable() and not rcu_read_lock/unlock for minimal
    intrusiveness.  We would need call_sched and sched_barrier primitives.
    
    Currently, the modification (connection and disconnection) of probes
    from markers requires changes to the data structure done in RCU-style :
    a new data structure is created, the pointer is changed atomically, a
    quiescent state is reached and then the old data structure is freed.
    
    The quiescent state is reached once all the currently running
    preempt_disable regions are done running.  We use the call_rcu mechanism
    to execute kfree() after such quiescent state has been reached.
    However, the new CONFIG_PREEMPT_RCU version of call_rcu and rcu_barrier
    does not guarantee that all preempt_disable code regions have finished,
    hence the race.
    
    The "proper" way to do this is to use rcu_read_lock/unlock, but we don't
    want to use it to minimize intrusiveness on the traced system.  (we do
    ...
    6496968e
marker.c 23.7 KB