[lttng-dev] URCU accessing rcu_head->func

Florian Lohoff f at zz.de
Fri Jan 31 15:16:32 EST 2014


i am having multiple timer which can issue a call_rcu on an object using
an rcu_head.

It can happen than an object is already on the call_rcu list
for destruction and another timer fires.

So i am doing something like this.

	if (!rs->rcuhead.func) {
		call_rcu(&rs->rcuhead, free_obj);

I have a feeling in my gut that this didnt blow up
just by accident and i am doing something utterly stupid.

I am in the read side critical section so my structure
cant appear under my feet but the above can be racy at

What would be the best way to achieve something like:

	"queue for call_rcu if not already queued"

Another flag with an atomic inc or something?

Florian Lohoff                                                 f at zz.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20140131/378ccac1/attachment.pgp>

More information about the lttng-dev mailing list