public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Con Kolivas <kernel@kolivas.org>
To: Davide Libenzi <davidel@xmailserver.org>
Cc: linux kernel mailing list <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>,
	Felipe Alfaro Solana <felipe_alfaro@linuxmail.org>,
	Zwane Mwaikambo <zwane@arm.linux.org.uk>
Subject: Re: [PATCH] O6int for interactivity
Date: Thu, 17 Jul 2003 10:33:32 +1000	[thread overview]
Message-ID: <1058402012.3f15eedcc06f2@kolivas.org> (raw)
In-Reply-To: <Pine.LNX.4.55.0307161241280.4787@bigblue.dev.mcafeelabs.com>

Quoting Davide Libenzi <davidel@xmailserver.org>:

> On Thu, 17 Jul 2003, Con Kolivas wrote:
> 
> > O*int patches trying to improve the interactivity of the 2.5/6 scheduler
> for
> > desktops. It appears possible to do this without moving to nanosecond
> > resolution.
> >
> > This one makes a massive difference... Please test this to death.
> >
> > Changes:
> > The big change is in the way sleep_avg is incremented. Any amount of sleep
> > will now raise you by at least one priority with each wakeup. This causes
> > massive differences to startup time, extremely rapid conversion to
> interactive
> > state, and recovery from non-interactive state rapidly as well (prevents X
> > stalling after thrashing around under high loads for many seconds).
> >
> > The sleep buffer was dropped to just 10ms. This has the effect of causing
> mild
> > round robinning of very interactive tasks if they run for more than 10ms.
> The
> > requeuing was changed from (unlikely()) to an ordinary if.. branch as this
> > will be hit much more now.
> 
> Con, I'll make a few notes on the code and a final comment.
> 
> 
> 
> > -#define MAX_BONUS		((MAX_USER_PRIO - MAX_RT_PRIO) * 
PRIO_BONUS_RATIO /
> 100)
> > +#define MAX_BONUS		(40 * PRIO_BONUS_RATIO / 100)
> 
> Why did you bolt in the 40 value ? It really comes from (MAX_USER_PRIO -
> MAX_RT_PRIO)
> and you will have another place to change if the number of slots will
> change. If you want to clarify better, stick a comment.

Granted. Will revert. If you don't understand it you shouldn't be fiddling with 
it I agree.

> 
> 
> 
> > +			p->sleep_avg = (p->sleep_avg * MAX_BONUS / runtime + 1) 
* runtime /
> MAX_BONUS;
> 
> I don't have the full code so I cannot see what "runtime" is, but if
> "runtime" is the time the task ran, this is :
> 
> p->sleep_avg ~= p->sleep_avg + runtime / MAX_BONUS;
> 
> (in any case a non-decreasing function of "runtime" )
> Are you sure you want to reward tasks that actually ran more ?


That was the bug. Runtime was supposed to be limited to MAX_SLEEP_AVG. Fix will 
be posted very soon.

> 
> 
> Con, you cannot follow the XMMS thingy otherwise you'll end up bolting in
> the XMMS sleep->burn pattern and you'll probably break the make-j+RealPlay
> for example. MultiMedia players are really tricky since they require strict
> timings and forces you to create a special super-interactive treatment
> inside the code. Interactivity in my box running moderate high loads is
> very good for my desktop use. Maybe audio will skip here (didn't try) but
> I believe that following the fix-XMMS thingy is really bad. I believe we
> should try to make the desktop to feel interactive with human tollerances
> and not with strict timings like MM apps. If the audio skips when dragging
> like crazy a X window using the filled mode on a slow CPU, we shouldn't be
> much worried about it for example. If audio skip when hitting the refresh
> button of Mozilla, then yes it should be fixed. And the more you add super
> interactive patterns, the more the scheduler will be exploitable. I
> recommend you after doing changes to get this :
> 
> http://www.xmailserver.org/linux-patches/irman2.c
> 
> and run it with different -n (number of tasks) and -b (CPU burn ms time).
> At the same time try to build a kernel for example. Then you will realize
> that interactivity is not the bigger problem that the scheduler has right
> now.

Please don't assume I'm writing an xmms scheduler. I've done a lot more testing 
than xmms.

Con

  reply	other threads:[~2003-07-17  0:18 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-16 14:30 [PATCH] O6int for interactivity Con Kolivas
2003-07-16 15:22 ` Felipe Alfaro Solana
2003-07-16 19:55   ` Marc-Christian Petersen
2003-07-16 17:08 ` Valdis.Kletnieks
2003-07-16 21:59 ` Wiktor Wodecki
2003-07-16 22:30   ` Con Kolivas
2003-07-16 22:12 ` Davide Libenzi
2003-07-17  0:33   ` Con Kolivas [this message]
2003-07-17  0:35     ` Davide Libenzi
2003-07-17  1:12       ` Con Kolivas
2003-07-17  0:48     ` Wade
2003-07-17  1:15       ` Con Kolivas
2003-07-17  1:27         ` Eugene Teo
2003-07-17  3:05 ` Wes Janzen
2003-07-17  9:05 ` Alex Riesen
2003-07-17  9:14   ` Con Kolivas
2003-07-18  7:38     ` Alex Riesen
     [not found]       ` <Pine.LNX.4.44.0307251628500.26172-300000@localhost.localdomain>
2003-07-25 19:40         ` Alex Riesen
     [not found] ` <Pine.LNX.4.55.0307161241280.4787@bigblue.dev.mcafeelabs.co m>
2003-07-18  5:38   ` Mike Galbraith
2003-07-18  6:34     ` Nick Piggin
2003-07-18 10:18       ` Mike Galbraith
2003-07-18 10:31         ` Wiktor Wodecki
2003-07-18 10:43           ` Con Kolivas
2003-07-18 11:34             ` Wiktor Wodecki
2003-07-18 11:38               ` Nick Piggin
2003-07-19 10:59                 ` Wiktor Wodecki
2003-07-18 15:46           ` Mike Galbraith
2003-07-18 16:52             ` Davide Libenzi
2003-07-18 17:05               ` Davide Libenzi
2003-07-18 17:39                 ` Valdis.Kletnieks
2003-07-18 19:31                   ` Davide Libenzi
     [not found]                   ` <Pine.LNX.4.55.0307181038450.5608@bigblue.dev.mcafeelabs.co m>
2003-07-18 20:31                     ` Mike Galbraith
2003-07-18 20:38                       ` Davide Libenzi
     [not found]                       ` <Pine.LNX.4.55.0307181333520.5608@bigblue.dev.mcafeelabs.co m>
2003-07-19 17:04                         ` Mike Galbraith
2003-07-21  0:21                           ` Davide Libenzi
     [not found]                           ` <Pine.LNX.4.55.0307201715130.3548@bigblue.dev.mcafeelabs.co m>
2003-07-21  5:36                             ` Mike Galbraith
2003-07-21 12:39                             ` [NOTAPATCH] " Mike Galbraith
2003-07-21 17:13                               ` Mike Galbraith
     [not found]             ` <Pine.LNX.4.55.0307180951050.5608@bigblue.dev.mcafeelabs.co m>
2003-07-18 18:49               ` Mike Galbraith
2003-07-18 14:24         ` Con Kolivas
2003-07-18 15:50           ` Mike Galbraith
2003-07-18 13:46     ` Davide Libenzi
     [not found]     ` <Pine.LNX.4.55.0307180630450.5077@bigblue.dev.mcafeelabs.co m>
2003-07-18 15:41       ` Mike Galbraith
  -- strict thread matches above, loose matches on Subject: below --
2003-07-16 20:20 Shane Shrybman

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=1058402012.3f15eedcc06f2@kolivas.org \
    --to=kernel@kolivas.org \
    --cc=akpm@osdl.org \
    --cc=davidel@xmailserver.org \
    --cc=felipe_alfaro@linuxmail.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zwane@arm.linux.org.uk \
    /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