Merge branch 'timers/urgent' into WIP.timers
Pick up urgent fixes to avoid conflicts.
This commit is contained in:
@@ -357,7 +357,7 @@ void alarm_start_relative(struct alarm *alarm, ktime_t start)
|
||||
{
|
||||
struct alarm_base *base = &alarm_bases[alarm->type];
|
||||
|
||||
start = ktime_add(start, base->gettime());
|
||||
start = ktime_add_safe(start, base->gettime());
|
||||
alarm_start(alarm, start);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(alarm_start_relative);
|
||||
@@ -445,7 +445,7 @@ u64 alarm_forward(struct alarm *alarm, ktime_t now, ktime_t interval)
|
||||
overrun++;
|
||||
}
|
||||
|
||||
alarm->node.expires = ktime_add(alarm->node.expires, interval);
|
||||
alarm->node.expires = ktime_add_safe(alarm->node.expires, interval);
|
||||
return overrun;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(alarm_forward);
|
||||
@@ -662,13 +662,21 @@ static int alarm_timer_set(struct k_itimer *timr, int flags,
|
||||
|
||||
/* start the timer */
|
||||
timr->it.alarm.interval = timespec64_to_ktime(new_setting->it_interval);
|
||||
|
||||
/*
|
||||
* Rate limit to the tick as a hot fix to prevent DOS. Will be
|
||||
* mopped up later.
|
||||
*/
|
||||
if (timr->it.alarm.interval < TICK_NSEC)
|
||||
timr->it.alarm.interval = TICK_NSEC;
|
||||
|
||||
exp = timespec64_to_ktime(new_setting->it_value);
|
||||
/* Convert (if necessary) to absolute time */
|
||||
if (flags != TIMER_ABSTIME) {
|
||||
ktime_t now;
|
||||
|
||||
now = alarm_bases[timr->it.alarm.alarmtimer.type].gettime();
|
||||
exp = ktime_add(now, exp);
|
||||
exp = ktime_add_safe(now, exp);
|
||||
}
|
||||
|
||||
alarm_start(&timr->it.alarm.alarmtimer, exp);
|
||||
|
@@ -825,8 +825,10 @@ static void check_thread_timers(struct task_struct *tsk,
|
||||
* At the hard limit, we just die.
|
||||
* No need to calculate anything else now.
|
||||
*/
|
||||
pr_info("CPU Watchdog Timeout (hard): %s[%d]\n",
|
||||
tsk->comm, task_pid_nr(tsk));
|
||||
if (print_fatal_signals) {
|
||||
pr_info("CPU Watchdog Timeout (hard): %s[%d]\n",
|
||||
tsk->comm, task_pid_nr(tsk));
|
||||
}
|
||||
__group_send_sig_info(SIGKILL, SEND_SIG_PRIV, tsk);
|
||||
return;
|
||||
}
|
||||
@@ -838,8 +840,10 @@ static void check_thread_timers(struct task_struct *tsk,
|
||||
soft += USEC_PER_SEC;
|
||||
sig->rlim[RLIMIT_RTTIME].rlim_cur = soft;
|
||||
}
|
||||
pr_info("RT Watchdog Timeout (soft): %s[%d]\n",
|
||||
tsk->comm, task_pid_nr(tsk));
|
||||
if (print_fatal_signals) {
|
||||
pr_info("RT Watchdog Timeout (soft): %s[%d]\n",
|
||||
tsk->comm, task_pid_nr(tsk));
|
||||
}
|
||||
__group_send_sig_info(SIGXCPU, SEND_SIG_PRIV, tsk);
|
||||
}
|
||||
}
|
||||
@@ -936,8 +940,10 @@ static void check_process_timers(struct task_struct *tsk,
|
||||
* At the hard limit, we just die.
|
||||
* No need to calculate anything else now.
|
||||
*/
|
||||
pr_info("RT Watchdog Timeout (hard): %s[%d]\n",
|
||||
tsk->comm, task_pid_nr(tsk));
|
||||
if (print_fatal_signals) {
|
||||
pr_info("RT Watchdog Timeout (hard): %s[%d]\n",
|
||||
tsk->comm, task_pid_nr(tsk));
|
||||
}
|
||||
__group_send_sig_info(SIGKILL, SEND_SIG_PRIV, tsk);
|
||||
return;
|
||||
}
|
||||
@@ -945,8 +951,10 @@ static void check_process_timers(struct task_struct *tsk,
|
||||
/*
|
||||
* At the soft limit, send a SIGXCPU every second.
|
||||
*/
|
||||
pr_info("CPU Watchdog Timeout (soft): %s[%d]\n",
|
||||
tsk->comm, task_pid_nr(tsk));
|
||||
if (print_fatal_signals) {
|
||||
pr_info("CPU Watchdog Timeout (soft): %s[%d]\n",
|
||||
tsk->comm, task_pid_nr(tsk));
|
||||
}
|
||||
__group_send_sig_info(SIGXCPU, SEND_SIG_PRIV, tsk);
|
||||
if (soft < hard) {
|
||||
soft++;
|
||||
|
Reference in New Issue
Block a user