mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kurt Garloff <garloff@suse.de>
To: Con Kolivas <kernel@kolivas.org>
Cc: Andrew Morton <akpm@osdl.org>,
	hch@infradead.org,
	Linux kernel list <linux-kernel@vger.kernel.org>
Subject: Re: dynamic sched timeslices
Date: Tue, 16 Mar 2004 15:29:57 +0100	[thread overview]
Message-ID: <20040316142957.GX4452@tpkurt.garloff.de> (raw)
In-Reply-To: <200403170013.38140.kernel@kolivas.org>

[-- Attachment #1: Type: text/plain, Size: 2931 bytes --]

Hi Con,

On Wed, Mar 17, 2004 at 12:13:37AM +1100, Con Kolivas wrote:
> 2.4 O(1) effects do not directly apply with 2.6
> 
> Dropping Hz will save you performance for sure on 2.6.
> 
> Changing the timeslices in 2.6 will be disappointing, though. Although the 
> apparent timeslice of nice 0 tasks is 102ms, interactive tasks round robin at 
> 10ms. If you drop the timeslice to 10ms you will not improve the interactive 
> feel but you will speed up expiration instead which will almost certainly 
> worsen interactive feel. 

If you have a system with an easy workload (say one clear CPU hog and
one interactive job), things are easy. The fact that you preempt the
not-yet expired CPU hog is enough.
That's easy, and that worked with 2.4 O(1) (if tweaked a bit to estimate
interactiveness better, see other patch) and it works with 2.6.

Things start to get difficult if you have something like a calculation
program with a non-multithreaded GUI. It will look like a CPU hog and
still you'd like to see it responsive. Now add a second CPU hog.

The kernel can not fix this problem, but it can limit the damage by 
not having too long timeslices.

There are other scenarios where the preemption will not solve all
problems.
Think two interactive processes, one playing audio, another one being
your shell. The audio player may take the CPU for extended periods of
times occasionally to decode the next N ogg frames. You still want the
shell to react promptly, but it can't ... Thus you wish the timeslice
not being too long.

Thus you'll set them not too long for desktop kind of machines to
not have to rely completely on the interactiveness estimator.

> If you drop timeslices below 10ms you will get 
> significant cache trashing and drop in performance (which your 2.4 results 
> confirm).

No doubt. Don't overdo it. It's a tradeoff. If you impact throughput too
much, you'll not enjoy the short latency ;-)

> Increasing timeslices does benefit pure number crunching workloads. The 
> benchmarking I've done using cache intensive workloads (which are the most 
> likely to benefit) show you are chasing diminishing returns, though. You can 
> mathematically model them based on the fact that keeping a task bound to a 
> cpu instead of shifting it to another cpu on SMP saves about 2ms processing 
> time on P4. Suffice to say the benefit is only worth it if you do nothing but 
> cpu intensive things, and becomes virtually insignificant beyond 200ms. On 
> other architecture with longer cache decays you will benefit more; 
> arch/i386/mach-voyager seems the longest at 20ms.

That's why I think we should offer the tunables.

Regards,
-- 
Kurt Garloff                   <kurt@garloff.de>             [Koeln, DE]
Physics:Plasma modeling <garloff@plasimo.phys.tue.nl> [TU Eindhoven, NL]
Linux: SUSE Labs (Head)        <garloff@suse.de>    [SUSE Nuernberg, DE]

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2004-03-16 14:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-15 22:42 Kurt Garloff
2004-03-15 22:59 ` Christoph Hellwig
2004-03-15 23:09   ` Kurt Garloff
2004-03-15 23:40     ` Andrew Morton
2004-03-16 11:36       ` Kurt Garloff
2004-03-16 13:13         ` Con Kolivas
2004-03-16 14:29           ` Kurt Garloff [this message]
2004-03-16 20:45             ` Con Kolivas
2004-03-18  0:20               ` Kurt Garloff
2004-03-18  0:32                 ` Andrew Morton
2004-03-18  3:38                   ` Con Kolivas
2004-03-16 15:03 ` Timothy Miller
2004-03-16 15:08   ` Kurt Garloff
2004-03-23  9:23 ` Pavel Machek

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=20040316142957.GX4452@tpkurt.garloff.de \
    --to=garloff@suse.de \
    --cc=akpm@osdl.org \
    --cc=hch@infradead.org \
    --cc=kernel@kolivas.org \
    --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®