On Tue, 19 Dec 2006, Jesse Gumm wrote: > Right now, I have a fresh machine I just installed earlier today. > > To test some of the stability, I have a perl script that allocates and > deallocates memory over an over. That's it. I have the script > running in parallel 3 times, to utilize both CPUs and to get a little > bit of preempting in there. > > Here's where I'm confused: CPU0 is running at it seems 60% user and > 40% system, while CPU1 is running on average 99% user, and 1% system. > What is the reason for the descrepancy, and despite the descrepancy, > why is the the system usage so high? Is there something I can do to > find out what the system is doing? > > For a reference, the output from top can be seen here: > > http://www.dkpsystem.com/settings/www/forum/5138/top.txt > > Any ideas?
The time spend in system is high because it takes kernel time to manage all the allocations and deallocations for your test processes. Unlike some other unix systems, OpenBSD does give free'ed memory back to the system (not always immediately, though). Why CPU0 is doing most of that work I do not know. AFAIK, interrupts are serviced by CPU, but both CPU0 and CPU1 execute system calls. Maybe memory management is also done exclusively by CPU0? You can use ktrace to see all the system calls that are done by your test. That should give a clue what is going on. My guess would be that the mmap(2) and munmap(2) are the most popular system calls done by your test. -Otto