Deadlock between tasklist_lock and dcache_lock

From: Manfred Spraul (manfred@colorfullife.com)
Date: Sun Mar 23 2003 - 12:28:22 EST


__unhash_process acquires the dcache_lock while holding the tasklist_lock
for writing. AFAICS this can deadlock:

CPU1:
        [ in release_task() ]
        write_lock_irq(&tasklist_lock);
        __unhash_process()
        
CPU2:
        spin_lock(&dcache_lock);
        <interrupt>
        read_lock(&tasklist_lock);, // e.g. for signal delivery
        ** spins, lock held by cpu 1 for writing.

CPU1:
        [ within __unhash_process() ]
        spin_lock(&dcache_lock);
        ** spins, lock held by CPU2

Probably the callers of __unhash_process must acquire the dcache_lock
before write_lock_irq(&tasklist_lock).

Any other ideas how to fix the deadlock?

--
	Manfred

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Mar 23 2003 - 22:00:45 EST