Date: Sun, 13 Jun 2004 12:53:48 -0400 From: Don Bowman <don@sandvine.com> To: "'current@freebsd.org'" <current@freebsd.org> Subject: localcru: negative time of 2360 usec for pid 33672 (fork_exit) Message-ID: <FE045D4D9F7AED4CBFF1B3B813C85337051D8FAE@mail.sandvine.com>
next in thread | raw e-mail | index | archive | help
if you run the below test program, periodically you will get: localcru: negative time of 2360 usec for pid 33672 (fork_exit) come out. On stable, you can set 'kern.timecounter.method=1' to workaround this problem. Is there a fix for this on current? $ cat fork_exit.c #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/time.h> #include <sys/wait.h> #include <sys/resource.h> char buf[16384]; static int doit() { int fd; char fname[] = "/tmp/fe/template.XXXXXXXXXX"; memset(buf,random(), sizeof(buf)); fd = open(mktemp(fname), O_RDWR|O_CREAT|O_TRUNC, 0666); if (fd > 0) { write(fd, buf, sizeof(buf)); } exit(0); } int main(int argc, char **argv) { unsigned int i; int s; mkdir("/tmp/fe", 0777); for (i = 0; ; i++) { if (fork() == 0) { doit(); } if ((i % 1000) == 0) { while (waitpid(-1, &s, WNOHANG) > 0) ; system("rm /tmp/fe/*"); } } return 0; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FE045D4D9F7AED4CBFF1B3B813C85337051D8FAE>