mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: rettw@rtwnetwork.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.6 high CPU utilization with multimedia apps {Scanned}
Date: Sun, 23 May 2004 19:13:48 -0700	[thread overview]
Message-ID: <20040523191348.27b0492b.akpm@osdl.org> (raw)
In-Reply-To: <32786.192.168.0.243.1085363267.squirrel@webmail.rtwsecurenet.com>

rettw@rtwnetwork.com wrote:
>
> Hi Andrew,
> 
> > This could be an artifact from the instrumentation - if
> > the application is
> > doing short bursts of work the 1000Hz clock may be
> > providing more accurate
> > sampling.
> >
> > In 2.6, edit include/asm/param.h and set HZ to 100 and
> > then redo the
> > measurement.
> >
> That did it - the CPU utilization is back down to what I
> am used to seeing on 2.4. - Now, the question is - what
> was more accurate?  Was 2.4 producing abnormally low
> numbers?  Or 2.6 abnormally high?

It's hard to tell.  I'd assume that the 1000Hz number are
more accurate due to the improved sampling frequency.

If you want a really accurate estimate of CPU usage you could use
`cyclesoak' from http://www.zip.com.au/~akpm/linux/#zc.  It works by
running a low-priority busy-wait loop and then seeing how much CPU is left
over for it by the real workload.  It's not 100% accurate unless you run
your test load with SCHED_FIFO or SCHED_OTHER policy, but it's close.

Making the in-kernel instrumentation more accurate would be possible, but
would incur additional overhead in the CPU scheduler and interrupt handlers
- we don't see a lot of call for it.

But yes, one needs to be cautious when comparing 2.4 CPU load measurements
against 2.6 kernels.

>  One interesting thing,
> just below the define statements in the file mentioned
> above is a conditional define that sets HZ to 100 anyway,
> if not already defined - it almost seems that the 1000
> value is bogus to begin with.

Nope, we use 1000Hz on most architectures.

      reply	other threads:[~2004-05-24  2:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-22 14:36 rettw
2004-05-23  0:27 ` Andrew Morton
2004-05-24  1:47   ` rettw
2004-05-24  2:13     ` Andrew Morton [this message]

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=20040523191348.27b0492b.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rettw@rtwnetwork.com \
    /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®