aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/posix-cpu-timers.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/time/posix-cpu-timers.c')
-rw-r--r--kernel/time/posix-cpu-timers.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
index a3bd5dbe0dc4..8585ad6e472a 100644
--- a/kernel/time/posix-cpu-timers.c
+++ b/kernel/time/posix-cpu-timers.c
@@ -799,7 +799,6 @@ static void check_thread_timers(struct task_struct *tsk,
799 struct list_head *firing) 799 struct list_head *firing)
800{ 800{
801 struct list_head *timers = tsk->cpu_timers; 801 struct list_head *timers = tsk->cpu_timers;
802 struct signal_struct *const sig = tsk->signal;
803 struct task_cputime *tsk_expires = &tsk->cputime_expires; 802 struct task_cputime *tsk_expires = &tsk->cputime_expires;
804 u64 expires; 803 u64 expires;
805 unsigned long soft; 804 unsigned long soft;
@@ -823,10 +822,9 @@ static void check_thread_timers(struct task_struct *tsk,
823 /* 822 /*
824 * Check for the special case thread timers. 823 * Check for the special case thread timers.
825 */ 824 */
826 soft = READ_ONCE(sig->rlim[RLIMIT_RTTIME].rlim_cur); 825 soft = task_rlimit(tsk, RLIMIT_RTTIME);
827 if (soft != RLIM_INFINITY) { 826 if (soft != RLIM_INFINITY) {
828 unsigned long hard = 827 unsigned long hard = task_rlimit_max(tsk, RLIMIT_RTTIME);
829 READ_ONCE(sig->rlim[RLIMIT_RTTIME].rlim_max);
830 828
831 if (hard != RLIM_INFINITY && 829 if (hard != RLIM_INFINITY &&
832 tsk->rt.timeout > DIV_ROUND_UP(hard, USEC_PER_SEC/HZ)) { 830 tsk->rt.timeout > DIV_ROUND_UP(hard, USEC_PER_SEC/HZ)) {
@@ -847,7 +845,8 @@ static void check_thread_timers(struct task_struct *tsk,
847 */ 845 */
848 if (soft < hard) { 846 if (soft < hard) {
849 soft += USEC_PER_SEC; 847 soft += USEC_PER_SEC;
850 sig->rlim[RLIMIT_RTTIME].rlim_cur = soft; 848 tsk->signal->rlim[RLIMIT_RTTIME].rlim_cur =
849 soft;
851 } 850 }
852 if (print_fatal_signals) { 851 if (print_fatal_signals) {
853 pr_info("RT Watchdog Timeout (soft): %s[%d]\n", 852 pr_info("RT Watchdog Timeout (soft): %s[%d]\n",
@@ -938,11 +937,10 @@ static void check_process_timers(struct task_struct *tsk,
938 SIGPROF); 937 SIGPROF);
939 check_cpu_itimer(tsk, &sig->it[CPUCLOCK_VIRT], &virt_expires, utime, 938 check_cpu_itimer(tsk, &sig->it[CPUCLOCK_VIRT], &virt_expires, utime,
940 SIGVTALRM); 939 SIGVTALRM);
941 soft = READ_ONCE(sig->rlim[RLIMIT_CPU].rlim_cur); 940 soft = task_rlimit(tsk, RLIMIT_CPU);
942 if (soft != RLIM_INFINITY) { 941 if (soft != RLIM_INFINITY) {
943 unsigned long psecs = div_u64(ptime, NSEC_PER_SEC); 942 unsigned long psecs = div_u64(ptime, NSEC_PER_SEC);
944 unsigned long hard = 943 unsigned long hard = task_rlimit_max(tsk, RLIMIT_CPU);
945 READ_ONCE(sig->rlim[RLIMIT_CPU].rlim_max);
946 u64 x; 944 u64 x;
947 if (psecs >= hard) { 945 if (psecs >= hard) {
948 /* 946 /*