From 338a19ba4f8f2bd93ea4583b8d80ac12065c84da Mon Sep 17 00:00:00 2001 From: fyodor Date: Mon, 28 Jul 2008 03:34:19 +0000 Subject: [PATCH] updated to allow RateMeter::update to accept time decreases up to 5ms rather than a 1ms limit, as I just had a crash where now=1217210189.144224; last_update_tv=1217210189.148486. I still think this may be a bug in my SMP Linux kernel. But if it affects me, probably affects others. --- timing.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/timing.cc b/timing.cc index 52b8069bc..b0527f7b3 100644 --- a/timing.cc +++ b/timing.cc @@ -351,8 +351,10 @@ void RateMeter::update(u32 packets, u32 bytes, const struct timeval *now) { Unless I'm missing something, I think my gettimeofday may have decreased by 38 microseconds. Perhaps due to SMP and the old kernel. Anyway, I think I'll just treat decreases of up to 1ms - as zero -Fyodor */ - if (diff < 0 && diff > -0.001) { + as zero -Fyodor + Updated to allow up to 5ms due to crash: + RateMeter::update: negative time delta; now=1217210189.144224; last_update_tv=1217210189.148486 */ + if (diff < 0 && diff > -0.005) { if (!clockwarn) { error("Warning: RateMeter::update: negative time delta; now=%lu.%lu; last_update_tv=%lu.%lu", (unsigned long) now->tv_sec, (unsigned long) now->tv_usec, (unsigned long) last_update_tv.tv_sec, (unsigned long) last_update_tv.tv_usec); clockwarn = 1;