linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: R.E.Wolff@BitWizard.nl (Rogier Wolff)
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Peter Surda <shurdeek@panorama.sth.ac.at>, linux-kernel@vger.kernel.org
Subject: Re: memcpy to videoram eats too much CPU on ATI cards (cache trashing?)
Date: Mon, 27 Aug 2001 23:40:44 +0200 (MEST)	[thread overview]
Message-ID: <200108272140.XAA20798@cave.bitwizard.nl> (raw)
In-Reply-To: <E15bRy4-0004Va-00@the-village.bc.nu> from Alan Cox at "Aug 27, 2001 08:22:40 pm"

Alan Cox wrote:
> > cause any CPU load (or more precisely, non-measurable load). However, with
> > mach64 and r128, it DOES. I did some more research.
> 
> Makes sense
> 
> > memcpy-ing 380kB at 25fps takes about 5ms per frame and causes X to eat 1% cpu
> > time (time measurements were done by tsc)

1%? at 5ms/f * 25 f/s = 125 ms/ second. = 12% of your CPU. 

However, as the X server manages to finish doing what it has to do
before the next timer tick, it will almost never get a timer tick
accounted to it.

> > memcpy-ing 760kB at 25fps takes about 11ms per frame, but instead of eating
> > 2% CPU time, it eats 35% (yes, that's 35 times more)

So at 2.2 times as much CPU time, I'd expect around 27% real
usage. But instead of managing to miss the timer tick almost every
time, it is now managing to hit slightly more than average on the
timer ticks. Or it's using a little bit more than you measured.

By doing stuff that takes on the order of a timer tick, and to trigger
them off a timer event, means that CPU time measurements can become
highly inaccurate. 

If you buy CPUtime on a large unix computer, and have a tight
mainloop, you can measure the number of iterations you can do inside
your mainloop in 9ms. Then schedule an "usleep (1)" every time you hit
that many iterations. Cheap computing... ;-)

			Roger. 


-- 
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
* There are old pilots, and there are bold pilots. 
* There are also old, bald pilots. 

  reply	other threads:[~2001-08-27 21:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-27 18:13 memcpy to videoram eats too much CPU on ATI cards (cache trashing?) Peter Surda
2001-08-27 19:22 ` Alan Cox
2001-08-27 21:40   ` Rogier Wolff [this message]
2001-08-27 22:01     ` Peter Surda
2001-09-06  6:18       ` (solved) memcpy to videoram eats too much CPU on ATI cards Peter Surda
2001-09-06 11:37       ` Daniel Egger
2001-09-06 13:10         ` Peter Surda

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=200108272140.XAA20798@cave.bitwizard.nl \
    --to=r.e.wolff@bitwizard.nl \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shurdeek@panorama.sth.ac.at \
    /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;
as well as URLs for NNTP newsgroup(s).