Re: [PATCH] rtnetlink: Synchronze net in rtnl_unregister()

2019-02-25 Thread Dmitry Safonov
On 2/25/19 11:31 PM, Eric Dumazet wrote: > On 02/25/2019 03:21 PM, Dmitry Safonov wrote: >> Well, sure - but it seems confusing that rtnl_unregister() will require >> synchronize_rcu(), while rtnl_unregister_all() will not. > > rtnl_unregister_all() is a different beast, since it removes the

Re: [PATCH] rtnetlink: Synchronze net in rtnl_unregister()

2019-02-25 Thread Eric Dumazet
On 02/25/2019 03:21 PM, Dmitry Safonov wrote: > Hi Eric, > > On 2/25/19 11:09 PM, Eric Dumazet wrote: >> On 02/25/2019 01:27 PM, Dmitry Safonov wrote: >>> While it's possible to document that rtnl_unregister() requires >>> synchronize_net() afterwards - unlike rtnl_unregister_all(), I believe

Re: [PATCH] rtnetlink: Synchronze net in rtnl_unregister()

2019-02-25 Thread Dmitry Safonov
On 2/25/19 11:21 PM, Dmitry Safonov wrote: > Hi Eric, > > On 2/25/19 11:09 PM, Eric Dumazet wrote: >> On 02/25/2019 01:27 PM, Dmitry Safonov wrote: >>> While it's possible to document that rtnl_unregister() requires >>> synchronize_net() afterwards - unlike rtnl_unregister_all(), I believe >>>

Re: [PATCH] rtnetlink: Synchronze net in rtnl_unregister()

2019-02-25 Thread Dmitry Safonov
Hi Eric, On 2/25/19 11:09 PM, Eric Dumazet wrote: > On 02/25/2019 01:27 PM, Dmitry Safonov wrote: >> While it's possible to document that rtnl_unregister() requires >> synchronize_net() afterwards - unlike rtnl_unregister_all(), I believe >> the module exit is very much slow-path. > >

Re: [PATCH] rtnetlink: Synchronze net in rtnl_unregister()

2019-02-25 Thread Eric Dumazet
On 02/25/2019 01:27 PM, Dmitry Safonov wrote: > rtnl_unregister() unsets handler from table, which is protected > by rtnl_lock or RCU. At this moment only dump handlers access the table > with rcu_lock(). Every other user accesses under rtnl. > > Callers may expect that rtnl_unregister()

[PATCH] rtnetlink: Synchronze net in rtnl_unregister()

2019-02-25 Thread Dmitry Safonov
rtnl_unregister() unsets handler from table, which is protected by rtnl_lock or RCU. At this moment only dump handlers access the table with rcu_lock(). Every other user accesses under rtnl. Callers may expect that rtnl_unregister() prevents any further handlers calls, alike