[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080819085052.GA29038@gondor.apana.org.au>
Date: Tue, 19 Aug 2008 18:50:53 +1000
From: Herbert Xu <herbert@...dor.apana.org.au>
To: David Miller <davem@...emloft.net>
Cc: jarkao2@...il.com, netdev@...r.kernel.org, denys@...p.net.lb
Subject: Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
On Tue, Aug 19, 2008 at 01:32:05AM -0700, David Miller wrote:
>
> 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().
I had a look and it seems to be OK to me. Essentially we have
two sides in all this, the read side which is the path that
transmits packets, and the write side which is the control path.
As with a qdisc_destroy, u32_destroy can only be called once all
read sides have exited so we won't be racing against that. In
fact if we were able to race against it then holding the lock is
no good anyway because this implies the u32 object is still
referenced by a qdisc tree and as such once we release the lock
the read side can get back to a destroyed u32 object.
> However, this all might be OK because all of this management
> is performed only under the RTNL semaphore.
Right, all other writers have been excluded by RTNL so we should
be the only thread with a reference to the u32 and we can decrement
the ref count non-atomically.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists