From: Mikael Pettersson <mikpe@csd.uu.se>

This patch fixes two p->thread_info->cpu occurrences in kernel/sched.c to
use the task_cpu(p) macro instead, which is optimised on UP.  Although one
of the occurrences is under #ifdef CONFIG_SMP, it's bad style to use the
raw non-optimisable form in non-arch code.


 25-akpm/kernel/sched.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff -puN kernel/sched.c~task_cpu-cleanup kernel/sched.c
--- 25/kernel/sched.c~task_cpu-cleanup	Thu Jul  3 12:34:09 2003
+++ 25-akpm/kernel/sched.c	Thu Jul  3 12:34:09 2003
@@ -508,8 +508,8 @@ repeat_lock_task:
 		}
 #ifdef CONFIG_SMP
 	       	else
-			if (unlikely(kick) && task_running(rq, p) && (p->thread_info->cpu != smp_processor_id()))
-				smp_send_reschedule(p->thread_info->cpu);
+			if (unlikely(kick) && task_running(rq, p) && (task_cpu(p) != smp_processor_id()))
+				smp_send_reschedule(task_cpu(p));
 #endif
 		p->state = TASK_RUNNING;
 	}
@@ -1332,7 +1332,7 @@ pick_next_task:
 switch_tasks:
 	prefetch(next);
 	clear_tsk_need_resched(prev);
-	RCU_qsctr(prev->thread_info->cpu)++;
+	RCU_qsctr(task_cpu(prev))++;
 
 	if (likely(prev != next)) {
 		rq->nr_switches++;

_