At 09:09 PM 1/1/2009, Nephyrin Zey wrote:
>Linux srcds has used a ton of CPU forever. The main frame loop is
>optimized for a windows 66hz timer environment. Hence, linux servers
>are 'perma-boosted' and chug inordinate amounts of CPU for minor FPS
>increases, and they give us no variables to tweak the various sleep
>times/calculations that impact this. SSE2 is still broken in linux
>srcds. it also uses gettimeofday heavily, which was bad enough that
>the l4d team specifically redid that part of the engine. The engine
>uses 2-3% of the CPU entirely idle on kernels with a high response
>rate (HPET/1000hz/other common things), which caused the l4d team to
>put in a hibernation mode.
>
>The x86 binaries still use -fPIC
>On other arches (amd64) it don't have any performance advantage due to
>the necessary calls being there, but on x86 PIC clobbers a register
>and causes call heavy binaries like srcds to use upwards of 6% of
>their CPU time on thunks. Nvidia's linux OpenGL library, mpeg
>decoders, etc, all use non-fPIC shared objects on x86.
>
>And yeah, SourceTV murders my server in CPU usage. I also noticed FPS
>dips to the point where I had to fuck with the sleep timer to make
>things go smoothly. I made a few threads about this but valve isn't
>really all that interested.
>
>- Neph


64bit binaries would help. I've just finished porting vsyscalls back 
to 2.6.24 series (x86), and I see a minor drop under load. However, 
it doesn't fix the fact
that the engine spends about 1500 cycles an idle loop with source tv 
on. I've also hacked in CLOCK_MONOTONIC support instead of 
gettimeofday.. why does a gameserver
need nanosecond timestamps if everything is more or less estimated?

I didn't think clobbering 1 additional register would make that much 
of a difference. Maybe on older gcc versions, but newer ones are better at it..
however, -fPIC will turn off optimizations that otherwise have to be 
enabled..  I think valve is using 2.9.5 on 1.6/source.

The best long term solution is to use AMD64 binaries again, and then 
they could probably use fPIC without worry about clobbering %ebx..



G. "Monk" Stanley
<gary at summit-servers dot com | gary at DragonflyBSD dot org>
http://leaf.dragonflybsd.org/~gary

"There currently are 7 different ways to get time from a computer. 
All of them can't agree on how long a second is supposed to be" -Me







_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux

Reply via email to