public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: scott thomason <scott@thomasons.org>
To: Robert Love <rml@tech9.net>, Andrew Morton <akpm@digeo.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Impact of scheduler tunables on interactive response (was Re: [BENCHMARK] scheduler tunables with contest - prio_bonus_ratio)
Date: Tue, 31 Dec 2002 18:31:29 -0600	[thread overview]
Message-ID: <200212311831.29124.scott@thomasons.org> (raw)
In-Reply-To: <1040341293.2521.71.camel@phantasy>

Around mid-December, Con, rml, & akpm had a discussion about whether 
or not the scheduler tunables were a good thing for interactive 
responsiveness. Andrew was of the opinion that the interactivity 
estimator judged poorly too often and introduced noticeable lags to 
the interactive experience. To combat this, he fiddled with the 
tunable knobs in an attempt to basicly turn off the interactive 
estimation.

I wrote a program that emulates a varying but constant set of loads 
with a fixed amount of sleep() time in the hopes that it would appear 
"interactive" to the estimator. The program measures the time it 
takes to process each iteration (minus the time it spends sleeping). 
Then I tried seven different configurations of the tunables while the 
system was under load. The kernel was 2.5.53-mm2. The load was a 
continuously looping kernel make -j4 clean/make -j4 bzImage, and a 
continuously looping copy of a 100MB file. My system is a dual AMD 
MP2000 with 1GB RAM.

*IF* the test program is valid--something I would like feedback 
on!--the results show that you can attack the background load with 
aggressive tunable settings to achieve low interactive response 
times, contrary to the direction Andrew had suggested taking for 
tunable settings.

The seven tunable configurations, a graph of the results, and the raw 
data are here:

    http://www.thomasons.org/int_res.html

Tab-delimited text and OpenOffice spreadsheets of the data are here:

    http://www.thomasons.org/int_res.txt
    http://www.thomasons.org/int_res.sxc

I would like to assemble a small suite of tools that can be used to 
measure the impact of kernel changes on interactive performance, 
starting with Mark Hahn's/Andrew's "realfeel" microbenchmark and 
moving up thru whatever else may be necessary to gauge real-life 
impact. Your comments and direction are very welcome.

This test program is:

#!/usr/bin/perl

use strict;
use warnings;

use Time::HiRes qw/sleep time/;
use IO::File;

use constant OBS    => 5000;
use constant SLEEP  => 0.3;
use constant MEMLOW => 04 * 1024 * 1024;
use constant MEMINC => 2  * 1024 * 1024;
use constant MEMHI  => 30 * 1024 * 1024;

my $m     = MEMHI;

for (my $x = 0; $x < OBS; $x++) {
  my $start = time();
  
  $m += MEMINC;
  if ($m > MEMHI) { 
    $m = MEMLOW;
  }
  my $mem   = 'x' x $m; ## Touch a little memory

  sleep(SLEEP);
  
  $mem = undef;         ## Release the memory
  my $fh = IO::File->new_tmpfile or die "Can't get temp file handle!";
  my $m2 = $m * .02;    ## Write 2% of the memory allocation to disk
  print $fh 'x' x $m2;
  $fh = undef;

  my $elapsed = (time() - $start) - SLEEP;
  printf("%07.4f\n", $elapsed);  ## Capture to tenths of ms - sleep
}

exit 0;



On Thursday 19 December 2002 05:41 pm, Robert Love wrote:
> On Thu, 2002-12-19 at 18:18, Andrew Morton wrote:
> > That is too often not the case.
>
> I knew you would say that!
>
> > I can get the desktop machine working about as comfortably
> > as 2.4.19 with:
> >
> > # echo 10 > max_timeslice
> > # echo 0 > prio_bonus_ratio
> >
> > ie: disabling all the fancy new scheduler features :(
> >
> > Dropping max_timeslice fixes the enormous stalls which happen
> > when an interactive process gets incorrectly identified as a
> > cpu hog.  (OK, that's expected)
>
> Curious why you need to drop max_timeslice, too.  Did you do that
> _before_ changing the interactivity estimator?  Dropping
> max_timeslice closer to min_timeslice would do away with a lot of
> effect of the interactivity estimator, since bonuses and penalties
> would be less apparent.
>
> There would still be (a) the improved priority given to interactive
> processes and (b) the reinsertion into the active away done to
> interactive processes.
>
> Setting prio_bonus_ratio to zero would finish off (a) and (b).  It
> would also accomplish the effect of setting max_timeslice low,
> without actually doing it.
>
> Thus, can you try putting max_timeslice back to 300?  You would
> never actually use that range, mind you, except for niced/real-time
> processes.  But at least then the default timeslice would be a
> saner 100ms.
>
> > I don't expect the interactivity/cpuhog estimator will ever work
> > properly on the desktop, frankly.  There will always be failure
> > cases when a sudden swing in load causes it to make the wrong
> > decision.
> >
> > So it appears that to stem my stream of complaints we need to
> > merge scheduler_tunables.patch and edit my /etc/rc.local.
>
> I am glad sched-tune helped identify and fix the issue.  I would
> have no problem merging this to Linus.  I actually have a 2.5.52
> patch out which is a bit cleaner - it removes the defines
> completely and uses the new variables.  More proper for the long
> term.  Feel free to push what you have, too.
>
> But that in no way precludes not fixing what we have, because good
> algorithms should not require tuning for common cases.  Period.
>
> 	Robert Love
>
> -
> To unsubscribe from this list: send the line "unsubscribe
> linux-kernel" in the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


  parent reply	other threads:[~2003-01-01  0:23 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-19 21:50 [BENCHMARK] scheduler tunables with contest - prio_bonus_ratio Con Kolivas
2002-12-19 22:46 ` Robert Love
2002-12-19 23:18   ` Andrew Morton
2002-12-19 23:41     ` Robert Love
2002-12-20  0:02       ` Andrew Morton
2002-12-20  0:15         ` Robert Love
2002-12-20  0:22           ` Con Kolivas
2002-12-20  0:29             ` Robert Love
2002-12-20  0:27       ` Andrew Morton
2002-12-20  2:42         ` Robert Love
2002-12-20  2:48           ` Andrew Morton
2002-12-24 22:26       ` scott thomason
2002-12-25  7:29         ` Con Kolivas
2002-12-25 16:17           ` scott thomason
2002-12-26 15:01             ` scott thomason
2003-01-01  0:31       ` scott thomason [this message]
2003-01-01 16:05         ` Impact of scheduler tunables on interactive response (was Re: [BENCHMARK] scheduler tunables with contest - prio_bonus_ratio) Bill Davidsen
2003-01-01 17:15           ` scott thomason
2002-12-19 23:42     ` [BENCHMARK] scheduler tunables with contest - prio_bonus_ratio Con Kolivas
2002-12-19 23:53       ` Robert Love
2002-12-20  0:04         ` Con Kolivas
2002-12-20  0:16           ` Robert Love
2002-12-20 11:17         ` Marc-Christian Petersen
2002-12-20 17:54           ` Robert Love

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=200212311831.29124.scott@thomasons.org \
    --to=scott@thomasons.org \
    --cc=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rml@tech9.net \
    /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