[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080819074606.GA5261@gondor.apana.org.au>
Date: Tue, 19 Aug 2008 17:46:06 +1000
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Jarek Poplawski <jarkao2@...il.com>
Cc: David Miller <davem@...emloft.net>, 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 07:35:58AM +0000, Jarek Poplawski wrote:
>
> > If we're removing a non-root qdisc, then we will first grab the
> > root qdisc's lock, kill the child, and release the root lock. By
> > convention, any user of a child qdisc must have acquired the root
> > qdisc's lock because the child is only reachable through the root.
> > Therefore once we have released the root qdisc lock after killing
> > the child, we're guaranteed that no further references to that
> > child can be made.
>
> By convention, there was always this comment that destroy is under
> sch_tree_lock(), so it was legal to depend on this. I'm not afraid
> of somebody using such an under destroy qdisc - it's about a code
> inside this qdisc could refer to not destroyed part.
No no no, it's not about qdisc_destroy at all. If you're relying
on the lock around qdisc_destroy, then you're already too late.
The qdisc should have been removed before we get to qdisc_destroy.
It's the act of removal that's protected by the root lock, and
still is. For example, in htb_graft we do sch_tree_lock before
killing any children, this is the lock that I was referring to.
> > If for whatever reason the code does not reflect the reasoning
> > above, please feel free to fix the code :)
>
> Sure, I'll try to look for such problems.
Of course if you find any classful qdisc that does not hold the
tree lock when killing children, then please send patches.
Thanks,
--
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