fix for 2.4.7 UP hang
The attached patch fixes the bug that causes 2.4.7 to hang on UP systems. It turns out that this is a very old bug (since 2.3.11!) that happens to get triggered reliably in 2.4.7 on UP machines. The problem is that in the UP case, we failed to call schedule_tail() after a fork/clone. This had the effect that if a task yielded the CPU and the next task to be execute was a newly forked/cloned task, then the yielding task would never get scheduled again. In other words, on a UP system it would have been possible for some tasks to get "stuck", even though they were marked runnable. Can't say I have seen this in practice, but I'm not using UP machines very often anymore.
--david
arch/ia64/kernel/entry.S renamed from arch/ia64/kernel/entry.S~ +5 -6
@@ -492,15 +492,13 @@ GLOBAL_ENTRY(ia64_ret_from_clone) PT_REGS_UNWIND_INFO(0) -#ifdef CONFIG_SMP /* - * In SMP mode, we need to call invoke_schedule_tail to complete the scheduling process. + * We need to call schedule_tail() to complete the scheduling process. * Called by ia64_switch_to after do_fork()->copy_thread(). r8 contains the * address of the previously executing task. */ br.call.sptk.few rp=invoke_schedule_tail .ret8: -#endif adds r2=IA64_TASK_PTRACE_OFFSET,r13 ;; ld8 r2=[r2]
@@ -554,7 +552,7 @@ #ifdef CONFIG_PERFMON (p9) br.call.spnt.many b7=pfm_overflow_notify #endif -# if __GNUC__ < 3 +#if __GNUC__ < 3 (p7) br.call.spnt.many b7=invoke_schedule #else (p7) br.call.spnt.many b7=schedule
@@ -766,7 +764,6 @@ br.cond.sptk.many ia64_leave_kernel END(handle_syscall_error) -# ifdef CONFIG_SMP /* * Invoke schedule_tail(task) while preserving in0-in7, which may be needed * in case a system call gets restarted.
@@ -783,7 +780,7 @@ br.ret.sptk.many rp END(invoke_schedule_tail) -# endif /* CONFIG_SMP */ +#if __GNUC__ < 3 /* * Invoke schedule() while preserving in0-in7, which may be needed
@@ -805,6 +802,8 @@ mov rp=loc0 br.ret.sptk.many rp END(invoke_schedule) + +#endif /* __GNUC__ < 3 */ /* * Setup stack and call ia64_do_signal. Note that pSys and pNonSys need to