Skip to content

Commit

Permalink
kill_release: upgrade process_mrelease message to info
Browse files Browse the repository at this point in the history
And also make the log lines appear in the right order.
I don't think the printf will hurt us.
  • Loading branch information
rfjakob committed Apr 8, 2024
1 parent 7534065 commit 75767b9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ int kill_release(const pid_t pid, const int pidfd, const int sig)
if (res != 0) {
warn("%s: pid=%d: process_mrelease pidfd=%d failed: %s\n", __func__, pid, pidfd, strerror(errno));
} else {
debug("%s: pid=%d: process_mrelease pidfd=%d success\n", __func__, pid, pidfd);
info("%s: pid=%d: process_mrelease pidfd=%d success\n", __func__, pid, pidfd);
}
#endif
// Return 0 regardless of process_mrelease outcome
Expand Down Expand Up @@ -227,9 +227,8 @@ int kill_wait(const poll_loop_args_t* args, pid_t pid, int sig)
print_mem_stats(debug, m);
if (m.MemAvailablePercent <= args->mem_kill_percent && m.SwapFreePercent <= args->swap_kill_percent) {
sig = SIGKILL;
res = kill_release(pid, pidfd, sig);
// kill first, print after
warn("escalating to SIGKILL after %.3f seconds\n", secs);
res = kill_release(pid, pidfd, sig);
if (res != 0) {
goto out_close;
}
Expand Down

0 comments on commit 75767b9

Please sign in to comment.