public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Galbraith <efault@gmx.de>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Tony Lindgren <tony@atomide.com>
Subject: Re: [RFC PATCH] sched: START_NICE feature (temporarily niced forks) (v4)
Date: Tue, 21 Sep 2010 16:04:04 +0200	[thread overview]
Message-ID: <1285077844.24680.176.camel@marge.simson.net> (raw)
In-Reply-To: <1285070478.24680.76.camel@marge.simson.net>

On Tue, 2010-09-21 at 14:01 +0200, Mike Galbraith wrote:

> Since this is mostly about reducing latencies for the non-fork
> competition, maybe a kinder gentler START_DEBIT would work.  Let the
> child inherit parent's vruntime, charge a fraction of the vruntime
> equalizer bill _after_ it execs, until the bill has been paid, or
> whatnot.

One thing that comes to mind is that a lot of this problem is generated,
or rather exacerbated by, sleeper fairness.  For example, take vfork:
parent goes to sleep after passing the baton to the child.  When the
child exits, the parent wakes, gets credit for sleeping while it was
really running in drag, may preempt as a result, and is free to repeat
the procedure, gaining an edge.  START_DEBIT prevents that.

In the naked vfork/exec case, the parent _should_ resume at the relative
vruntime of the child, without further sleeper vruntime adjustment, but
that wouldn't help fix plain fork/clone which can do the same, nor would
it help kbuild's vfork->exec->clone[s]->parallel_stuff->exit unless you
add a lot of complexity... 

(...heh, to end up with something remarkably similar to cgroup container
per process.  Nope, don't want to re-invent the process scheduler to fix
a task scheduler corner case.  That's the core though, same old divide
and conquer problem we've always had.  We have a process scheduler
available these days though.  Back to our task scheduler problem...)

Perhaps take that vslice penalty, apply it to parent and child, and if
present, deduct sleep time from their debt, and only credit sleep time
if there's anything left over?  In any case, seems to me that sleep time
has to be included in the equation while the penalty is in effect.

Guess I'll try that, see what happens.

(but that will likely negate much of the benefit for your testcase,
where parent and child sleep)

	-Mike


  reply	other threads:[~2010-09-21 14:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-20 19:19 [RFC PATCH] sched: START_NICE feature (temporarily niced forks) (v4) Mathieu Desnoyers
2010-09-21 12:01 ` Mike Galbraith
2010-09-21 14:04   ` Mike Galbraith [this message]
2010-09-22 11:51     ` Mike Galbraith
2010-09-21 22:01 ` Jake Edge

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=1285077844.24680.176.camel@marge.simson.net \
    --to=efault@gmx.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=tony@atomide.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