From 61a87122869b6340a63b6f9f84097d3688604b90 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 27 Jun 2006 02:54:56 -0700 Subject: [PATCH] pi-futex: rt mutex tester RT-mutex tester: scriptable tester for rt mutexes, which allows userspace scripting of mutex unit-tests (and dynamic tests as well), using the actual rt-mutex implementation of the kernel. [akpm@osdl.org: fixlet] Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Signed-off-by: Arjan van de Ven Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/rtmutex_common.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'kernel/rtmutex_common.h') diff --git a/kernel/rtmutex_common.h b/kernel/rtmutex_common.h index 50eed60eb085..e068024eeffc 100644 --- a/kernel/rtmutex_common.h +++ b/kernel/rtmutex_common.h @@ -14,6 +14,28 @@ #include +/* + * The rtmutex in kernel tester is independent of rtmutex debugging. We + * call schedule_rt_mutex_test() instead of schedule() for the tasks which + * belong to the tester. That way we can delay the wakeup path of those + * threads to provoke lock stealing and testing of complex boosting scenarios. + */ +#ifdef CONFIG_RT_MUTEX_TESTER + +extern void schedule_rt_mutex_test(struct rt_mutex *lock); + +#define schedule_rt_mutex(_lock) \ + do { \ + if (!(current->flags & PF_MUTEX_TESTER)) \ + schedule(); \ + else \ + schedule_rt_mutex_test(_lock); \ + } while (0) + +#else +# define schedule_rt_mutex(_lock) schedule() +#endif + /* * This is the control structure for tasks blocked on a rt_mutex, * which is allocated on the kernel stack on of the blocked task. -- cgit v1.2.3