2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-15 14:17:18 +00:00

memory: Avoid 100% CPU when there is nothing to report.

Commit b9de408768 (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>
This commit is contained in:
Ben Pfaff
2013-04-11 15:05:32 -07:00
parent f28b6dd3f4
commit 1c85959e0c

View File

@@ -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) {