On Tue, Oct 07, 2003 at 06:17:04PM -0400, [EMAIL PROTECTED] wrote:
> Hi Luigi, Mark,
> 
> Thanks for your replies.
> 
> We did some intensive profiling of our application. It does not seem like
> we are depending on clock ticks for any calculations.
> 
> On the other hand we notice that our slow iterations happen almost at the
> same instant as "microuptime went backward" messages in the system log. We

if this is the case, probably your code at some point computes a
time difference which turns out negative (or if it is unsigned, it
becomes very very large) upon those events, thus causing some loop
to explode.
It should be easy to check if this is the case, and just ignore
those outliers rather than trying to figure out why the clock
goes backward. I used to see the same "microuptime went backwards"
msg on some of my 400MHz boxes, even without NTP enabled.
Maybe a buggy timer, not sure which timecounter was used on that
box (i read some time ago that the cpu on the soekris4801 has a
weird TSC implementation where the upper 32 bits change when the
lower 32 bits are 0xfffffffd, who knows what other bugs might be
in other hardware...)

        cheers
        luigi

> were told that ntpd is correcting the time when these messages appear. The
> vexing problem is that making HZ=1000 has increased the rate at which ntp
> updates the time. Is this possible ? Does ntp count the number of ticks
> before applying a correction ?
> 
> This is the point we are at now. Any help to shed more light on this is
> appreciated.
> 
> Thanks,
> -ansh
> 
> 
> 
> 
> 
> Original Message:
> -----------------
> From: Mark Santcroos [EMAIL PROTECTED]
> Date: Tue, 7 Oct 2003 19:16:14 +0200
> To: [EMAIL PROTECTED]
> Subject: Re: HZ = 1000 slows down application
> 
> 
> On Mon, Sep 22, 2003 at 02:22:02PM -0700, Luigi Rizzo wrote:
> > On Mon, Sep 22, 2003 at 02:43:40PM -0400, [EMAIL PROTECTED] wrote:
> > ...
> > > But now I noticed that my application is occassionally doing slower
> > > iterations. Average iteration time used to be 0.2 ms without polling
> > > enabled. With the device polling changes, the average time is still
> around
> > > the same, but once every few minutes the application sees iterations
> that
> > > are 3.3 seconds (*seconds*, not a typo) long. 
> > 
> > most likely your application makes some assumptions on the duration of
> > a clock tick and then it gets confused when, say, a select returns
> > quicker, or some time difference becomes negative, etc. etc. because
> > of the finer granularity.
> > 
> > very common type of bug.
> 
> Hi,
> 
> What was the outcome of this?
> 
> Thanks
> 
> Mark
> 
> 
> 
> 
> --------------------------------------------------------------------
> mail2web - Check your email from the web at
> http://mail2web.com/ .
> 
> 
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to