ofproto-dpif-governor: Wake up only when there is genuinely work to do.
[sliver-openvswitch.git] / ofproto / ofproto-dpif-governor.c
index 7e3ecfa..458f8d7 100644 (file)
@@ -93,7 +93,9 @@ governor_run(struct governor *g)
 void
 governor_wait(struct governor *g)
 {
-    poll_timer_wait_until(g->start + MAX_ELAPSED);
+    if (g->size > MIN_SIZE) {
+        poll_timer_wait_until(g->start + MAX_ELAPSED);
+    }
 }
 
 /* Returns true if 'g' has been doing only a minimal amount of work and thus
@@ -162,7 +164,7 @@ governor_new_generation(struct governor *g, unsigned int size)
     if (g->size != size) {
         if (!g->size) {
             VLOG_INFO("%s: engaging governor with %u kB hash table",
-                      g->name, g->size / 1024);
+                      g->name, size / 1024);
         } else {
             VLOG_INFO("%s: processed %u packets in %.2f s, "
                       "%s hash table to %u kB",