linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][2.5.74] use task_cpu() not ->thread_info->cpu in sched.c
@ 2003-07-03 16:10 Mikael Pettersson
  0 siblings, 0 replies; only message in thread
From: Mikael Pettersson @ 2003-07-03 16:10 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

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++;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-07-03 15:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-03 16:10 [PATCH][2.5.74] use task_cpu() not ->thread_info->cpu in sched.c Mikael Pettersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).