Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
From: David Miller <davem@davemloft.net>
Date: 2008-08-19 08:48:38
From: Jarek Poplawski <redacted> Date: Tue, 19 Aug 2008 08:41:48 +0000
On Tue, Aug 19, 2008 at 01:32:05AM -0700, David Miller wrote:quoted
Jarek may have a point about the u32 classifier. So we should think about it. The hash tables and tp_u_common objects are shared, and it does non-atomic refcounting during destruction, see u32_destroy(). However, this all might be OK because all of this management is performed only under the RTNL semaphore.Sure, this all should be write protected. I'm concerned only about the read side here.
If reference count hits zero, nobody can reference the object. Reference counts only change under RTNL, which is my point. The old qdisc object is taken away from global visibility inside of the cops->graft() call done by qdisc_graft(). This handler already must do whatever locking is necessary while removing the qdisc from visibility from the packet path. And by virtue of that, the old qdisc and anything it references will no longer be visible to the packet processing path after cops->graft() returns.