Skip to contentSkip to conversation

memcpy to videoram eats too much CPU on ATI cards (cach

DISCUSSION Petr Vandrovec 1 participant 1 message Aug 27, 2001

lore
Share & tools
lore
#0 lore raw
Quoted 5 lines · Peter Surda

memcpy-ing 380kB at 25fps takes about 5ms per frame and causes X to eat 1% cpu time (time measurements were done by tsc)
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)

It is because of way how time accounting to processes works in Linux. Your X-server gets time quantum, and starts copying data to videoram. If it finishes before 1/HZ seconds, no consumed time is accounted to it.

As soon as task does not finish its job in 1/HZ seconds, some time is accounted to it. Just try running some benchmark together with your memcpy. You'll found that benchmark slowdown is (almost) linear with memcpy size. Especially if you'll run benchmark on some nice level.

You can try varying size around 650-750kBs, and you'll find that it clibms up very quickly in this range, just when consumed time crosses 10ms.
Best regards,
Petr Vandrovec [email protected]