Debugging kernel semaphore contention and priority inversion

From: Davda, Bhavesh P (Bhavesh)
Date: Wed Aug 17 2005 - 17:54:48 EST


Is there a way to know which task has a particular (struct semaphore *)
down()ed, leading to another task's down() blocking on it?

I'm trying to debug a priority inversion caused by potentially a real
low priority SCHED_OTHER task (potentially a kernel thread like
kjournald) holding an inode->i_sem semaphore for a file that is blocking
a write() from a high-priority (50) SCHED_FIFO task.

It would be helpful to get a kernel stacktrace for the culprit too.

Thanks

- Bhavesh

Ps: ideally I would like to do this from a module/probe I can insert in
a system that is stuck in this state, because I don't want to Heisenberg
the setup with a kdb or otherwise instrumented kernel.



Bhavesh P. Davda | Distinguished Member of Technical Staff | Avaya |
1300 West 120th Avenue | B3-B03 | Westminster, CO 80234 | U.S.A. |
Voice/Fax: 303.538.4438 | bhavesh@xxxxxxxxx


-
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/