[Cbe-oss-dev] [RFC] [PATCH 3:8] SPU Gang Scheduling - Change cbe_spu_info[] mutex to spin lock

Arnd Bergmann arnd at arndb.de
Tue Mar 4 16:31:55 EST 2008


On Monday 03 March 2008, Luke Browning wrote:
> Change the mutex_lock protecting the cbe_spu_info[] to a spin_lock.
> 
> This structure groups the physical spus. The list_mutex must be changed 
> to a spin lock, because the runq_lock is a spin_lock.  You can't nest 
> mutexes under spin_locks.  The lock for the cbe_spu_info[] is taken 
> under the runq_lock as may spus need to be allocated to schedule a gang.
> 
> Change spu_bind_context() and spu_unbind_context() so that they are not 
> called under the new spin lock as that would cause a deadlock, if they
> blocked on higher level allocations (mmap) that are protected by mutexes.
> 
> Signed-off-by: Luke Browning <lukebrowning at us.ibm.com>

Have you checked whether there are places in the code where we
currently take the runq_lock inside of the list_mutex?  If so,
we certainly need to change that code to avoid AB-BA type dead
locks.

Would it be possible to turn the runq_lock into a mutex to get
them to nest in the right order?

	Arnd <><



More information about the cbe-oss-dev mailing list