From: Konrad Eisele <konrad@gaisler.com>
To: sparclinux@vger.kernel.org
Subject: failing kthread_create_on_node()
Date: Mon, 16 Apr 2012 09:58:14 +0000 [thread overview]
Message-ID: <4F8BED36.7000304@gaisler.com> (raw)
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
next reply other threads:[~2012-04-16 9:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-16 9:58 Konrad Eisele [this message]
2012-04-16 18:33 ` failing kthread_create_on_node() 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F8BED36.7000304@gaisler.com \
--to=konrad@gaisler.com \
--cc=sparclinux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.