public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 2.4-ac: migration_thread locking fix
@ 2002-05-11 16:40 Robert Love
  2002-05-11 16:46 ` Robert Love
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Love @ 2002-05-11 16:40 UTC (permalink / raw)
  To: alan; +Cc: anton, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 395 bytes --]

Alan,

Anton Blanchard reported a lock vs. interrupt-off ordering bug in
migration_thread.  The bug is already fixed in 2.5.  A patch is attached
to fix O(1) in your tree.

See the comments above double_rq_lock and double_rq_unlock (which,
sadly, I wrote)!  Without this patch there is a possibility to hang,
which Anton observed.

Patch is against 2.4.19-pre8-ac1, please apply.

	Robert Love


[-- Attachment #2: sched-irq-fix-rml-2.4.19-pre8-ac1-1.patch --]
[-- Type: text/x-patch, Size: 648 bytes --]

diff -urN linux-2.4.19-pre8-ac1/kernel/sched.c linux/kernel/sched.c
--- linux-2.4.19-pre8-ac1/kernel/sched.c	Wed May  8 12:03:14 2002
+++ linux/kernel/sched.c	Sat May 11 09:29:55 2002
@@ -1640,8 +1640,8 @@
 		local_irq_save(flags);
 		double_rq_lock(rq_src, rq_dest);
 		if (p->cpu != cpu_src) {
-			local_irq_restore(flags);
 			double_rq_unlock(rq_src, rq_dest);
+			local_irq_restore(flags);
 			goto repeat;
 		}
 		if (rq_src == rq) {
@@ -1651,8 +1651,8 @@
 				activate_task(p, rq_dest);
 			}
 		}
-		local_irq_restore(flags);
 		double_rq_unlock(rq_src, rq_dest);
+		local_irq_restore(flags);
 
 		up(&req->sem);
 	}

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-05-11 16:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-11 16:40 [PATCH] 2.4-ac: migration_thread locking fix Robert Love
2002-05-11 16:46 ` Robert Love

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox