patch-2.3.30 linux/kernel/sched.c

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

diff -u --recursive --new-file v2.3.29/linux/kernel/sched.c linux/kernel/sched.c
@@ -254,10 +254,11 @@
 	 * wakeup, the frequent rescheduler will likely chose this
 	 * task during it's next schedule():
 	 */
-	tsk = cpu_curr(best_cpu);
- 	if ((p->avg_slice < cacheflush_time) &&
-			(tsk->avg_slice < cacheflush_time))
-		goto out_no_target;
+	if (p->policy == SCHED_OTHER) {
+		tsk = cpu_curr(best_cpu);
+		if (p->avg_slice + tsk->avg_slice < cacheflush_time)
+			goto out_no_target;
+	}
 
 	/*
 	 * We know that the preferred CPU has a cache-affine current
@@ -1006,7 +1007,7 @@
 	}
 }
 
-spinlock_t tqueue_lock;
+spinlock_t tqueue_lock = SPIN_LOCK_UNLOCKED;
 
 void tqueue_bh(void)
 {

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