This is on a recent FreeBSD-6.0 stable SMP machine. As root, run "top -s0". Then, at the same time run this program: #include <pthread.h> #define D (1<<10) void *thread(void *n) { int i; double array[D]; for (i=0;i<D;i++) array[i] = i; } int main() { void *i; pthread_t tid; while (1) { pthread_create(&tid,NULL,thread,i); pthread_join(tid,&i); } } Let this program run for about a minute. Then kill this program. At this point, I sometimes get some calcru messages from the kernel. (This is not a contrived situation - this happens much more frequently than this sample program when I run programs with threaded fftw3 calls - I suspect that it throws off the cpu times shown by top.) Stephen
Stephen Montgomery-Smith wrote:> This is on a recent FreeBSD-6.0 stable SMP machine. > > As root, run "top -s0". Then, at the same time run this program: > > #include <pthread.h> > #define D (1<<10) > void *thread(void *n) { > int i; > double array[D]; > for (i=0;i<D;i++) array[i] = i; > } > int main() { > void *i; > pthread_t tid; > while (1) { > pthread_create(&tid,NULL,thread,i); > pthread_join(tid,&i); > } > } > > Let this program run for about a minute. Then kill this program. > > At this point, I sometimes get some calcru messages from the kernel. > > (This is not a contrived situation - this happens much more frequently > than this sample program when I run programs with threaded fftw3 calls - > I suspect that it throws off the cpu times shown by top.)Try this, http://www.freebsd.org/doc/en/books/faq/book.html#CALCRU-NEGATIVE -- Giovanni P. Tirloni http://tirloni.blogspot.com
Giovanni P. Tirloni wrote:> Try this, > > http://www.freebsd.org/doc/en/books/faq/book.html#CALCRU-NEGATIVEThank you. I must admit that I missed this. Unfortunately all the suggestions in this FAQ seem to be out of date - none of the suggested sysctls or kernel config options seem to apply to FreeBSD 6. Stephen