Re: [Patch] workqueue: move lockdep annotations up to destroy_workqueue()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Tejun Heo
Date: Wednesday, March 31, 2010 - 8:56 pm

Hello, guys.

On 04/01/2010 11:45 AM, Cong Wang wrote:

I still have some trouble interpreting lockdep warnings.  Please
correct me if I get something wrong.


This (cpu hotplug -> wq) is the expected sequence.  Plug cpu
hotplugging and then flush cpu workqueues.


But lockdep says the other way around has already happened.


This is bond_uninit() calling destroy_workqueue() but I don't get how
this thread would be already holding wq lock.


These two are form a workqueue worker thread and I don't quite
understand why they are here.


This seems to be from the original thread of frame#3.  It's grabbing
wq lock here but the problem is that the lock will be released
immediately, so bond_dev->name (the wq) can't be held by the time it
reaches frame#3.  How is this dependency chain completed?  Is it
somehow transitive through rtnl_mutex?


Isn't there a circular dependency here?  bonding_exit() calls
destroy_workqueue() under rtnl_mutex but destroy_workqueue() should
flush works which could be trying to grab rtnl_lock.  Or am I
completely misunderstanding locking here?

Thanks.

-- 
tejun
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [Patch] workqueue: move lockdep annotations up to dest ..., Tejun Heo, (Wed Mar 31, 8:56 pm)