* [PATCH] FIB_TRIE: RCU refine
@ 2008-03-20 5:15 Wang Chen
2008-03-20 5:19 ` David Miller
2008-03-20 15:35 ` Stephen Hemminger
0 siblings, 2 replies; 5+ messages in thread
From: Wang Chen @ 2008-03-20 5:15 UTC (permalink / raw)
To: David S. Miller; +Cc: NETDEV
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().
Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
---
net/ipv4/fib_trie.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 1ff446d..092e02b 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -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;
--
WCN
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] FIB_TRIE: RCU refine
2008-03-20 5:15 [PATCH] FIB_TRIE: RCU refine Wang Chen
@ 2008-03-20 5:19 ` David Miller
2008-03-20 15:35 ` Stephen Hemminger
1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2008-03-20 5:19 UTC (permalink / raw)
To: wangchen; +Cc: netdev
From: Wang Chen <wangchen@cn.fujitsu.com>
Date: Thu, 20 Mar 2008 13:15:07 +0800
> 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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] FIB_TRIE: RCU refine
2008-03-20 5:15 [PATCH] FIB_TRIE: RCU refine Wang Chen
2008-03-20 5:19 ` David Miller
@ 2008-03-20 15:35 ` Stephen Hemminger
2008-03-20 22:14 ` David Miller
2008-03-21 0:19 ` Wang Chen
1 sibling, 2 replies; 5+ messages in thread
From: Stephen Hemminger @ 2008-03-20 15:35 UTC (permalink / raw)
To: Wang Chen; +Cc: David S. Miller, NETDEV
> 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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] FIB_TRIE: RCU refine
2008-03-20 15:35 ` Stephen Hemminger
@ 2008-03-20 22:14 ` David Miller
2008-03-21 0:19 ` Wang Chen
1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2008-03-20 22:14 UTC (permalink / raw)
To: shemminger; +Cc: wangchen, netdev
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Thu, 20 Mar 2008 08:35:44 -0700
>
> > 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.
COrrect.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] FIB_TRIE: RCU refine
2008-03-20 15:35 ` Stephen Hemminger
2008-03-20 22:14 ` David Miller
@ 2008-03-21 0:19 ` Wang Chen
1 sibling, 0 replies; 5+ messages in thread
From: Wang Chen @ 2008-03-21 0:19 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David S. Miller, NETDEV
Stephen Hemminger said the following on 2008-3-20 23:35:
>> 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.
>
I see.
Thank you, Stephen.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-03-21 0:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-20 5:15 [PATCH] FIB_TRIE: RCU refine Wang Chen
2008-03-20 5:19 ` David Miller
2008-03-20 15:35 ` Stephen Hemminger
2008-03-20 22:14 ` David Miller
2008-03-21 0:19 ` Wang Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).