# unholy magic in my kernel

## tba

Ive noticed something strange about my gentoo/computer's behavior.  I will try to express it as well as i can, but unfortunately i incapable of getting too technical.

my system has a short attention span.  after any sort of intensive app is open for a while its stops devoting energy to it and it begins running choppy. specific  examples ive come across include wolfenstien, an opengl visualization plugin for xmms, or a terminal emulator emerging something in the background.  After abgout 15 seconds my computer gets bored and the same app that was running fine when i opened it gets so stubborn i can barely use the mouse at all.

so how did i come to this conclusion? For one, i simply noticed my mouse's choppiness after wolfenstien was open for a few secs, and I witnessed a shell's emerging come to a standstill while i was  just browsing the web.  What convinced me something is wrong was monitoring Gkrellm while i ran the opengl spinning spectrum analyzer:  

You know how there are two lines plotted in the cpu chart in Gkrellm.  In the default skin one is blue and one is orange.  Playing a song, the blue and the orange line are both below 8% + 5% respectivly.  openning the spectrum analyzer into an almost full window the blue shoots up to 90% and the orange to about 50%.  Everything is fine for a short while, when my orange drops back down to 5% and my fps in the analyzer goes, i'd say, from 30 to 3.  if i try to open, say, konqueror at this time, the cpu doesnt give any serious effort for a few seconds from the "click" upon which it shoots to 100% for a split second and then does nothing again for a while.  a total of fifteen seconds later the window pops up and the program runs like crap untill i start closing stuff or something. 

i rarely breach 30% memory usage.  i have a pIII coppermine 1ghz, 33mhz fsb, 256mb ram, ati raedon w/ 64mb, and a udma-33 old school 20 gig hd.  and i know there is no reason for it to run this slow, especially in light of Mr. Robin's (self-proclaimed) focus on "interactive response" in gentoo, and his comparision of gentoo's responsivness to beos or amiga.  I have a copy of beos on this computer and i can assure you a busy gentoo is MUCH less snappy then a busy BeOS.  I installed the AC preemptive kernel and made sure the "preemptive kernel" feature was enabled in "make menuconfig."

does this make sense to anyone?  i'm sure there are people who could have expressed all that in four sentences.

----------

## Sivar

Weird. Show us the output of 'ps -A' and 'top'. Are you running any unusual programs like VMware? What kind of hardware do you have? What CFLAGS were used for compiling Gentoo.

----------

## AutoBot

Yes this is a strange problem indeed, more information is needed for troublshooting. 

One question though, do these strange things only happen while running X?

----------

## tba

i dont know how wierd it really is...  a guy on this forum reported a very similar problem

https://forums.gentoo.org/viewtopic.php?t=4017&postdays=0&postorder=asc&start=0

AutoBot,

it probably only happens in X.  im avoid hanging around the bash prompt too much.

sivar,

what exactly is a cflag.  i used a stage 1 install and was very careful to follow the directions very exactly.  is i686 the answer you are looking for?  i recreated the problem below on a clean reboot.  I waited for it to start skipping at which point i did a "top" at the shell.

my hardwre is next to state of the art.  p3 1ghz (coppermine 100mhz fsb) 256mb dimm ram (not ddr), ati radeon 7200 64mb.

here is the output of "top."  at this point i simply reboot, opened xmms started the opengl plugin (which looks like its not rendering quite right, some of the bars are missing a wall) waited a few seconds and it started skipping.

5:46pm  up 21 min,  1 user,  load average: 1.27, 0.68, 0.46

58 processes: 52 sleeping, 6 running, 0 zombie, 0 stopped

  5:47pm  up 21 min,  1 user,  load average: 1.31, 0.71, 0.47

58 processes: 52 sleeping, 6 running, 0 zombie, 0 stopped

CPU states: 94.9% user,  5.0% system,  0.0% nice,  0.0% idle

Mem:   255904K av,  217336K used,   38568K free,       0K shrd,    2188K buff

Swap:  530136K av,       0K used,  530136K free                   99400K cached

  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND

 3728 brian     25   0 82724 9632  4624 R    82.0  3.7   0:26 xmms

 3137 root      25   0  103M  29M  1812 R     4.7 11.7   1:55 X

 3326 brian     15   0  102M  30M 16544 S     4.4 12.2   0:33 kdeinit

 3726 brian     15   0 82724 9632  4624 R     4.0  3.7   0:01 xmms

 3308 brian     15   0 82724 9632  4624 S     1.1  3.7   0:13 xmms

 3278 brian     16   0  3540 3540  2712 S     1.0  1.3   0:07 gkrellm

 3316 brian     15   0 86956  13M 10596 R     0.6  5.4   0:02 kdeinit

 3729 brian     15   0  1068 1068   844 R     0.6  0.4   0:00 top

 3275 brian     15   0 92196  18M 14172 S     0.4  7.4   0:15 kdeinit

 3252 brian     15   0 84572  11M  9388 S     0.3  4.4   0:04 kdeinit

 3273 brian     15   0 89112  15M 12916 S     0.2  6.2   0:04 kdeinit

  1 root      15   0   512  512   448 S     0.0  0.2   0:03 init

theres more below this but i dont hink they matter.  

someone also recommended using hdparm to check/optimize disk performance.  this is hdparms output

/dev/hda:

 multcount    = 16 (on)

 I/O support  =  0 (default 16-bit)

 unmaskirq    =  0 (off)

 using_dma    =  1 (on)

 keepsettings =  0 (off)

 nowerr       =  0 (off)

 readonly     =  0 (off)

 readahead    =  8 (on)

 geometry     = 2495/255/63, sectors = 40088160, start = 0

 busstate     =  1 (on)

 acoustic     =  0 (128=quiet ... 254=fast)

this article http://linux.oreillynet.com/pub/a/linux/2000/06/29/hdparm.html

recommended running hdparm -tT /dev/hda to test throughput and i got this...

/dev/hda:

could not allocate sharedmem buf: Function not implemented

could not allocate sharedmem buf: Function not implemented

im shooting in the dark here, but does this help at all.... 

autobot, if i (somehow) raise X's priority will that carry on to all open windows in X?  is that what you are getting at

can someone please tell me how to quote something.  the button above does jackLast edited by tba on Sun Jun 09, 2002 10:21 pm; edited 4 times in total

----------

## AutoBot

It sounds to me like your entire issue is revolving around X and OpenGL, which leads me to believe your having problems with your ATI display driver.

----------

## tba

does that necessarilly mean that my opengl setup is to blame?  even when im not using any hardware acceleration, the system falls into the "high-latency hole."  how can i raise x's priority?

though now that you mention it, i got advice for setting up my radeaon from a guy with a slightly different card (the 32mb version i dont know if it was a 7200 or a 7500, i have the former)

----------

## AutoBot

Well lets skip that for a minute, on your running kernel are you using preempt and low-latency together?

----------

## tba

i know pre-rmpt is on, math emulation is off, intel pIIxn chipset support is enabled,  hor. and vert. screen res is set to 1024x768 (i use 1280 x 1024 now).  the drm 4.1 driver is enabled for my radeon, blue tooth is disabled whatever that is.  I couldnt find anything about low-latency, I alwasy just assumed that by using the AC kernel it would be enabled automatically.  all the settings i just read off to you come from make menuconfig

----------

## tba

i messed around with my hdparm settings and the bars are rendered better, and the glplugin runs a bit better, but it still hangs every other second for about 1/2 second.  i should mention that i can play opengl games pretty well (not as well as in windows by a long shot).  im still wondering why i canht test throughput using hdparm.

also, the performance in wolfenstein is much better.  it used to be OK when one was inside but very poor in the outside parts of levels

----------

## AutoBot

You mean the following doesn't work ?

```

hdparm -tT /dev/hdX

```

----------

## AutoBot

Oh and what fps do you get on glxgears?

----------

## tba

this is what i get when i run that

/dev/hda: 

could not allocate sharedmem buf: Function not implemented 

could not allocate sharedmem buf: Function not implemented 

i did everything else that was mentioned on that site and did increase my performance, but i can still see, using gkrellm and the opengl spec. anal.  that my system stops devoting resources to a task after a little bit

----------

## tba

in gears

2959 frames in 5.0 seconds = 591.800 FPS

but if you could SEE how it runs it is a microcosm of what is wrong...  after a few seconds it looks like someone threw a wrench in the gears.  they seem to stop and reverberate, then run normally, then stop alternating every second or two.  the fps doesnt drop in the outpu but SMOOTH it is not

----------

## tba

the proc chart in gkrellm shoots all the way up after running glxgears and many other apps...  shouldnt it just go up a little and not necessarily max out?

----------

## arkane

Have you tried dropping out of X and running a few apps like top or compiling a kernel?

----------

## AutoBot

Well you are definately experiencing some sort of OpenGL/Xfree issue, I get much higher numbers with a processor that is only 533mhz and an equal card Nvidia GeForce II MX 400 (64Meg).

I don't know much about ATI cards other than there drivers are simply terrible from what I have seen. Perhaps you could try posting in the hardware forum with a title of ATI Driver Issues or something similar. 

Alternatively I noticed xfree was in my --update world today, perhaps you could update to the newest X available and it may solve your choppy performace issue.

----------

## tba

autobot, im going to take your word for it and circumvent the issue entirely.  I switched my video card with my brothers GeForce II M400.  so far no luck with 3D but thats a post for another forum and 10 hairs off my head  :Smile: 

----------

## c_kuzmanic

 *AutoBot wrote:*   

> It sounds to me like your entire issue is revolving around X and OpenGL, which leads me to believe your having problems with your ATI display driver.

 

I second that. ATI Radeon's are great cards but since ATI doesn't place any emphasis on comprehensive driver support they are problem ridden when used under Linux. This is a shame, especially when compared to NVidia. What I would do is take another half-way decent video card and stick that into my board for testing purposes. That way you will at least be able to isolate the problem and find out if the card is indeed making trouble.

----------

## keifir

let me third that one. I experienced similar problems with the Rad7200 64mb sdr. My distro at that time was Mandrake 8.2 - it would use generic radeon ddr drivers.  

This is what i did: i gave up  :Crying or Very sad:  . Switched the card to gforce2.   Not to give u any ideas tho.

Try Xfree.org to see if they got the specialized drivers for it now - i remember i could not find any for that card.

----------

## AutoBot

Update: the new X completely borked my opengl so watch out.

Before my fps in glxgears was somewhere in the mannor of 1000fps, now it's like 50fps and will only run in software mode.

If anyone knows whats going on I would like to hear it   :Very Happy: 

----------

