Re: [git pull] scheduler updates for v2.6.24

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Ingo Molnar <mingo@...>
Cc: Andrew Morton <akpm@...>, <torvalds@...>, <linux-kernel@...>, Paul Jackson <pj@...>
Date: Tuesday, October 16, 2007 - 6:38 pm

On 15/10/2007, Ingo Molnar <mingo@elte.hu> wrote:

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'.


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.



-- 
Best regards,
Dmitry Adamushko
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[git pull] scheduler updates for v2.6.24, Ingo Molnar, (Mon Oct 15, 10:17 am)
Re: [git pull] scheduler updates for v2.6.24, Thomas Backlund, (Tue Oct 16, 6:04 am)
Re: [git pull] scheduler updates for v2.6.24, Ingo Molnar, (Tue Oct 16, 6:08 am)
Re: [git pull] scheduler updates for v2.6.24, Ingo Molnar, (Tue Oct 16, 6:12 am)
Re: [git pull] scheduler updates for v2.6.24, Thomas Backlund, (Tue Oct 16, 7:00 am)
Re: [git pull] scheduler updates for v2.6.24, Nick Piggin, (Mon Oct 15, 10:38 pm)
Re: [git pull] scheduler updates for v2.6.24, Ingo Molnar, (Mon Oct 15, 11:04 am)
Re: [git pull] scheduler updates for v2.6.24, Andrew Morton, (Mon Oct 15, 2:35 pm)
Re: [git pull] scheduler updates for v2.6.24, Ingo Molnar, (Mon Oct 15, 2:53 pm)
Re: [git pull] scheduler updates for v2.6.24, Dmitry Adamushko, (Tue Oct 16, 6:38 pm)
Re: [git pull] scheduler updates for v2.6.24, Gabriel C, (Tue Oct 16, 6:13 pm)
Re: [git pull] scheduler updates for v2.6.24, Dmitry Adamushko, (Tue Oct 16, 7:31 pm)
Re: [git pull] scheduler updates for v2.6.24, Gabriel C, (Tue Oct 16, 7:50 pm)