lkml.org 
[lkml]   [2003]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH][2.5.74] use task_cpu() not ->thread_info->cpu in sched.c
Linus,

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. Please apply.

/Mikael

--- linux-2.5.74/kernel/sched.c.~1~ 2003-07-03 12:32:46.000000000 +0200
+++ linux-2.5.74/kernel/sched.c 2003-07-03 12:37:30.000000000 +0200
@@ -508,8 +508,8 @@
}
#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 @@
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++;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:46    [W:0.020 / U:0.244 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site