[lttng-dev] urcu hang in cds_lfht_add

Florian Lohoff f at zz.de
Tue Jan 28 15:24:13 EST 2014


Hi,

i am using urcu hashes for indexing network packets. I am currently
reading a pcap file for replaying so i am single threaded right now.
I am indexing the same packet in multiple different hashes.

I have now added call_rcu for freeing structures and now i experience
hangs.

As soon as i remove the call_rcu the code runs through. with the call_rcu
it hangs after a couple thousand packets in an cds_lfht_add.

As i find RCU still a little mind twisting i fail to find a path
for debugging.

Ah - this is urcu 0.7.7 on Debian/Wheezy amd64

currently i do

rcu_init
rcu_register_thread

h1=cds_lfht_new
h2=cds_lfht_new
h3=cds_lfht_new

for each packet {
 rcu_lock

 res=cds_lfht_add_replace(h1, Pn, ..)

 if (res) {

  cds_lfht_lookup(h2 ...
   cds_lfht_next_duplicate
    cds_lfht_del

  cds_lfht_lookup(h3 ...
   cds_lfht_next_duplicate
    cds_lfht_del

  call_rcu(... res)
 }

 cds_lfht_add(h2, Pn
 cds_lfht_add(h3, Pn

 rcu_unlock
}

Flo
-- 
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/20140128/eb916c8b/attachment.pgp>


More information about the lttng-dev mailing list