lkml.org 
[lkml]   [2005]   [Feb]   [5]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateSat, 5 Feb 2005 08:59:37 +0100
FromIngo Molnar <>
SubjectRe: [patch] Real-Time Preemption, -RT-2.6.11-rc2-V0.7.37-02
* Steven Rostedt <rostedt@goodmis.org> wrote:

> 	while(unlikely(error == IN_WAKEUP)) {
> 		cpu_relax();
> 		error = queue.status;
> 	}
> 
> So, what looks to be happening is that as soon as the parent wakes up
> the child, the child preempts the parent, and hits this while loop.
> But since the child is a realtime task, with the highest priority of
> the system, it starves the system. Of course this is a UP and I don't
> think this will show a problem on an SMP machine. 

hm - i had a fix in this area in the -V0.7 series. Then i thought this
is a performance fix only and dropped it eventually, but could you give
it a go - does it fix the deadlock?

	Ingo

--- linux/ipc/sem.c.orig
+++ linux/ipc/sem.c
@@ -359,12 +371,18 @@ static void update_queue (struct sem_arr
 			struct sem_queue *n;
 			remove_from_queue(sma,q);
 			n = q->next;
+			/*
+			 * Make sure that the wakeup doesnt preempt
+			 * _this_ CPU prematurely. (on PREEMPT_RT)
+			 */
+			preempt_disable();
 			q->status = IN_WAKEUP;
 			wake_up_process(q->sleeper);
 			/* hands-off: q will disappear immediately after
 			 * writing q->status.
 			 */
 			q->status = error;
+			preempt_enable();
 			q = n;
 		} else {
 			q = q->next;
-
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/
\
 
 \ /
  Last update: 2005-03-22 14:10    [from the cache]
©2003-2008