Skip to contentSkip to conversation

FIB_TRIE: RCU refine

PATCH In review Wang Chen 3 participants 5 messages Mar 20, 2008 – Mar 21, 2008

Subsystems (3)
lore
Share & tools
lore

Wang Chen

author
#0 lore raw

PATCH 1/1 FIB_TRIE: RCU refine

David, sorry to send this patch again.
I sent it yesterday, but seems that it was refused by netdev maillist. I subscribed the mailist and send it again.

On reader side, RCU list-traversal functions, such as *list_for_each_entry_rcu(), should be within an RCU read-side critical section.

Surround them by rcu_read_*lock().

---
 net/ipv4/fib_trie.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
net/ipv4/fib_trie.c +2 -0
index 1ff446d..092e02b 100644
@@ -2416,6 +2416,7 @@ static int fib_trie_seq_show(struct seq_file *seq, void *v)
 		seq_indent(seq, iter->depth);
 		seq_printf(seq, "  |-- %d.%d.%d.%d\n", NIPQUAD(val));
 
+		rcu_read_lock();
 		hlist_for_each_entry_rcu(li, node, &l->list, hlist) {
 			struct fib_alias *fa;
 
@@ -2433,6 +2434,7 @@ static int fib_trie_seq_show(struct seq_file *seq, void *v)
 				seq_putc(seq, '\n');
 			}
 		}
+		rcu_read_unlock();
 	}
 
 	return 0;
Signature · 1 line
WCN
maintainer
#1 lore raw

From: Wang Chen <[email protected]>
Date: Thu, 20 Mar 2008 13:15:07 +0800

Quoted 3 lines

I sent it yesterday, but seems that it was refused by netdev maillist. I subscribed the mailist and send it again.

The server was down starting yesterday afternoon.

It did not reject your posting, and you do not
need to subscribe in order to post.

#2 lore raw
In reply to Wang Chen
Quoted 11 lines

David, sorry to send this patch again.
I sent it yesterday, but seems that it was refused by netdev maillist. I subscribed the mailist and send it again.

On reader side, RCU list-traversal functions, such as *list_for_each_entry_rcu(), should be within an RCU read-side critical section.

Surround them by rcu_read_*lock()

This patch is unnecessary since rcu_read_lock is already fib_trie_seq_start and fib_trie_seq_stop.

maintainer
#3 lore raw

From: Stephen Hemminger <[email protected]>
Date: Thu, 20 Mar 2008 08:35:44 -0700

Quoted 6 lines
Quoted 6 lines

David, sorry to send this patch again.
I sent it yesterday, but seems that it was refused by netdev maillist. I subscribed the mailist and send it again.

Quoted 8 lines
Quoted 5 lines

On reader side, RCU list-traversal functions, such as *list_for_each_entry_rcu(), should be within an RCU read-side critical section.

Surround them by rcu_read_*lock()

This patch is unnecessary since rcu_read_lock is already fib_trie_seq_start and fib_trie_seq_stop.

COrrect.

author
#4 lore raw
In reply to Stephen Hemminger

Stephen Hemminger said the following on 2008-3-20 23:35:

Quoted 5 lines
Quoted 5 lines

David, sorry to send this patch again.
I sent it yesterday, but seems that it was refused by netdev maillist. I subscribed the mailist and send it again.

Quoted 9 lines
Quoted 5 lines

On reader side, RCU list-traversal functions, such as *list_for_each_entry_rcu(), should be within an RCU read-side critical section.

Surround them by rcu_read_*lock()

This patch is unnecessary since rcu_read_lock is already fib_trie_seq_start and fib_trie_seq_stop.

I see.
Thank you, Stephen.