Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753866AbbD2RGF (ORCPT ); Wed, 29 Apr 2015 13:06:05 -0400 Received: from g4t3425.houston.hp.com ([15.201.208.53]:20560 "EHLO g4t3425.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753748AbbD2RGD (ORCPT ); Wed, 29 Apr 2015 13:06:03 -0400 Message-ID: <55410F73.5000807@hp.com> Date: Wed, 29 Apr 2015 13:05:55 -0400 From: Waiman Long User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130109 Thunderbird/10.0.12 MIME-Version: 1.0 To: Jason Low CC: Peter Zijlstra , Ingo Molnar , Thomas Gleixner , linux-kernel@vger.kernel.org, "Paul E. McKenney" , Andrew Morton , Oleg Nesterov , Frederic Weisbecker , Mel Gorman , Rik van Riel , Steven Rostedt , Preeti U Murthy , Mike Galbraith , Davidlohr Bueso , Aswin Chandramouleeswaran , Scott J Norton Subject: Re: [PATCH v2 1/5] sched, timer: Remove usages of ACCESS_ONCE in the scheduler References: <1430251224-5764-1-git-send-email-jason.low2@hp.com> <1430251224-5764-2-git-send-email-jason.low2@hp.com> In-Reply-To: <1430251224-5764-2-git-send-email-jason.low2@hp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1821 Lines: 50 On 04/28/2015 04:00 PM, Jason Low wrote: > 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. > > Signed-off-by: Jason Low > --- > include/linux/sched.h | 4 ++-- > kernel/fork.c | 2 +- > kernel/sched/auto_group.c | 2 +- > kernel/sched/auto_group.h | 2 +- > kernel/sched/core.c | 4 ++-- > kernel/sched/cputime.c | 2 +- > kernel/sched/deadline.c | 2 +- > kernel/sched/fair.c | 14 +++++++------- > kernel/sched/proc.c | 4 ++-- > kernel/sched/rt.c | 2 +- > kernel/sched/sched.h | 2 +- > kernel/sched/wait.c | 4 ++-- > kernel/time/posix-cpu-timers.c | 8 ++++---- > 13 files changed, 26 insertions(+), 26 deletions(-) > > ... > goto no_join; > @@ -2107,7 +2107,7 @@ void task_numa_fault(int last_cpupid, int mem_node, int pages, int flags) > > static void reset_ptenuma_scan(struct task_struct *p) > { > - ACCESS_ONCE(p->mm->numa_scan_seq)++; > + WRITE_ONCE(p->mm->numa_scan_seq, READ_ONCE(p->mm->numa_scan_seq) + 1); > p->mm->numa_scan_offset = 0; > } > > Generally, I am for replacing ACCESS_ONCE() with the more descriptive READ_ONCE() and WRITE_ONCE() except the above case where it makes the code harder to read without any real advantage. Other than that, Acked-by: Waiman Long Cheers, Longman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/