Skip to content

Commit 6b0aa14

Browse files
committed
alarmtimers: Remove the throttle mechanism from alarm_forward_now()
Now that ignored posix timer signals are requeued and the timers are rearmed on signal delivery the workaround to keep such timers alive and self rearm them is not longer required. Remove the unused alarm timer parts. Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Frederic Weisbecker <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 7a66f72 commit 6b0aa14

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

kernel/time/alarmtimer.c

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -467,35 +467,11 @@ u64 alarm_forward(struct alarm *alarm, ktime_t now, ktime_t interval)
467467
}
468468
EXPORT_SYMBOL_GPL(alarm_forward);
469469

470-
static u64 __alarm_forward_now(struct alarm *alarm, ktime_t interval, bool throttle)
470+
u64 alarm_forward_now(struct alarm *alarm, ktime_t interval)
471471
{
472472
struct alarm_base *base = &alarm_bases[alarm->type];
473-
ktime_t now = base->get_ktime();
474-
475-
if (IS_ENABLED(CONFIG_HIGH_RES_TIMERS) && throttle) {
476-
/*
477-
* Same issue as with posix_timer_fn(). Timers which are
478-
* periodic but the signal is ignored can starve the system
479-
* with a very small interval. The real fix which was
480-
* promised in the context of posix_timer_fn() never
481-
* materialized, but someone should really work on it.
482-
*
483-
* To prevent DOS fake @now to be 1 jiffy out which keeps
484-
* the overrun accounting correct but creates an
485-
* inconsistency vs. timer_gettime(2).
486-
*/
487-
ktime_t kj = NSEC_PER_SEC / HZ;
488-
489-
if (interval < kj)
490-
now = ktime_add(now, kj);
491-
}
492-
493-
return alarm_forward(alarm, now, interval);
494-
}
495473

496-
u64 alarm_forward_now(struct alarm *alarm, ktime_t interval)
497-
{
498-
return __alarm_forward_now(alarm, interval, false);
474+
return alarm_forward(alarm, base->get_ktime(), interval);
499475
}
500476
EXPORT_SYMBOL_GPL(alarm_forward_now);
501477

0 commit comments

Comments
 (0)