summaryrefslogtreecommitdiff
path: root/lib/memory.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2013-04-11 15:05:32 -0700
committerBen Pfaff <blp@nicira.com>2013-04-11 15:52:58 -0700
commit1c85959e0c8a2c60d8b864d28dfcc7ab55c95a19 (patch)
tree19192516ab197934d7aa860c224080932f93374a /lib/memory.c
parentf28b6dd3f49d355b18e631e441f52611de4e8b13 (diff)
downloadopenvswitch-1c85959e0c8a2c60d8b864d28dfcc7ab55c95a19.tar.gz
memory: Avoid 100% CPU when there is nothing to report.
Commit b9de4087685 (memory: Avoid an empty log message if there's nothing to log.) introduced a 100% CPU usage condition when there is nothing to log. This fixes the problem. Reported-by: Ansis Atteka <aatteka@nicira.com> Acked-by: Ansis Atteka <aatteka@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/memory.c')
-rw-r--r--lib/memory.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/memory.c b/lib/memory.c
index c26c743fb..1137390cb 100644
--- a/lib/memory.c
+++ b/lib/memory.c
@@ -137,8 +137,10 @@ memory_report(const struct simap *usage)
ds_init(&s);
compose_report(usage, &s);
- if (want_report && s.length) {
- VLOG_INFO("%s", ds_cstr(&s));
+ if (want_report) {
+ if (s.length) {
+ VLOG_INFO("%s", ds_cstr(&s));
+ }
want_report = false;
}
if (n_conns) {