[lttng-dev] [PATCH liburcu] Fix lifetime of rcu_barrier()'s completion structure

Keir Fraser keir at cohodata.com
Fri Apr 18 16:12:49 EDT 2014


[Another attachment, I must sort out to integrate with git send-mail]

rcu_barrier() can return as soon as completion.barrier_count==0, which 
frees the completion struct along with the rest of its stack frame. But 
its call_rcu callbacks may yet try to read and write completion.futex 
via the wake_up function.

Fix this by calloc()ing the completion struct and implementing a 
reference count to determine when it is eventually free()d.

This also fixes bug #787, since calloc() initialises all fields of the 
structure to zero.

  Regards,
  Keir
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rcu_barrier_completion_delay_free.patch
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20140418/371c3f48/attachment.ksh>


More information about the lttng-dev mailing list