patch-2.4.0-test4 linux/kernel/sched.c

Next file: linux/kernel/timer.c
Previous file: linux/kernel/ksyms.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test3/linux/kernel/sched.c linux/kernel/sched.c
@@ -233,7 +233,7 @@
 		 * its preferred CPU. (this is a shortcut):
 		 */
 		tsk = cpu_curr(best_cpu);
-		if (preemption_goodness(tsk, p, best_cpu) > 1)
+		if (preemption_goodness(tsk, p, best_cpu) > 0)
 			goto preempt_now;
 	}
 
@@ -290,7 +290,7 @@
 	 * altogether, tsk->need_resched is actively watched by the
 	 * idle thread.
 	 */
-	if (!tsk->need_resched)
+	if ((tsk->processor != current->processor) && !tsk->need_resched)
 		smp_send_reschedule(tsk->processor);
 	tsk->need_resched = 1;
 	spin_unlock_irqrestore(&runqueue_lock, flags);
@@ -436,10 +436,7 @@
 
 	add_timer(&timer);
 	schedule();
-	del_timer(&timer);
-	/* RED-PEN. Timer may be running now on another cpu.
-	 * Pray that process will not exit enough fastly.
-	 */
+	del_timer_sync(&timer);
 
 	timeout = expire - jiffies;
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)