mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roman Zippel <zippel@linux-m68k.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
	Mike Galbraith <efault@gmx.de>
Subject: Re: [ANNOUNCE/RFC] Really Simple Really Fair Scheduler
Date: Tue, 4 Sep 2007 04:50:57 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0709040130360.1817@scrub.home> (raw)
In-Reply-To: <20070903200405.GA2943@elte.hu>

Hi,

On Mon, 3 Sep 2007, Ingo Molnar wrote:

> > It's a variation of the sleeper bonus. [...]
> 
> hm, where are its effects described in your explanation? Seems like a 
> key item.

It has no direct effect on the correctness of the mathematical model, the 
time is initialized before the time is added to the model.
What you're after is the effect on the behaviour, which wasn't my focus, 
so sorry, I didn't mention it.

> > [...]  Let's assume two running tasks which have been running for 95ms 
> > and 105ms and a time slice of 10ms, the average is thus 100ms. If the 
> > new task has been sleeping for a while it starts at 90ms, if the task 
> > had been running lately it doesn't get this bonus again.
> 
> what happens if there are lots of such tasks? What limits the total 
> bonus?

Every task gets a little more bonus, but it grows quite slowly, every task 
gets time_slice/task_cnt more than the previous one (assuming all tasks 
are started at the same time), so the 10th gets 2.82*time_slice, the 100th 
gets 5.18*time_slice, the 1000th gets 7.48*time_slice...

I thought about it already and I didn't consider it a serious problem, 
however it's solvable if needed by keeping the bonus separate:

	avg = avg_exec_runtime(cfs_rq);
	se->time_norm = kclock_max(avg - time_slice, se->time_norm);
	se->bonus = avg - se->time_norm;
	cfs_rq->time_sum += avg;

But the bonus also had to be undone when unqueueing the task:

	cfs_rq->time_sum -= se->time_norm + bonus;

> > That would be equivalent to simply clearing wait_runtime in CFS.
> 
> so my prototype patch is not an exact map of the nice-0 special-case of 
> your code? Would this be the correct thing then perhaps:
> 
> +               se->exec_runtime =
> +                       max(avg_exec_runtime(cfs_rq), se->exec_runtime);

You should substract the desired bonus here from the average as above and 
evtl. also store the given bonus separately.

bye, Roman

  reply	other threads:[~2007-09-04  2:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-02 12:01 Ingo Molnar
2007-09-02 19:12 ` Tong Li
2007-09-02 19:44   ` Ingo Molnar
2007-09-03 18:38 ` Roman Zippel
2007-09-03 18:54   ` Ingo Molnar
2007-09-03 19:13     ` Roman Zippel
2007-09-03 19:20       ` Ingo Molnar
2007-09-03 19:55         ` Roman Zippel
2007-09-03 20:04           ` Ingo Molnar
2007-09-04  2:50             ` Roman Zippel [this message]
2007-09-04  6:29               ` Ingo Molnar
2007-09-04 11:21                 ` Roman Zippel

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=Pine.LNX.4.64.0709040130360.1817@scrub.home \
    --to=zippel@linux-m68k.org \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.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®