mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Tony Luck <tony.luck@intel.com>
Cc: Jesper Juhl <jj@chaosbits.net>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Mike Galbraith <efault@gmx.de>
Subject: Re: [GIT PULL] sched/core for v2.6.32
Date: Sat, 12 Sep 2009 07:49:17 +0200	[thread overview]
Message-ID: <20090912054917.GB9420@elte.hu> (raw)
In-Reply-To: <12c511ca0909111924s42d000dsbf378009d9434ddc@mail.gmail.com>


* Tony Luck <tony.luck@intel.com> wrote:

> On Fri, Sep 11, 2009 at 4:34 PM, Jesper Juhl <jj@chaosbits.net> wrote:
> > That may be so; but most people I've ever talked to about multiple
> > processes, fork, vfork and the like, have mostly assumed child-runs-first.
> > That is just my personal experience.
> > So I get worried when that assumption is made false.
> 
> With multi-core cpus becoming (being?) the norm, almost all 
> systems are SMP now.  So child and parent can surely end up 
> running in parallel very often.  So applications that make 
> assumptions about child running first are going to be frequently 
> surprised.  Aren't they?

We had parent-runs-first briefly, in v2.6.23 - this got changed by 
v2.6.24 - but yes, it did trigger at least one app bug that i 
remember (dont remember which one it was though).

We are almost two years later now - maybe it works fine now.

In any case, as a precaution i made the sched_child_runs_first 
sysctl knob unconditional (previously it was under 
CONFIG_SCHED_DEBUG).

So if an old distro is upgraded with a new kernel (and user-space is 
not updated), it can be worked around by putting this into 
/etc/sysctl.conf:

    kernel.sched_child_runs_first = 1

You are right to suggest that due to SMP and due to the general 
non-determinism of preemption we _never_ made any 'promise' to run 
the child first.

It was a statistical property based on performance considerations - 
and now we flipped it around based on latency and for kbuild 
performance/throughput reasons: Serge Belyshev reported a 7% 
increase on a quad due to this change and i measured a 1.5% 
peak-kbuild performance increase.

So it's worth it for multiple reasons and even in the worst-case 
problems can be worked around easily and without rebooting the 
system.

	Ingo

  reply	other threads:[~2009-09-12  5:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-11 19:25 Ingo Molnar
2009-09-11 22:40 ` Jesper Juhl
2009-09-11 22:58   ` Linus Torvalds
2009-09-11 23:34     ` Jesper Juhl
2009-09-12  2:24       ` Tony Luck
2009-09-12  5:49         ` Ingo Molnar [this message]
2009-09-12 22:07           ` Jesper Juhl
2009-09-13  6:41             ` Mike Galbraith
2009-09-13 22:03               ` Jesper Juhl

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=20090912054917.GB9420@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=efault@gmx.de \
    --cc=jj@chaosbits.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.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®