RT and pi_test

From: Daniel Walker
Date: Wed Jun 01 2005 - 09:27:54 EST



I've run the pi_test a few times recently with some strange
numbers. I'm getting abnormally high task latency if I run
"./test --tasks=10 ./hist" . Depending on how long I run it, I've seen
task latency as high as 3 milliseconds, should be 0.1ms or less.

The first time I saw these latencies I has the PI abstraction applied, and
the most recent time I had the attached patch applied only. This patch is
small so I'm not sure if it could have that type of effect on task
latency.

btw, 'm not incrementing the RTC priority.

Daniel


Index: linux-2.6.11/include/linux/plist.h
===================================================================
--- linux-2.6.11.orig/include/linux/plist.h 2005-05-27 22:04:12.000000000 +0000
+++ linux-2.6.11/include/linux/plist.h 2005-06-01 13:12:37.000000000 +0000
@@ -83,7 +83,7 @@ struct plist {
* @member: the name of the list_struct within the struct.
*/
#define plist_entry(ptr, type, member) \
- container_of(plist_first(ptr), type, member)
+ container_of(ptr, type, member)
/**
* plist_for_each - iterate over the plist
* @pos1: the type * to use as a loop counter.
Index: linux-2.6.11/kernel/rt.c
===================================================================
--- linux-2.6.11.orig/kernel/rt.c 2005-06-01 13:06:21.000000000 +0000
+++ linux-2.6.11/kernel/rt.c 2005-06-01 13:50:08.000000000 +0000
@@ -773,7 +773,7 @@ static inline struct task_struct * pick_
*
* (same-prio RT tasks go FIFO)
*/
- waiter = plist_entry(&lock->wait_list, struct rt_mutex_waiter, list);
+ waiter = plist_entry(plist_first(&lock->wait_list), struct rt_mutex_waiter, list);

trace_special_pid(waiter->task->pid, waiter->task->prio, 0);

@@ -1351,7 +1351,7 @@ static void __up_mutex(struct rt_mutex *
*/
prio = mutex_getprio(old_owner);
if (!plist_empty(&old_owner->pi_waiters)) {
- w = plist_entry(&old_owner->pi_waiters, struct rt_mutex_waiter, pi_list);
+ w = plist_entry(plist_first(&old_owner->pi_waiters), struct rt_mutex_waiter, pi_list);
if (w->task->prio < prio)
prio = w->task->prio;
}

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