diff -urN 2.3.36/include/asm-alpha/smp.h 2.3.36-sched/include/asm-alpha/smp.h --- 2.3.36/include/asm-alpha/smp.h Wed Dec 29 22:55:04 1999 +++ 2.3.36-sched/include/asm-alpha/smp.h Thu Jan 6 01:37:38 2000 @@ -39,6 +39,7 @@ extern struct cpuinfo_alpha cpu_data[NR_CPUS]; #define PROC_CHANGE_PENALTY 20 +#define PROC_TLB_FLUSH_PENALTY 5 /* Map from cpu id to sequential logical cpu number. This will only not be idempotent when cpus failed to come on-line. */ diff -urN 2.3.36/include/asm-i386/smp.h 2.3.36-sched/include/asm-i386/smp.h --- 2.3.36/include/asm-i386/smp.h Fri Dec 31 00:03:32 1999 +++ 2.3.36-sched/include/asm-i386/smp.h Thu Jan 6 00:56:32 2000 @@ -259,7 +259,8 @@ * processes are run. */ -#define PROC_CHANGE_PENALTY 15 /* Schedule penalty */ +#define PROC_CHANGE_PENALTY 15 /* CPU Switch penalty */ +#define PROC_TLB_FLUSH_PENALTY 5 /* TLB flush penalty */ #endif #endif diff -urN 2.3.36/kernel/sched.c 2.3.36-sched/kernel/sched.c --- 2.3.36/kernel/sched.c Wed Jan 5 17:42:52 2000 +++ 2.3.36-sched/kernel/sched.c Thu Jan 6 01:35:54 2000 @@ -141,8 +141,8 @@ #endif /* .. and a slight advantage to the current MM */ - if (p->mm == this_mm) - weight += 1; + if (p->mm == this_mm || !p->mm) + weight += PROC_TLB_FLUSH_PENALTY; weight += p->priority; out: @@ -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); } /*