From 8ffcb67a9b54e5cf37ecc90b01f906b5f83920fb Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sun, 6 Jul 2003 05:40:14 -0700 Subject: [PATCH] use task_cpu() not ->thread_info->cpu in sched.c From: Mikael Pettersson 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. --- kernel/sched.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'kernel') diff --git a/kernel/sched.c b/kernel/sched.c index bb552059577d..4f3d1fa42669 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -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++; -- cgit v1.2.3