mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: "Kevin O'Connor" <kevin@koconnor.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: O(1) batch scheduler
Date: Thu, 11 Jul 2002 08:27:13 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.44.0207110817160.2263-100000@localhost.localdomain> (raw)
In-Reply-To: <20020709223021.A4567@arizona.localdomain>


On Tue, 9 Jul 2002, Kevin O'Connor wrote:

> I looked through your sched-2.5.25-A5 patch, and I'm confused by the
> idle_count array. It calculates the idle average of the last 9 seconds -
> but why not just use a weighted average. A weighted average is going to
> be very close to the true average, and where it differs the weighted
> average should be preferable.

i agree, the hybrid weighted average you suggest is the right solution
here, because the sampling in that case has a fixed frequency which is
HZ-independent. I've applied your patch to my tree.

the problem with a pure weighted average (ie. no ->idle_count, just a
weighted average calculated in the scheduler tick) is that with HZ=1000
and a 32-bit word length the sampling gets too inaccurate. For the average
to be meaningful it needs to be at least 'a few seconds worth' - which is
'a few thousands of events' - the rounding errors are pretty severe in
that case.

(a good example where a running average has fundamental accuracy problem
is the ->sleep_avg sampling. The frequency of wakeups/sleep events can be
almost arbitrarily high, destroying the accuracy of a weighted average.)

	Ingo


  reply	other threads:[~2002-07-10  6:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-01  9:45 [patch] sched-2.5.24-D3, batch/idle priority scheduling, SCHED_BATCH Ingo Molnar
2002-07-10  2:30 ` O(1) batch scheduler Kevin O'Connor
2002-07-11  6:27   ` Ingo Molnar [this message]
2002-07-11  6:32   ` Ingo Molnar
2002-07-11  7:05   ` [patch] " Ingo Molnar
2002-07-11  4:41     ` Kevin O'Connor

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.44.0207110817160.2263-100000@localhost.localdomain \
    --to=mingo@elte.hu \
    --cc=kevin@koconnor.net \
    --cc=linux-kernel@vger.kernel.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®