Messages in this thread | | | Subject | Re: robust futex deadlock detection patch | From | Steven Rostedt <> | Date | Mon, 09 Jan 2006 16:08:06 -0500 |
| |
On Mon, 2006-01-09 at 21:16 +0100, Esben Nielsen wrote:
> You only take the spinlocks corresponding to the current lock. What about > the next locks in the chain? Remember those locks might not be > futexes but a lock inside the kernel, taken in system calls. I.e. the > robust_sem might not protect you. > If there are n locks you need to lock n lock->wait_lock and n > owner->task->pi_lock as you traverse the locks. That is what I tried to > sketch in the examble below.
The thing about this is that you can't (if the kernel is not buggy) deadlock on the kernel spin locks. As long as you protect the locks in the futex from deadlocking you are fine. This is because you don't grab a futex after grabbing a kernel spin lock. All kernel spin locks __must__ be released before going back to user land, and that's where you grab the futexes.
-- Steve
- 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/
| |