提交 43fe8b8e 编写于 作者: T Thomas Gleixner

posix-timers: Make signal printks conditional

A recent commit added extra printks for CPU/RT limits. This can result in
excessive spam in dmesg.

Make the printks conditional on print_fatal_signals.

Fixes: e7ea7c98 ("rlimits: Print more information when CPU/RT limits are exceeded")
Reported-by: NDave Jones <davej@codemonkey.org.uk>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Cc: Arun Raghavan <arun@arunraghavan.net>
上级 08332893
...@@ -825,8 +825,10 @@ static void check_thread_timers(struct task_struct *tsk, ...@@ -825,8 +825,10 @@ static void check_thread_timers(struct task_struct *tsk,
* At the hard limit, we just die. * At the hard limit, we just die.
* No need to calculate anything else now. * No need to calculate anything else now.
*/ */
if (print_fatal_signals) {
pr_info("CPU Watchdog Timeout (hard): %s[%d]\n", pr_info("CPU Watchdog Timeout (hard): %s[%d]\n",
tsk->comm, task_pid_nr(tsk)); tsk->comm, task_pid_nr(tsk));
}
__group_send_sig_info(SIGKILL, SEND_SIG_PRIV, tsk); __group_send_sig_info(SIGKILL, SEND_SIG_PRIV, tsk);
return; return;
} }
...@@ -838,8 +840,10 @@ static void check_thread_timers(struct task_struct *tsk, ...@@ -838,8 +840,10 @@ static void check_thread_timers(struct task_struct *tsk,
soft += USEC_PER_SEC; soft += USEC_PER_SEC;
sig->rlim[RLIMIT_RTTIME].rlim_cur = soft; sig->rlim[RLIMIT_RTTIME].rlim_cur = soft;
} }
if (print_fatal_signals) {
pr_info("RT Watchdog Timeout (soft): %s[%d]\n", pr_info("RT Watchdog Timeout (soft): %s[%d]\n",
tsk->comm, task_pid_nr(tsk)); tsk->comm, task_pid_nr(tsk));
}
__group_send_sig_info(SIGXCPU, SEND_SIG_PRIV, tsk); __group_send_sig_info(SIGXCPU, SEND_SIG_PRIV, tsk);
} }
} }
...@@ -936,8 +940,10 @@ static void check_process_timers(struct task_struct *tsk, ...@@ -936,8 +940,10 @@ static void check_process_timers(struct task_struct *tsk,
* At the hard limit, we just die. * At the hard limit, we just die.
* No need to calculate anything else now. * No need to calculate anything else now.
*/ */
if (print_fatal_signals) {
pr_info("RT Watchdog Timeout (hard): %s[%d]\n", pr_info("RT Watchdog Timeout (hard): %s[%d]\n",
tsk->comm, task_pid_nr(tsk)); tsk->comm, task_pid_nr(tsk));
}
__group_send_sig_info(SIGKILL, SEND_SIG_PRIV, tsk); __group_send_sig_info(SIGKILL, SEND_SIG_PRIV, tsk);
return; return;
} }
...@@ -945,8 +951,10 @@ static void check_process_timers(struct task_struct *tsk, ...@@ -945,8 +951,10 @@ static void check_process_timers(struct task_struct *tsk,
/* /*
* At the soft limit, send a SIGXCPU every second. * At the soft limit, send a SIGXCPU every second.
*/ */
if (print_fatal_signals) {
pr_info("CPU Watchdog Timeout (soft): %s[%d]\n", pr_info("CPU Watchdog Timeout (soft): %s[%d]\n",
tsk->comm, task_pid_nr(tsk)); tsk->comm, task_pid_nr(tsk));
}
__group_send_sig_info(SIGXCPU, SEND_SIG_PRIV, tsk); __group_send_sig_info(SIGXCPU, SEND_SIG_PRIV, tsk);
if (soft < hard) { if (soft < hard) {
soft++; soft++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册