public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Williams <pwil3058@bigpond.net.au>
To: Shane Shrybman <shrybman@aei.ca>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][2.6.7-rc3] Single Priority Array CPU Scheduler
Date: Mon, 14 Jun 2004 09:45:04 +1000	[thread overview]
Message-ID: <40CCE700.3050500@bigpond.net.au> (raw)
In-Reply-To: <1087148790.2340.166.camel@mars>

Shane Shrybman wrote:
[bits deleted]
> 
> I am doing the same basic test as before but I should mention a few
> things. In mozilla I have ten tabs open, 7 of them with loaded web
> pages. Depending on which tab is focused the interactive responsiveness
> varies greatly. Performance decreases rapidly with the complexity of the
> web page to be rendered. I am using the Debian 4.3.0-7 20040318043201
> version of XFree86 with the nv driver. This driver is incredibly hungry
> for CPU resources (absolute pig really). 
> 
> Here is what I see:
> 
> At the default setting of 500 I see mozilla and XFree86 each at about
> 49% cpu (fighting for cpu), each with a priority ~30-33, with no idle
> time. Metacity, the window manager, also looks to be trying to get some
> CPU, cause it is usually third on the list at ~3% cpu.
> 
> As cpu_hog_threshold is decreased to 400. CPU X=50% pri=30, mozilla=40%
> pri=34-37, metacity=4.5% pri=29. Feels a tad less jerky, cause metacity
> gets a bit more cpu?
> 
> Decreasing cpu_hog_threshold to 300 feels worse than 500.

This probably means that a CPU hog managed to get some interactive bonus 
points and the lower threshold stops them being taken away.

> 
> Decreasing the time_slice to 10-20 makes things noticeably smoother. Are
> time slices dynamic in the SPA scheduler?

No.  Each task gets a fixed fresh time slice when it wakes up and at the 
end of an expired time slice.

> and the vanilla (0)1
> scheduler?

The vanilla scheduler uses time slices to control "nice" and the 
allocated size varies widely.  The default value in SPA is the average 
of what vanilla would have awarded.  This is not necessarily the best 
time slice for interactive response with SPA.

> 
> My humble assessment is that to provide a good interactive feel for this
> workload; Xfree86, mozilla and metacity all need to get CPU in a timely
> manner. This is a tricky balancing act because XFree86 and mozilla can
> easily fall into the cpu hog category, or if they are not cpu hogs they
> can act to starve metacity of cpu resources.

It is indeed a tricky balancing act and it would be easier if more was 
known about the behavioural characteristics of the protagonists.  I have 
added a logging switch which when on will log the scheduling statistics 
for exiting tasks to the system log and I plan to use this to get an 
idea of the characteristics of the tasks involved in a kernel build.

I'm also writing a tool that can be pointed at a particular task (such 
as the X server) and gather time series data on the behaviour of that 
task using the statistics in /proc/<tgid>/task/<tid>/cpustats. 
Hopefully, that will help in working out the best settings or perhaps 
suggest other criteria that may be better for deciding interactiveness.

I had hoped that the throughput bonus would have helped in situations 
such as the one you describe, where several interactive tasks are 
fighting it out, by minimizing queuing.  I suspect that the reason it 
isn't helping is that a linear mapping from CPU delay to the bonus is 
inadequate as it means quite large discrepancies (20%) are required to 
get one bonus point.  I will look at modifying the mapping function to 
give more emphasis to small discrepancies.

> 
> Right now I am using cpu_hog_threshold=400 and timeslice=20 and it seems
> to be an improvement. But this is fairly subjective of course.

You might also try increasing the promotion interval a little as this 
will accentuate the differences between the allocated priorities.

Thanks again for the feedback
Peter
-- 
Peter Williams                                   pwil3058@bigpond.net.au

"Learning, n. The kind of ignorance distinguishing the studious."
  -- Ambrose Bierce


  reply	other threads:[~2004-06-13 23:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-11 13:39 [PATCH][2.6.7-rc3] Single Priority Array CPU Scheduler Shane Shrybman
2004-06-12  0:10 ` Peter Williams
2004-06-12 14:50   ` Shane Shrybman
2004-06-13  1:15     ` Peter Williams
2004-06-13 17:46       ` Shane Shrybman
2004-06-13 23:45         ` Peter Williams [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-06-10  5:36 Peter Williams

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=40CCE700.3050500@bigpond.net.au \
    --to=pwil3058@bigpond.net.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shrybman@aei.ca \
    /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