LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* 2.6 high CPU utilization with multimedia apps {Scanned}
@ 2004-05-22 14:36 rettw
  2004-05-23  0:27 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: rettw @ 2004-05-22 14:36 UTC (permalink / raw)
  To: linux-kernel

Hello:

I have noticed and have read several reports on the net
regarding CPU utilization differences (top displays) when
running multimedia apps on 2.6 versus late 2.4 kernels. 
2.6 running xine/mplayer/vlc etc uses 2-4 times more CPU
than 2.4.24 running the very same applications/media. 
Some of the CPU appears tied up in the "X" process (I am
using the xvideo extension), the rest in the app itself. 
I have seen this on every machine I have tested 2.6 on,
all with 2Ghz+ CPUs.  I have tested 2.6.4, 2.6.5, 2.6.6
vanilla kernels from kernel.org

Is this by design?  It seems strange that these apps
should use so much more CPU power, and honestly it could
make older platforms less capable of playing some media
types than they could before 2.6 without issues.

No one on the X lists, or the lists for the apps
themselves has any input on this, so I figured I would ask
at the source.

Thanks,

Rett Walters

Please CC me directly, as I am not subscribed to the list.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 2.6 high CPU utilization with multimedia apps {Scanned}
  2004-05-22 14:36 2.6 high CPU utilization with multimedia apps {Scanned} rettw
@ 2004-05-23  0:27 ` Andrew Morton
  2004-05-24  1:47   ` rettw
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2004-05-23  0:27 UTC (permalink / raw)
  To: rettw; +Cc: linux-kernel

rettw@rtwnetwork.com wrote:
>
> I have noticed and have read several reports on the net
>  regarding CPU utilization differences (top displays) when
>  running multimedia apps on 2.6 versus late 2.4 kernels. 
>  2.6 running xine/mplayer/vlc etc uses 2-4 times more CPU
>  than 2.4.24 running the very same applications/media. 
>  Some of the CPU appears tied up in the "X" process (I am
>  using the xvideo extension), the rest in the app itself. 
>  I have seen this on every machine I have tested 2.6 on,
>  all with 2Ghz+ CPUs.  I have tested 2.6.4, 2.6.5, 2.6.6
>  vanilla kernels from kernel.org

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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 2.6 high CPU utilization with multimedia apps {Scanned}
  2004-05-23  0:27 ` Andrew Morton
@ 2004-05-24  1:47   ` rettw
  2004-05-24  2:13     ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: rettw @ 2004-05-24  1:47 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

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?  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.

Thanks again for the help - this has been quite a mystery....

Thanks,

Rett Walters


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 2.6 high CPU utilization with multimedia apps {Scanned}
  2004-05-24  1:47   ` rettw
@ 2004-05-24  2:13     ` Andrew Morton
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2004-05-24  2:13 UTC (permalink / raw)
  To: rettw; +Cc: linux-kernel

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-05-24  2:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-22 14:36 2.6 high CPU utilization with multimedia apps {Scanned} rettw
2004-05-23  0:27 ` Andrew Morton
2004-05-24  1:47   ` rettw
2004-05-24  2:13     ` Andrew Morton

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).