Re: [CHECKER] potential NFS deadlock in 2.6.8.1

From: Nick Piggin
Date: Tue Sep 07 2004 - 22:22:57 EST


Dawson Engler wrote:
Hi All,

below is a possible deadlock in the linux-2.6.8.1 NFS found by a static
deadlock checker I'm writing. Let me know if it looks valid and/or
whether the output is too cryptic.

Thanks,
Dawson

------------------------------------------------------------------

ERROR:DEADLOCK: 2 thread cycle:
lock_kernel <<===>> client_sema


Hi Dawson, your tool looks nice. I don't think the output is too
cryptic.

However, I think these deadlocks may be incorrect because
lock_kernel is not a normal lock. It gets dropped when the
thread blocks, so I *think* it is basically invisible to any
sort of blocking lock when it comes to deadlock cycles.

So if your threads interleave like this:
1 2
lock_kernel();
down(semaphore);
lock_kernel();
down(semaphore);

Then thread 2 will spin on the lock_kernel lock (bkl) until
thread 1 hits down(semaphore) and goes to sleep, releasing
the bkl. Thread 2 takes the bkl and proceeds.

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