diff options
Diffstat (limited to 'kernel/posix-cpu-timers.c')
-rw-r--r-- | kernel/posix-cpu-timers.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c index dbb16bf15c45..1a22dfd42df9 100644 --- a/kernel/posix-cpu-timers.c +++ b/kernel/posix-cpu-timers.c | |||
@@ -1031,9 +1031,10 @@ static void check_thread_timers(struct task_struct *tsk, | |||
1031 | /* | 1031 | /* |
1032 | * Check for the special case thread timers. | 1032 | * Check for the special case thread timers. |
1033 | */ | 1033 | */ |
1034 | soft = sig->rlim[RLIMIT_RTTIME].rlim_cur; | 1034 | soft = ACCESS_ONCE(sig->rlim[RLIMIT_RTTIME].rlim_cur); |
1035 | if (soft != RLIM_INFINITY) { | 1035 | if (soft != RLIM_INFINITY) { |
1036 | unsigned long hard = sig->rlim[RLIMIT_RTTIME].rlim_max; | 1036 | unsigned long hard = |
1037 | ACCESS_ONCE(sig->rlim[RLIMIT_RTTIME].rlim_max); | ||
1037 | 1038 | ||
1038 | if (hard != RLIM_INFINITY && | 1039 | if (hard != RLIM_INFINITY && |
1039 | tsk->rt.timeout > DIV_ROUND_UP(hard, USEC_PER_SEC/HZ)) { | 1040 | tsk->rt.timeout > DIV_ROUND_UP(hard, USEC_PER_SEC/HZ)) { |
@@ -1194,10 +1195,11 @@ static void check_process_timers(struct task_struct *tsk, | |||
1194 | SIGPROF); | 1195 | SIGPROF); |
1195 | check_cpu_itimer(tsk, &sig->it[CPUCLOCK_VIRT], &virt_expires, utime, | 1196 | check_cpu_itimer(tsk, &sig->it[CPUCLOCK_VIRT], &virt_expires, utime, |
1196 | SIGVTALRM); | 1197 | SIGVTALRM); |
1197 | soft = sig->rlim[RLIMIT_CPU].rlim_cur; | 1198 | soft = ACCESS_ONCE(sig->rlim[RLIMIT_CPU].rlim_cur); |
1198 | if (soft != RLIM_INFINITY) { | 1199 | if (soft != RLIM_INFINITY) { |
1199 | unsigned long psecs = cputime_to_secs(ptime); | 1200 | unsigned long psecs = cputime_to_secs(ptime); |
1200 | unsigned long hard = sig->rlim[RLIMIT_CPU].rlim_max; | 1201 | unsigned long hard = |
1202 | ACCESS_ONCE(sig->rlim[RLIMIT_CPU].rlim_max); | ||
1201 | cputime_t x; | 1203 | cputime_t x; |
1202 | if (psecs >= hard) { | 1204 | if (psecs >= hard) { |
1203 | /* | 1205 | /* |