lkml.org 
[lkml]   [2006]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Q: locking mechanisms
From
Date
Thomas Gleixner <tglx@linutronix.de> writes:

> Does Documentation/listRCU.txt answer your questions ?

It doesn't answer my question. I have code that receives network
packets by registering with dev_add_pack(). Each packet received is
then delivered to a list of receivers, where this list can contain quite
a lot of items:

receive_function(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt, struct net_device *orig_dev)
{
...
rcu_read_lock();
head = find_list(dev);
hlist_for_each_entry_rcu(p, n, head, list) {
deliver_packet_to_receiver(skb, p);
}
rcu_read_unlock();
}

The deliver_packet_to_receiver() function finally ends up in a call to
sock_queue_rcv_skb().

My questions was, wether I should worry to "hold" the rcu_read_lock for
the time of the list traversal since the list can be quite long and
preemption is disabled between rcu_read_lock() and rcu_read_unlock().


urs
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-07-04 15:02    [W:0.097 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site