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

Next file: linux/kernel/sysctl.c
Previous file: linux/kernel/module.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test11/linux/kernel/sched.c linux/kernel/sched.c
@@ -197,7 +197,7 @@
 
 /*
  * This is ugly, but reschedule_idle() is very timing-critical.
- * We `are called with the runqueue spinlock held and we must
+ * We are called with the runqueue spinlock held and we must
  * not claim the tasklist_lock.
  */
 static FASTCALL(void reschedule_idle(struct task_struct * p));
@@ -272,8 +272,10 @@
 	}
 	tsk = target_tsk;
 	if (tsk) {
-		if (oldest_idle != -1ULL)
+		if (oldest_idle != -1ULL) {
+			best_cpu = tsk->processor;
 			goto send_now_idle;
+		}
 		tsk->need_resched = 1;
 		if (tsk->processor != this_cpu)
 			smp_send_reschedule(tsk->processor);
@@ -452,7 +454,7 @@
 		goto needs_resched;
 
 out_unlock:
-	task_unlock(prev);
+	task_unlock(prev);	/* Synchronise here with release_task() if prev is TASK_ZOMBIE */
 	return;
 
 	/*
@@ -511,10 +513,7 @@
 	int this_cpu, c;
 
 	if (!current->active_mm) BUG();
-	if (tq_scheduler)
-		goto handle_tq_scheduler;
-tq_scheduler_back:
-
+need_resched_back:
 	prev = current;
 	this_cpu = prev->processor;
 
@@ -652,7 +651,7 @@
 same_process:
 	reacquire_kernel_lock(current);
 	if (current->need_resched)
-		goto tq_scheduler_back;
+		goto need_resched_back;
 
 	return;
 
@@ -676,15 +675,6 @@
 handle_softirq:
 	do_softirq();
 	goto handle_softirq_back;
-
-handle_tq_scheduler:
-	/*
-	 * do not run the task queue with disabled interrupts,
-	 * cli() wouldn't work on SMP
-	 */
-	sti();
-	run_task_queue(&tq_scheduler);
-	goto tq_scheduler_back;
 
 move_rr_last:
 	if (!prev->counter) {

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