Commit 8ffcb67a authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] use task_cpu() not ->thread_info->cpu in sched.c

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.
parent 1e8bb0c5
...@@ -508,8 +508,8 @@ static int try_to_wake_up(task_t * p, unsigned int state, int sync, int kick) ...@@ -508,8 +508,8 @@ static int try_to_wake_up(task_t * p, unsigned int state, int sync, int kick)
} }
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
else else
if (unlikely(kick) && task_running(rq, p) && (p->thread_info->cpu != smp_processor_id())) if (unlikely(kick) && task_running(rq, p) && (task_cpu(p) != smp_processor_id()))
smp_send_reschedule(p->thread_info->cpu); smp_send_reschedule(task_cpu(p));
#endif #endif
p->state = TASK_RUNNING; p->state = TASK_RUNNING;
} }
...@@ -1332,7 +1332,7 @@ asmlinkage void schedule(void) ...@@ -1332,7 +1332,7 @@ asmlinkage void schedule(void)
switch_tasks: switch_tasks:
prefetch(next); prefetch(next);
clear_tsk_need_resched(prev); clear_tsk_need_resched(prev);
RCU_qsctr(prev->thread_info->cpu)++; RCU_qsctr(task_cpu(prev))++;
if (likely(prev != next)) { if (likely(prev != next)) {
rq->nr_switches++; rq->nr_switches++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment