linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Kernel 2.6 with X (xorg) 4.4 (eats more CPU power)
@ 2004-12-01 10:21 Joe Hsu
  2004-12-01 10:26 ` Arjan van de Ven
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Joe Hsu @ 2004-12-01 10:21 UTC (permalink / raw)
  To: linux-kernel

Dear All:
    I've tried libXv to open an Video Overlay port and
XvShmPutImage for 60 frames per second. Each frame is
at a size of 800x600 using format YUYV (YUV2). Before
each XvShmPutImage, I copy 800x600x2 bytes of non-constant 
data to XvImage->data. (No user interactive UI)

    And I found something interisting happened. In pentium 4
3.0G machine and linux kernel 2.6, X and my program total 
consumes 5% of cpu resource.

    But in pentium 4 2.xG or below, it would consume 10% or 
more of CPU resource. (If you try this with XFree86 4.2 and 
pentium 1.xG machine, it would consume 30% or more of cpu 
resource at a peak.)

    In contrast, I've tried Kernel 2.4 with same X, same 
program, and same machine. It consumes almost zero of CPU 
resource( no matter it runs on a P4 1.xG or P4 3.0G and no
matter it runs on 4.4 or 4.2 X-server).

    Same phenomenon happened when I ran 4 mpeg4 playback 
programs (each 320x240, 30 frames per second, no scaling).
It seems that these programs and X consume almost zero of 
CPU power when the KERNEL HZ is 100. (I've 
tried Robert Love's variable HZ patch to kernel 2.4 and 
change HZ to 1000........Same phenomenon as 2.6)

    Could any one explain why??? Thanks.
(I wish to be personally CC'ed the answers/comments posted 
to the list in response to your posting 'cause I do not 
subscribe to this mailing list.)


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

* Re: Kernel 2.6 with X (xorg) 4.4 (eats more CPU power)
  2004-12-01 10:21 Kernel 2.6 with X (xorg) 4.4 (eats more CPU power) Joe Hsu
@ 2004-12-01 10:26 ` Arjan van de Ven
  2004-12-02  3:21   ` Kernel 2.6 with X (eats more CPU power)...with test program Joe Hsu
  2004-12-01 10:27 ` Kernel 2.6 with X (xorg) 4.4 (eats more CPU power) Arjan van de Ven
  2004-12-01 10:56 ` Miguel Angel Flores
  2 siblings, 1 reply; 5+ messages in thread
From: Arjan van de Ven @ 2004-12-01 10:26 UTC (permalink / raw)
  To: Joe Hsu; +Cc: linux-kernel

On Wed, 2004-12-01 at 18:21 +0800, Joe Hsu wrote:

>     And I found something interisting happened. In pentium 4
> 3.0G machine and linux kernel 2.6, X and my program total 
> consumes 5% of cpu resource.
> 
>     But in pentium 4 2.xG or below, it would consume 10% or 
> more of CPU resource. (If you try this with XFree86 4.2 and 
> pentium 1.xG machine, it would consume 30% or more of cpu 
> resource at a peak.)
> 
>     In contrast, I've tried Kernel 2.4 with same X, same 
> program, and same machine. It consumes almost zero of CPU 
> resource( no matter it runs on a P4 1.xG or P4 3.0G and no
> matter it runs on 4.4 or 4.2 X-server).
> 
>     Same phenomenon happened when I ran 4 mpeg4 playback 
> programs (each 320x240, 30 frames per second, no scaling).
> It seems that these programs and X consume almost zero of 
> CPU power when the KERNEL HZ is 100. (I've 
> tried Robert Love's variable HZ patch to kernel 2.4 and 
> change HZ to 1000........Same phenomenon as 2.6)
> 
>     Could any one explain why??? Thanks.
> (I wish to be personally CC'ed the answers/comments posted 
> to the list in response to your posting 'cause I do not 
> subscribe to this mailing list.)
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
-- 


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

* Re: Kernel 2.6 with X (xorg) 4.4 (eats more CPU power)
  2004-12-01 10:21 Kernel 2.6 with X (xorg) 4.4 (eats more CPU power) Joe Hsu
  2004-12-01 10:26 ` Arjan van de Ven
@ 2004-12-01 10:27 ` Arjan van de Ven
  2004-12-01 10:56 ` Miguel Angel Flores
  2 siblings, 0 replies; 5+ messages in thread
From: Arjan van de Ven @ 2004-12-01 10:27 UTC (permalink / raw)
  To: Joe Hsu; +Cc: linux-kernel

On Wed, 2004-12-01 at 18:21 +0800, Joe Hsu wrote:
> Dear All:
>     I've tried libXv to open an Video Overlay port and
> XvShmPutImage for 60 frames per second. Each frame is
> at a size of 800x600 using format YUYV (YUV2). Before
> each XvShmPutImage, I copy 800x600x2 bytes of non-constant 
> data to XvImage->data. (No user interactive UI)
> 
>     And I found something interisting happened. In pentium 4
> 3.0G machine and linux kernel 2.6, X and my program total 
> consumes 5% of cpu resource.
> 
>     But in pentium 4 2.xG or below, it would consume 10% or 
> more of CPU resource. (If you try this with XFree86 4.2 and 
> pentium 1.xG machine, it would consume 30% or more of cpu 
> resource at a peak.)
> 
>     In contrast, I've tried Kernel 2.4 with same X, same 
> program, and same machine. It consumes almost zero of CPU 
> resource( no matter it runs on a P4 1.xG or P4 3.0G and no
> matter it runs on 4.4 or 4.2 X-server).


reported resource usage is an estimate based on sampling. With HZ=1000 you do get a more accurate
sampling of reality.....

In addition, do check if your code (or X) doesn't do timeouts of < 10 msec; in HZ=100 kernels those always 
delay 10 or 20 msec, while with HZ=1000 kernels the delay becomes far more accurate.


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

* Re: Kernel 2.6 with X (xorg) 4.4 (eats more CPU power)
  2004-12-01 10:21 Kernel 2.6 with X (xorg) 4.4 (eats more CPU power) Joe Hsu
  2004-12-01 10:26 ` Arjan van de Ven
  2004-12-01 10:27 ` Kernel 2.6 with X (xorg) 4.4 (eats more CPU power) Arjan van de Ven
@ 2004-12-01 10:56 ` Miguel Angel Flores
  2 siblings, 0 replies; 5+ messages in thread
From: Miguel Angel Flores @ 2004-12-01 10:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: Joe Hsu

Its just an idea but... ¿Have you configured your 2.6 kernel as a 
Preemptive kernel?

Cheers,
MaF

Joe Hsu escribió:

>     In contrast, I've tried Kernel 2.4 with same X, same 
> program, and same machine. It consumes almost zero of CPU 
> resource( no matter it runs on a P4 1.xG or P4 3.0G and no
> matter it runs on 4.4 or 4.2 X-server).
> 
>     Same phenomenon happened when I ran 4 mpeg4 playback 
> programs (each 320x240, 30 frames per second, no scaling).
> It seems that these programs and X consume almost zero of 
> CPU power when the KERNEL HZ is 100. (I've 
> tried Robert Love's variable HZ patch to kernel 2.4 and 
> change HZ to 1000........Same phenomenon as 2.6)

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

* Kernel 2.6 with X (eats more CPU power)...with test program
  2004-12-01 10:26 ` Arjan van de Ven
@ 2004-12-02  3:21   ` Joe Hsu
  0 siblings, 0 replies; 5+ messages in thread
From: Joe Hsu @ 2004-12-02  3:21 UTC (permalink / raw)
  To: linux-kernel

I put my test program on internet.
http://bill-goldberg.myweb.hinet.net/monitor3.tgz

Download and extract it. And then read README.TXT.
It does make difference between different KERNEL HZ.
This program also shows the time it takes to refresh
every 600 frames.(Roughly 10 seconds, both in kernel
2.4 and 2.6)

> On Wed, 2004-12-01 at 18:21 +0800, Joe Hsu wrote:
> 
> >     And I found something interisting happened. In pentium 4
> > 3.0G machine and linux kernel 2.6, X and my program total 
> > consumes 5% of cpu resource.
> > 
> >     But in pentium 4 2.xG or below, it would consume 10% or 
> > more of CPU resource. (If you try this with XFree86 4.2 and 
> > pentium 1.xG machine, it would consume 30% or more of cpu 
> > resource at a peak.)
> > 
> >     In contrast, I've tried Kernel 2.4 with same X, same 
> > program, and same machine. It consumes almost zero of CPU 
> > resource( no matter it runs on a P4 1.xG or P4 3.0G and no
> > matter it runs on 4.4 or 4.2 X-server).
> > 
> >     Same phenomenon happened when I ran 4 mpeg4 playback 
> > programs (each 320x240, 30 frames per second, no scaling).
> > It seems that these programs and X consume almost zero of 
> > CPU power when the KERNEL HZ is 100. (I've 
> > tried Robert Love's variable HZ patch to kernel 2.4 and 
> > change HZ to 1000........Same phenomenon as 2.6)
> > 
> >     Could any one explain why??? Thanks.
> > (I wish to be personally CC'ed the answers/comments posted 
> > to the list in response to your posting 'cause I do not 
> > subscribe to this mailing list.)
> > 



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

end of thread, other threads:[~2004-12-02  3:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-01 10:21 Kernel 2.6 with X (xorg) 4.4 (eats more CPU power) Joe Hsu
2004-12-01 10:26 ` Arjan van de Ven
2004-12-02  3:21   ` Kernel 2.6 with X (eats more CPU power)...with test program Joe Hsu
2004-12-01 10:27 ` Kernel 2.6 with X (xorg) 4.4 (eats more CPU power) Arjan van de Ven
2004-12-01 10:56 ` Miguel Angel Flores

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