Skip to content

Commit fe0517f

Browse files
committed
posix-cpu-timers: Respect INFINITY for hard RTTIME limit
The RTIME limit expiry code does not check the hard RTTIME limit for INFINITY, i.e. being disabled. Add it. While this could be considered an ABI breakage if something would depend on this behaviour. Though it's highly unlikely to have an effect because RLIM_INFINITY is at minimum INT_MAX and the RTTIME limit is in seconds, so the timer would fire after ~68 years. Adding this obvious correct limit check also allows further consolidation of that code and is a prerequisite for cleaning up the 0 based checks and the rlimit setter code. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Frederic Weisbecker <frederic@kernel.org> Link: https://lkml.kernel.org/r/20190821192922.078293002@linutronix.de
1 parent b7be4ef commit fe0517f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎kernel/time/posix-cpu-timers.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ static void check_process_timers(struct task_struct *tsk,
921921
unsigned long hard = task_rlimit_max(tsk, RLIMIT_CPU);
922922
unsigned long psecs = div_u64(ptime, NSEC_PER_SEC);
923923

924-
if (psecs >= hard) {
924+
if (hard != RLIM_INFINITY && psecs >= hard) {
925925
/*
926926
* At the hard limit, we just die.
927927
* No need to calculate anything else now.

0 commit comments

Comments
 (0)