Skip to content

Commit

Permalink
ovsdb-server: Don't log when memory-trim-on-compaction doesn't change.
Browse files Browse the repository at this point in the history
But log at least once even if the value hasn't changed, for
informational purposes.

Signed-off-by: Dan Williams <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
  • Loading branch information
dcbw authored and igsilya committed Dec 21, 2022
1 parent 863d2e1 commit 685973a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ovsdb/ovsdb-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -1600,6 +1600,8 @@ ovsdb_server_memory_trim_on_compaction(struct unixctl_conn *conn,
const char *argv[],
void *arg OVS_UNUSED)
{
bool old_trim_memory = trim_memory;
static bool have_logged = false;
const char *command = argv[1];

#if !HAVE_DECL_MALLOC_TRIM
Expand All @@ -1615,8 +1617,11 @@ ovsdb_server_memory_trim_on_compaction(struct unixctl_conn *conn,
unixctl_command_reply_error(conn, "invalid argument");
return;
}
VLOG_INFO("memory trimming after compaction %s.",
trim_memory ? "enabled" : "disabled");
if (!have_logged || (trim_memory != old_trim_memory)) {
have_logged = true;
VLOG_INFO("memory trimming after compaction %s.",
trim_memory ? "enabled" : "disabled");
}
unixctl_command_reply(conn, NULL);
}

Expand Down

0 comments on commit 685973a

Please sign in to comment.