aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/posix-cpu-timers.c
diff options
context:
space:
mode:
authorJason Low <jason.low2@hp.com>2015-04-28 16:00:20 -0400
committerIngo Molnar <mingo@kernel.org>2015-05-08 06:11:32 -0400
commit316c1608d15c736439d4065ed12f306db554b3da (patch)
tree4e1e807cc34bde294e5e15108a1b64f05e5b15fd /kernel/time/posix-cpu-timers.c
parentce2f5fe46303d1e1a2ba453753a7e8200d32182c (diff)
sched, timer: Convert usages of ACCESS_ONCE() in the scheduler to READ_ONCE()/WRITE_ONCE()
ACCESS_ONCE doesn't work reliably on non-scalar types. This patch removes the rest of the existing usages of ACCESS_ONCE() in the scheduler, and use the new READ_ONCE() and WRITE_ONCE() APIs as appropriate. Signed-off-by: Jason Low <jason.low2@hp.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Rik van Riel <riel@redhat.com> Acked-by: Waiman Long <Waiman.Long@hp.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Aswin Chandramouleeswaran <aswin@hp.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Davidlohr Bueso <dave@stgolabs.net> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Mike Galbraith <umgwanakikbuti@gmail.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com> Cc: Scott J Norton <scott.norton@hp.com> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1430251224-5764-2-git-send-email-jason.low2@hp.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/time/posix-cpu-timers.c')
-rw-r--r--kernel/time/posix-cpu-timers.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
index 0075da74abf0..e072d982f64c 100644
--- a/kernel/time/posix-cpu-timers.c
+++ b/kernel/time/posix-cpu-timers.c
@@ -852,10 +852,10 @@ static void check_thread_timers(struct task_struct *tsk,
852 /* 852 /*
853 * Check for the special case thread timers. 853 * Check for the special case thread timers.
854 */ 854 */
855 soft = ACCESS_ONCE(sig->rlim[RLIMIT_RTTIME].rlim_cur); 855 soft = READ_ONCE(sig->rlim[RLIMIT_RTTIME].rlim_cur);
856 if (soft != RLIM_INFINITY) { 856 if (soft != RLIM_INFINITY) {
857 unsigned long hard = 857 unsigned long hard =
858 ACCESS_ONCE(sig->rlim[RLIMIT_RTTIME].rlim_max); 858 READ_ONCE(sig->rlim[RLIMIT_RTTIME].rlim_max);
859 859
860 if (hard != RLIM_INFINITY && 860 if (hard != RLIM_INFINITY &&
861 tsk->rt.timeout > DIV_ROUND_UP(hard, USEC_PER_SEC/HZ)) { 861 tsk->rt.timeout > DIV_ROUND_UP(hard, USEC_PER_SEC/HZ)) {
@@ -958,11 +958,11 @@ static void check_process_timers(struct task_struct *tsk,
958 SIGPROF); 958 SIGPROF);
959 check_cpu_itimer(tsk, &sig->it[CPUCLOCK_VIRT], &virt_expires, utime, 959 check_cpu_itimer(tsk, &sig->it[CPUCLOCK_VIRT], &virt_expires, utime,
960 SIGVTALRM); 960 SIGVTALRM);
961 soft = ACCESS_ONCE(sig->rlim[RLIMIT_CPU].rlim_cur); 961 soft = READ_ONCE(sig->rlim[RLIMIT_CPU].rlim_cur);
962 if (soft != RLIM_INFINITY) { 962 if (soft != RLIM_INFINITY) {
963 unsigned long psecs = cputime_to_secs(ptime); 963 unsigned long psecs = cputime_to_secs(ptime);
964 unsigned long hard = 964 unsigned long hard =
965 ACCESS_ONCE(sig->rlim[RLIMIT_CPU].rlim_max); 965 READ_ONCE(sig->rlim[RLIMIT_CPU].rlim_max);
966 cputime_t x; 966 cputime_t x;
967 if (psecs >= hard) { 967 if (psecs >= hard) {
968 /* 968 /*