2.4-ac: migration_thread locking fix
Subsystems (7)
PATCH 1/1 2.4-ac: migration_thread locking fix
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
kernel/sched.c +2 -2
@@ -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); }
Quoted 3 lines · Robert Love
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.
Oh, this fix was included in the migration_thread cleanup in the latest batch of fixes I sent you against -ac1. I have attached an all-in-one patch if you missed it. Otherwise you can get the chunks at the usual kernel.org location.
Thanks,
Robert Love
arch/alpha/mm/fault.c +1 -2
@@ -196,8 +196,7 @@*/ out_of_memory:if (current->pid ==1 ) { - current->policy |=SCHED_YIELD ; -schedule (); +yield ();down_read (&mm->mmap_sem); goto survive; }
arch/arm/mm/fault-common.c +1 -2
@@ -225,8 +225,7 @@* If we are out of memory for pid1, * sleep for a while and retry */ - tsk->policy |=SCHED_YIELD ; -schedule (); +yield (); goto survive; check_stack:
arch/ia64/mm/fault.c +1 -2
@@ -196,8 +196,7 @@ out_of_memory:up_read (&mm->mmap_sem);if (current->pid ==1 ) { - current->policy |=SCHED_YIELD ; -schedule (); +yield ();down_read (&mm->mmap_sem); goto survive; }
arch/m68k/mm/fault.c +1 -2
@@ -181,8 +181,7 @@ out_of_memory:up_read (&mm->mmap_sem);if (current->pid ==1 ) { - current->policy |=SCHED_YIELD ; -schedule (); +yield ();down_read (&mm->mmap_sem); goto survive; }
arch/mips/mm/fault.c +1 -2
@@ -211,8 +211,7 @@ out_of_memory:up_read (&mm->mmap_sem);if (tsk->pid ==1 ) { - tsk->policy |=SCHED_YIELD ; -schedule (); +yield ();down_read (&mm->mmap_sem); goto survive; }
arch/mips64/mm/fault.c +1 -2
@@ -240,8 +240,7 @@ out_of_memory:up_read (&mm->mmap_sem);if (tsk->pid ==1 ) { - tsk->policy |=SCHED_YIELD ; -schedule (); +yield ();down_read (&mm->mmap_sem); goto survive; }
arch/ppc/mm/fault.c +1 -2
@@ -197,8 +197,7 @@ out_of_memory:up_read (&mm->mmap_sem);if (current->pid ==1 ) { - current->policy |=SCHED_YIELD ; -schedule (); +yield ();down_read (&mm->mmap_sem); goto survive; }
arch/s390/mm/fault.c +1 -2
@@ -290,8 +290,7 @@ out_of_memory:up_read (&mm->mmap_sem);if (tsk->pid ==1 ) { - tsk->policy |=SCHED_YIELD ; -schedule (); +yield ();down_read (&mm->mmap_sem); goto survive; }
arch/s390x/mm/fault.c +1 -2
@@ -290,8 +290,7 @@ out_of_memory:up_read (&mm->mmap_sem);if (tsk->pid ==1 ) { - tsk->policy |=SCHED_YIELD ; -schedule (); +yield ();down_read (&mm->mmap_sem); goto survive; }
arch/sh/mm/fault.c +1 -2
@@ -207,8 +207,7 @@ out_of_memory:up_read (&mm->mmap_sem);if (current->pid ==1 ) { - current->policy |=SCHED_YIELD ; -schedule (); +yield ();down_read (&mm->mmap_sem); goto survive; }
kernel/sched.c +40 -91
218 lines not on this page · raw message