All of lore.kernel.org
 help / color / mirror / Atom feed
* failing kthread_create_on_node()
@ 2012-04-16  9:58 Konrad Eisele
  2012-04-16 18:33 ` David Miller
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Konrad Eisele @ 2012-04-16  9:58 UTC (permalink / raw)
  To: sparclinux

Hello,
I'm trying to get LEON run SMP in the latest kernel again.
Currently I'm ending up in the following state for a 2-CPU
system:
When smp_init() boost up the other CPU you end up in
->kernel/stop_machine.c:cpu_stop_cpu_callback() with hcpu=1
and a kthread is created for cpu 1 using
		p = kthread_create_on_node(cpu_stopper_thread,
					   stopper,
					   cpu_to_node(cpu),
					   "migration/%d", cpu);
It seems like that cpu_to_node(cpu) is ignored.
I end up in the following situation:
  <p> (the task created by kthread_create_on_node()) gets
inserted into runqueue[0], then still in cpu_stop_cpu_callback()
sched_set_stop_task(1,<p>) is called that
sets
   ...
   cpu_rq(1)->stop = stop;
   ...
which has the effect that kernel/sched/core.c:pick_next_task()'s
         ...
	for_each_class(class) {
		p = class->pick_next_task(rq);
		if (p)
			return p;
	}
         ...
will return rq->stop through stop-task scheduling class and
then CPU 1 will execute <p>. However <p> is actually bound to
rq[0] and i.e. task_thread_info(p)->cpu is 0 so for instance
smp_processor_id() will return 0 and the crash happens as a
side-effect of cpu0 and cpu1 at the end executing <init>-task
at the same time.

I'd like to try to fix this but before messing with arch/sparc/kernel_thread()
and arch/sparc/sparc_do_fork() I'd first want for how to fix this
the best way...

--  Greetings Konrad

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

end of thread, other threads:[~2012-04-19 17:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-16  9:58 failing kthread_create_on_node() Konrad Eisele
2012-04-16 18:33 ` David Miller
2012-04-17  6:37 ` Konrad Eisele
2012-04-18  3:41 ` David Miller
2012-04-18  6:33 ` Konrad Eisele
2012-04-19  9:33 ` Konrad Eisele
2012-04-19  9:34 ` Konrad Eisele
2012-04-19 17:36 ` 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.