Date: Fri, 25 Feb 2011 12:41:58 +1030 From: "Daniel O'Connor" <doconnor@gsoft.com.au> To: Jerome Flesch <jerome.flesch@netasq.com> Cc: freebsd-current@freebsd.org Subject: Re: Process timing issue Message-ID: <0691A273-3363-4FC2-B2C6-5995A628C801@gsoft.com.au> In-Reply-To: <4D6291A5.4050206@netasq.com> References: <4D6291A5.4050206@netasq.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 22/02/2011, at 2:54, Jerome Flesch wrote: > While investigating a timing issue with one of our program, we found = out something weird: We've written a small test program that just calls = clock_gettime() a lot of times and checks that the time difference = between calls makes sense. In the end, it seems it doesn't always do. >=20 > Calling twice in a row clock_gettime() takes usually less than 1ms. = But with an average load, about 1 time in 200000, more than 10ms are = spent between both calls for no apparent reason. According to our tests, = when it happens, the time between both calls can go from few = milliseconds to many seconds (our best score so far is 10 seconds :). = Same goes for gettimeofday(). >=20 > To reproduce this issue, we use the small test program joined to this = mail and openssl speed test commands (usually 'openssl speed -elapsed = dsa2048'). It only appears if one of these openssl speed test run on the = same core than our test progam, so we have to start as many openssl = instances as there are cores on the test computer. This sounds like a problem I have trying to read from a FIFO in hardware = over USB. Most of the time the libusb poll thread doesn't take very long, but = every now and then it takes too long and my FIFO fills up (~75msec). If you do find a solution I would be very interested :) In the end I wrote a kernel driver which read & buffered the data, but I = suppose that is not possible for you. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0691A273-3363-4FC2-B2C6-5995A628C801>