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>
This commit is contained in:
@@ -852,10 +852,10 @@ static void check_thread_timers(struct task_struct *tsk,
|
||||
/*
|
||||
* Check for the special case thread timers.
|
||||
*/
|
||||
soft = ACCESS_ONCE(sig->rlim[RLIMIT_RTTIME].rlim_cur);
|
||||
soft = READ_ONCE(sig->rlim[RLIMIT_RTTIME].rlim_cur);
|
||||
if (soft != RLIM_INFINITY) {
|
||||
unsigned long hard =
|
||||
ACCESS_ONCE(sig->rlim[RLIMIT_RTTIME].rlim_max);
|
||||
READ_ONCE(sig->rlim[RLIMIT_RTTIME].rlim_max);
|
||||
|
||||
if (hard != RLIM_INFINITY &&
|
||||
tsk->rt.timeout > DIV_ROUND_UP(hard, USEC_PER_SEC/HZ)) {
|
||||
@@ -958,11 +958,11 @@ static void check_process_timers(struct task_struct *tsk,
|
||||
SIGPROF);
|
||||
check_cpu_itimer(tsk, &sig->it[CPUCLOCK_VIRT], &virt_expires, utime,
|
||||
SIGVTALRM);
|
||||
soft = ACCESS_ONCE(sig->rlim[RLIMIT_CPU].rlim_cur);
|
||||
soft = READ_ONCE(sig->rlim[RLIMIT_CPU].rlim_cur);
|
||||
if (soft != RLIM_INFINITY) {
|
||||
unsigned long psecs = cputime_to_secs(ptime);
|
||||
unsigned long hard =
|
||||
ACCESS_ONCE(sig->rlim[RLIMIT_CPU].rlim_max);
|
||||
READ_ONCE(sig->rlim[RLIMIT_CPU].rlim_max);
|
||||
cputime_t x;
|
||||
if (psecs >= hard) {
|
||||
/*
|
||||
|
Reference in New Issue
Block a user