Re: [PATCH 6/13] bridge: Add core IGMP snooping support

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Paul E. McKenney
Date: Friday, March 5, 2010 - 10:06 pm

On Sat, Mar 06, 2010 at 09:17:18AM +0800, Herbert Xu wrote:

Agreed, but the callbacks registered by the call_rcu_bh() might run
at any time, possibly quite some time after the synchronize_rcu_bh()
completes.  For example, the last call_rcu_bh() might register on
one CPU, and the synchronize_rcu_bh() on another CPU.  Then there
is no guarantee that the call_rcu_bh()'s callback will execute before
the synchronize_rcu_bh() returns.

In contrast, rcu_barrier_bh() is guaranteed not to return until all
pending RCU-bh callbacks have executed.


I might simply have missed the operation that removed reader
visibility, looking again...

Ah, I see it.  The "br->mdb = NULL" in br_multicast_stop() makes
it impossible for the readers to get to any of the data.  Right?

If so, my confusion, you are right, this one is OK.


But spin_lock() does not take the place of rcu_read_lock_bh().
And so, in theory, the RCU-bh grace period could complete between
the time that br_multicast_del_pg() does its call_rcu_bh() and the
"*pp = p->next;" at the top of the next loop iteration.  If so,
then br_multicast_free_pg()'s kfree() will possibly have clobbered
"p->next".  Low probability, yes, but a long-running interrupt
could do the trick.

Or is there something I am missing that is preventing an RCU-bh
grace period from completing near the bottom of br_multicast_del_pg()'s
"for" loop?


Good!


Hmmm...  So the caller is responsible for rcu_read_lock_bh()?

Shouldn't the br_mdb_get() code path be using hlist_for_each_entry_rcu()
in __br_mdb_ip_get(), then?  Or is something else going on here?

							Thanx, Paul

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] [1/13] bridge: Add IGMP snooping support, Herbert Xu, (Fri Feb 26, 8:34 am)
[PATCH 6/13] bridge: Add core IGMP snooping support, Herbert Xu, (Fri Feb 26, 8:35 am)
[PATCH 8/13] bridge: Add multicast start/stop hooks, Herbert Xu, (Fri Feb 26, 8:35 am)
[PATCH 9/13] bridge: Add multicast data-path hooks, Herbert Xu, (Fri Feb 26, 8:35 am)
Re: [PATCH 10/13] bridge: Add multicast_router sysfs entries, Stephen Hemminger, (Fri Feb 26, 5:42 pm)
[1/13] bridge: Add IGMP snooping support, Herbert Xu, (Sat Feb 27, 10:40 pm)
[PATCH 4/13] bridge: Use BR_INPUT_SKB_CB on xmit path, Herbert Xu, (Sat Feb 27, 10:41 pm)
[PATCH 6/13] bridge: Add core IGMP snooping support, Herbert Xu, (Sat Feb 27, 10:41 pm)
[PATCH 8/13] bridge: Add multicast start/stop hooks, Herbert Xu, (Sat Feb 27, 10:41 pm)
[PATCH 9/13] bridge: Add multicast data-path hooks, Herbert Xu, (Sat Feb 27, 10:41 pm)
Re: [1/13] bridge: Add IGMP snooping support, David Miller, (Sun Feb 28, 1:52 am)
Re: [1/13] bridge: Add IGMP snooping support, Herbert Xu, (Sun Feb 28, 7:08 pm)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, Paul E. McKenney, (Fri Mar 5, 4:43 pm)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, Paul E. McKenney, (Fri Mar 5, 10:06 pm)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, Paul E. McKenney, (Sat Mar 6, 8:00 am)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, Paul E. McKenney, (Sat Mar 6, 8:19 am)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, Paul E. McKenney, (Sat Mar 6, 12:00 pm)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, Paul E. McKenney, (Sat Mar 6, 8:11 pm)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, Arnd Bergmann, (Mon Mar 8, 11:50 am)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, Paul E. McKenney, (Mon Mar 8, 8:15 pm)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, Arnd Bergmann, (Tue Mar 9, 2:12 pm)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, Paul E. McKenney, (Tue Mar 9, 7:14 pm)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, Arnd Bergmann, (Wed Mar 10, 2:41 am)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, Eric Dumazet, (Wed Mar 10, 3:39 am)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, Paul E. McKenney, (Wed Mar 10, 6:13 am)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, Paul E. McKenney, (Wed Mar 10, 6:19 am)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, Arnd Bergmann, (Wed Mar 10, 6:27 am)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, Arnd Bergmann, (Wed Mar 10, 6:30 am)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, Arnd Bergmann, (Wed Mar 10, 6:39 am)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, Paul E. McKenney, (Wed Mar 10, 6:57 am)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, Paul E. McKenney, (Wed Mar 10, 9:26 am)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, David Miller, (Wed Mar 10, 9:35 am)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, Arnd Bergmann, (Wed Mar 10, 10:56 am)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, Paul E. McKenney, (Wed Mar 10, 2:25 pm)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, Arnd Bergmann, (Thu Mar 11, 11:49 am)
Re: [PATCH 6/13] bridge: Add core IGMP snooping support, Paul E. McKenney, (Sun Mar 14, 4:01 pm)
[PATCH net-next] bridge: use is_multicast_ether_addr, Stephen Hemminger, (Tue Apr 27, 10:13 am)
[PATCH net-next] bridge: multicast router list manipulation, Stephen Hemminger, (Tue Apr 27, 10:13 am)
Re: [PATCH net-next] bridge: use is_multicast_ether_addr, David Miller, (Tue Apr 27, 12:53 pm)
Re: [PATCH net-next] bridge: multicast router list manipul ..., Michał Mirosław, (Tue Apr 27, 4:11 pm)
Re: [PATCH net-next] bridge: multicast router list manipul ..., Stephen Hemminger, (Tue Apr 27, 4:25 pm)
Re: [PATCH net-next] bridge: multicast router list manipul ..., Stephen Hemminger, (Tue Apr 27, 4:44 pm)