From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Mikael Pettersson <mikpe@csd.uu.se>
Cc: trini@kernel.crashing.org, akpm@osdl.org, jhf@rivenstone.net,
linux-kernel@vger.kernel.org
Subject: Re: 2.6.8-rc1-mm1 "Badness in schedule" on ppc32
Date: Fri, 16 Jul 2004 23:48:22 +1000 [thread overview]
Message-ID: <40F7DCA6.6030804@yahoo.com.au> (raw)
In-Reply-To: <200407161338.i6GDcLoN013486@harpo.it.uu.se>
Mikael Pettersson wrote:
> On Thu, 15 Jul 2004 13:27:05 -0700, Tom Rini wrote:
[ much needed cutting ]
>>On x86, could you force the PDC202XX_NEW to dump_stack in the function
>>in question? Perhaps there's a calling order issue on ppc. Thanks.
>
>
> I hacked pdc202xx_init_one() to dump_stack(), and upped ppc's
> log buffer size to capture all badness messages. The ppc boot
> log is a bit large, so I put both the ppc and x86 logs in
> <http://www.csd.uu.se/~mikpe/linux/2.6.8-rc1-mm1-scheduler-badness/>.
>
> All badness calls appear to emanate from sleeps/waits in init code
> called from init/main.c:init(), which itself runs in a kernel thread.
> It seems extremely fishy that the kernel considers the scheduler
> off-limits even though threads have been created and started.
>
> The init thread is itself created in init/main.c:rest_init():
>
>>static void noinline rest_init(void)
>>{
>> kernel_thread(init, NULL, CLONE_FS | CLONE_SIGHAND);
>> numa_default_policy();
>> system_state = SYSTEM_BOOTING_SCHEDULER_OK;
>> unlock_kernel();
>> cpu_idle();
>>}
>
> system_state is changed only after the init thread is created.
> Unless kernel_thread guarantees some execution ordering between
> parent and child, I don't see how this could be race-free.
>
> But I also don't see why ppc and x86 behave so differently here.
>
You must have missed my mail to the linuxppc list.
sched-clean-init-idle (which is in -mm) has the following hunk to
schedule() which should catch all unsafe calls to it, I think.
+ /*
+ * The idle thread is not allowed to schedule!
+ * Remove this check after it has been exercised a bit.
+ */
+ if (unlikely(current == rq->idle) && current->state != TASK_RUNNING) {
+ printk(KERN_ERR "bad: scheduling from the idle thread!\n");
+ dump_stack();
+ }
+
So the system_state patch can be dropped.
next prev parent reply other threads:[~2004-07-16 13:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-16 13:38 2.6.8-rc1-mm1 "Badness in schedule" on ppc32 Mikael Pettersson
2004-07-16 13:48 ` Nick Piggin [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-07-15 19:08 Mikael Pettersson
2004-07-15 20:27 ` Tom Rini
2004-07-15 0:00 Mikael Pettersson
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=40F7DCA6.6030804@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=akpm@osdl.org \
--cc=jhf@rivenstone.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mikpe@csd.uu.se \
--cc=trini@kernel.crashing.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.