Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751398AbbD2SZQ (ORCPT ); Wed, 29 Apr 2015 14:25:16 -0400 Received: from g9t5008.houston.hp.com ([15.240.92.66]:54009 "EHLO g9t5008.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751149AbbD2SZP (ORCPT ); Wed, 29 Apr 2015 14:25:15 -0400 Message-ID: <1430331905.8722.16.camel@j-VirtualBox> Subject: Re: [PATCH v2 1/5] sched, timer: Remove usages of ACCESS_ONCE in the scheduler From: Jason Low To: Steven Rostedt Cc: Waiman Long , 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 , Preeti U Murthy , Mike Galbraith , Davidlohr Bueso , Aswin Chandramouleeswaran , Scott J Norton , jason.low2@hp.com Date: Wed, 29 Apr 2015 11:25:05 -0700 In-Reply-To: <20150429131532.15443d08@gandalf.local.home> References: <1430251224-5764-1-git-send-email-jason.low2@hp.com> <1430251224-5764-2-git-send-email-jason.low2@hp.com> <55410F73.5000807@hp.com> <20150429131532.15443d08@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: 1414 Lines: 41 On Wed, 2015-04-29 at 13:15 -0400, Steven Rostedt wrote: > On Wed, 29 Apr 2015 13:05:55 -0400 > Waiman Long wrote: > > > > 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 > > > > I agree, but I believe this code needs to be updated anyway. Making it > uglier may encourage that to happen. Yep, in this case, the ACCESS_ONCE conversion on numa_scan_seq technically isn't necessary, but I think the best option is to consistently update all of them, which makes things clearer than using multiple sets of APIs. Thanks, Jason -- 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/