From: "Dmitry Adamushko" <dmitry.adamushko@gmail.com>
To: "Ingo Molnar" <mingo@elte.hu>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
"Paul Jackson" <pj@sgi.com>
Subject: Re: [git pull] scheduler updates for v2.6.24
Date: Wed, 17 Oct 2007 00:38:07 +0200 [thread overview]
Message-ID: <b647ffbd0710161538r7908956ci5cdec0ed01102097@mail.gmail.com> (raw)
In-Reply-To: <20071015185307.GA26763@elte.hu>
On 15/10/2007, Ingo Molnar <mingo@elte.hu> wrote:
>
> * Andrew Morton <akpm@linux-foundation.org> wrote:
>
> > On Mon, 15 Oct 2007 16:17:23 +0200
> > Ingo Molnar <mingo@elte.hu> wrote:
> >
> > > Linus, please pull the latest scheduler git tree from:
> > >
> > > git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched.git
> >
> > Did Paul Jackson's crash get fixed?
>
> yes - that crash was a showstopper that was holding up the pull request
> for 2 days. Paul bisected it down to the culprit and the fix was to do
> this in wake_up_new_task():
>
> - if (!p->sched_class->task_new || !current->se.on_rq) {
> + if (!p->sched_class->task_new || !current->se.on_rq || !rq->cfs.curr) {
>
> (during early bootup the cfs_rq has no curr pointer yet.) It's not clear
> why this race did not trigger earlier.
an update on this issue:
shortly, SD_BALANCE_FORK is required to trigger this problem and
hence, only NUMA machines could have been affected by it (and only
ia64 and x86 have SD_BALANCE_FORK in SD_NODE_INIT).
more details:
it's perfectly legitimate for 'rq->cfs.curr' to be NULL in
task_new_fair() in the case when this_cpu != task_cpu(p) (p -- is a
newly created task).
why this_cpu != task_cpu(p) :
do_fork() --> copy_process() --> sched_fork() -->
cpu = sched_balance_self(this_cpu, SD_BALANCE_FORK)
chose a different cpu for the new task and there is _no_
'class_sched_fair' task running on this cpu at the moment (that's why
rq->cfs.curr == NULL).
[ thanks a lot to Paul for providing debugging information ]
btw., it's not the 'curr->vruntime < se->vruntime' part in
task_new_fair() that gave us the oops (it's only executed in the case
of this_cpu == task_cpu(p)) _but_ it's rather:
[*] check_spread(cfs_rq, curr) which also accesses 'curr->vruntime'.
> (and the two checks can probably
> be consolidated into a single "!rq->cfs.curr" condition.)
2 checks are required as 'current' and rq->cfs.curr are not the same :-)
It also should work if we just get rid of [*] or add an adiitional
(curr != NULL) check there.
just as a additional observation:
there are lots of per-cpu threads (like events/cpu, ksoftirq/cpu,
etc.) being created on start-up (x NUMBER_OF_CPUS) and SD_SCHED_FORK
(actually, sched_balance_self() from sched_fork()) is just an overhead
in this case...
although, sched_balance_self() is likely to be responsible for a minor
% of the time taken to create a new context so optimizing it away
(esp. for some corner cases) won't improve the start-up time
noticeable.
>
> Ingo
> -
--
Best regards,
Dmitry Adamushko
next prev parent reply other threads:[~2007-10-16 22:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-15 14:17 Ingo Molnar
2007-10-15 15:04 ` Ingo Molnar
2007-10-15 18:35 ` Andrew Morton
2007-10-15 18:53 ` Ingo Molnar
2007-10-16 22:13 ` Gabriel C
2007-10-16 23:31 ` Dmitry Adamushko
2007-10-16 23:50 ` Gabriel C
2007-10-16 22:38 ` Dmitry Adamushko [this message]
2007-10-16 2:38 ` Nick Piggin
2007-10-16 10:04 ` Thomas Backlund
2007-10-16 10:08 ` Ingo Molnar
2007-10-16 10:12 ` Ingo Molnar
2007-10-16 11:00 ` Thomas Backlund
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=b647ffbd0710161538r7908956ci5cdec0ed01102097@mail.gmail.com \
--to=dmitry.adamushko@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=pj@sgi.com \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®