Subject: Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().

From: Jarek Poplawski <[email-masked]>
Date: Thu, 21 Aug 2008 11:55:22 +0000

On Thu, Aug 21, 2008 at 09:26:09PM +1000, Herbert Xu wrote:
> On Thu, Aug 21, 2008 at 11:20:56AM +0000, Jarek Poplawski wrote:
> >
> > I thought I described the problem quite clearly, except this error in
> > the lock name. I certainly can miss much more things than you. And,
> > after your answer I'm simply not sure if the question is still valid.
> 
> OK I've lost track of what you were trying to say.  Could you please
> just restate the problem you saw?
> 

Sure, here is a scenario:

cpu1					cpu2
rtnl_lock()
qdisc_graft()
// parent != NULL
->cops-graft()
notify_and_destroy()			qdisc_run()
					spin_lock(root_lock)
qdisc_destroy(old)			dequeue_skb()
					tbf_dequeue()
					qdisc_tree_decrease_qlen()	
					qdisc_lookup()
//deleting from qdisc_sleeping->list	//walking qdisc_sleeping->list
//under rtnl_lock() only		//under qdisc root_lock only
list_del(qdisc->list)			list_for_each_entry(txq_root)

Jarek P.