summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-03-28 13:43:32 -0700
committerBen Pfaff <blp@nicira.com>2011-03-30 11:31:16 -0700
commit14865427e666d21baef05fe14874784bf2108c6f (patch)
treece336a9f0626d06a7d08b27ec799c5ba62deb9c8 /lib
parentf421d043146333ae028a402b0e2ba6ecd07d0505 (diff)
downloadopenvswitch-14865427e666d21baef05fe14874784bf2108c6f.tar.gz
timeval: Only log poll intervals longer than 50 ms.
When poll interval-based logging was introduced a long time, we were actively interested in looking at almost every long poll interval. But these days, with OVS working rather well, with pretty good latency, most of the messages are red herrings that bother some administrators and provoke false reports. So this commit suppresses all but the most egregious long poll intervals that may in fact be worth looking at. NIC-366.
Diffstat (limited to 'lib')
-rw-r--r--lib/timeval.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/timeval.c b/lib/timeval.c
index d24ba03f7..84c90f36c 100644
--- a/lib/timeval.c
+++ b/lib/timeval.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, 2010 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -409,8 +409,9 @@ log_poll_interval(long long int last_wakeup, const struct rusage *last_rusage)
now = time_msec();
interval = MIN(10000, now - last_wakeup) << 4;
- /* Warn if we took too much time between polls. */
- if (n_samples > 10 && interval > mean_interval * 8) {
+ /* Warn if we took too much time between polls: at least 50 ms and at least
+ * 8X the mean interval. */
+ if (n_samples > 10 && interval > mean_interval * 8 && interval > 50 * 16) {
struct rusage rusage;
getrusage(RUSAGE_SELF, &rusage);