Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755898AbbDOCMq (ORCPT ); Tue, 14 Apr 2015 22:12:46 -0400 Received: from g4t3425.houston.hp.com ([15.201.208.53]:31909 "EHLO g4t3425.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755572AbbDOCMj (ORCPT ); Tue, 14 Apr 2015 22:12:39 -0400 Message-ID: <1429063953.7039.88.camel@j-VirtualBox> Subject: Re: [PATCH 1/3] sched, timer: Remove usages of ACCESS_ONCE in the scheduler From: Jason Low To: Steven Rostedt Cc: Linus Torvalds , Peter Zijlstra , Ingo Molnar , Thomas Gleixner , linux-kernel@vger.kernel.org, "Paul E. McKenney" , Andrew Morton , Oleg Nesterov , Mike Galbraith , Frederic Weisbecker , Mel Gorman , Preeti U Murthy , hideaki.kimura@hp.com, Aswin Chandramouleeswaran , Scott J Norton , jason.low2@hp.com Date: Tue, 14 Apr 2015 19:12:33 -0700 In-Reply-To: <20150414195906.3adc89d9@gandalf.local.home> References: <1429052986-9420-1-git-send-email-jason.low2@hp.com> <1429052986-9420-2-git-send-email-jason.low2@hp.com> <20150414195906.3adc89d9@gandalf.local.home> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 884 Lines: 25 Hi Steven, On Tue, 2015-04-14 at 19:59 -0400, Steven Rostedt wrote: > On Tue, 14 Apr 2015 16:09:44 -0700 > Jason Low wrote: > > > > @@ -2088,7 +2088,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); > > Is the READ_ONCE() inside the WRITE_ONCE() really necessary? Yeah, I think so to be safe, otherwise, the access of p->mm->numa_scan_seq in the 2nd parameter doesn't have the volatile cast. -- 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/