All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] sparc: task_cpu() for stopper thread on sparc32 returns 0
@ 2012-04-19  9:22 Konrad Eisele
  2012-04-19 15:34   ` Sam Ravnborg
  2012-04-19 17:35 ` [PATCH 1/1] sparc: task_cpu() for stopper thread on sparc32 returns 0 David Miller
  0 siblings, 2 replies; 20+ messages in thread
From: Konrad Eisele @ 2012-04-19  9:22 UTC (permalink / raw)
  To: sparclinux

The stopper thread for CPU > 0 (at least in sparc32)
has on initialization task_cpu() set to zero even
for CPUs > 0. The patch explicitly checks weather the
CPU is allowed to run on the cpu that task_cpu()
return or changes the return cpu.

Signed-off-by: Konrad Eisele <konrad@gaisler.com>
---
 kernel/sched/stop_task.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/kernel/sched/stop_task.c b/kernel/sched/stop_task.c
index 7b386e8..9201866 100644
--- a/kernel/sched/stop_task.c
+++ b/kernel/sched/stop_task.c
@@ -13,7 +13,14 @@
 static int
 select_task_rq_stop(struct task_struct *p, int sd_flag, int flags)
 {
-	return task_cpu(p); /* stop tasks as never migrate */
+	int ccpu, cpu , dcpu;
+	ccpu = cpu = task_cpu(p);
+	if (unlikely(!cpumask_test_cpu(cpu, tsk_cpus_allowed(p)))) {
+		cpu = cpumask_first(tsk_cpus_allowed(p));
+		if (cpu >= nr_cpu_ids)
+			cpu = ccpu;
+	}
+	return cpu;
 }
 #endif /* CONFIG_SMP */
 
-- 
1.6.1.3


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2012-04-20  8:13 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-19  9:22 [PATCH 1/1] sparc: task_cpu() for stopper thread on sparc32 returns 0 Konrad Eisele
2012-04-19 15:34 ` Sam Ravnborg
2012-04-19 15:34   ` Sam Ravnborg
2012-04-20  3:36   ` Yong Zhang
2012-04-20  3:36     ` Yong Zhang
2012-04-20  3:56     ` David Miller
2012-04-20  3:56       ` David Miller
2012-04-20  6:28     ` [PATCH 1/1] sparc32,leon: add notify_cpu_starting() Konrad Eisele
2012-04-20  6:28       ` Konrad Eisele
2012-04-20  6:32       ` Konrad Eisele
2012-04-20  6:32         ` Konrad Eisele
2012-04-20  7:06         ` David Miller
2012-04-20  7:06           ` David Miller
2012-04-20  7:46           ` [PATCH] " Konrad Eisele
2012-04-20  7:46             ` Konrad Eisele
2012-04-20  7:47             ` Konrad Eisele
2012-04-20  7:47               ` Konrad Eisele
2012-04-20  8:01             ` Srivatsa S. Bhat
2012-04-20  8:13               ` Srivatsa S. Bhat
2012-04-19 17:35 ` [PATCH 1/1] sparc: task_cpu() for stopper thread on sparc32 returns 0 David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.