patch-2.3.47 linux/kernel/sched.c

Next file: linux/mm/filemap.c
Previous file: linux/kernel/pm.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.46/linux/kernel/sched.c linux/kernel/sched.c
@@ -141,7 +141,7 @@
 #endif
 
 	/* .. and a slight advantage to the current MM */
-	if (p->mm == this_mm)
+	if (p->mm == this_mm || !p->mm)
 		weight += 1;
 	weight += p->priority;
 
@@ -173,7 +173,7 @@
  */
 static inline int preemption_goodness(struct task_struct * prev, struct task_struct * p, int cpu)
 {
-	return goodness(p, cpu, prev->mm) - goodness(prev, cpu, prev->mm);
+	return goodness(p, cpu, prev->active_mm) - goodness(prev, cpu, prev->active_mm);
 }
 
 /*

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