Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dd670224 authored by Thomas Gleixner's avatar Thomas Gleixner
Browse files

posix-cpu-timers: Remove pointless comparisons



The soft RLIMIT expiry code checks whether the soft limit is greater than
the hard limit. That's pointless because if the soft RLIMIT is greater than
the hard RLIMIT then that code cannot be reached as the hard RLIMIT check
is before that and already killed the process.

Remove it.

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarFrederic Weisbecker <frederic@kernel.org>
Link: https://lkml.kernel.org/r/20190821192922.548747613@linutronix.de
parent 8ea1de90
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -814,15 +814,14 @@ static void check_thread_timers(struct task_struct *tsk,
			__group_send_sig_info(SIGKILL, SEND_SIG_PRIV, tsk);
			return;
		}

		if (rtim >= soft) {
			/*
			 * At the soft limit, send a SIGXCPU every second.
			 */
			if (soft < hard) {
			soft += USEC_PER_SEC;
				tsk->signal->rlim[RLIMIT_RTTIME].rlim_cur =
					soft;
			}
			tsk->signal->rlim[RLIMIT_RTTIME].rlim_cur = soft;

			if (print_fatal_signals) {
				pr_info("RT Watchdog Timeout (soft): %s[%d]\n",
					tsk->comm, task_pid_nr(tsk));
@@ -938,11 +937,10 @@ static void check_process_timers(struct task_struct *tsk,
					tsk->comm, task_pid_nr(tsk));
			}
			__group_send_sig_info(SIGXCPU, SEND_SIG_PRIV, tsk);
			if (soft < hard) {

			sig->rlim[RLIMIT_CPU].rlim_cur = soft + 1;
			softns += NSEC_PER_SEC;
		}
		}

		/* Update the expiry cache */
		if (softns < pct->bases[CPUCLOCK_PROF].nextevt)