Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756349AbbDPC3V (ORCPT ); Wed, 15 Apr 2015 22:29:21 -0400 Received: from g9t5008.houston.hp.com ([15.240.92.66]:44996 "EHLO g9t5008.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751607AbbDPC3M (ORCPT ); Wed, 15 Apr 2015 22:29:12 -0400 Message-ID: <1429151341.7039.162.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: Wed, 15 Apr 2015 19:29:01 -0700 In-Reply-To: <20150414224059.061ec5bf@grimm.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> <1429063953.7039.88.camel@j-VirtualBox> <20150414224059.061ec5bf@grimm.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: 898 Lines: 25 On Tue, 2015-04-14 at 22:40 -0400, Steven Rostedt wrote: > You are correct. Now I'm thinking that the WRITE_ONCE() is not needed, > and just a: > > p->mm->numa_scan_seq = READ_ONCE(p->numa_scan_seq) + 1; Just to confirm, is this a typo? Because there really is a numa_scan_seq in the task_struct itself too :) p->mm->numa_scan_seq is read in task_numa_placement() with ACCESS_ONCE(), and so the benefit that I do see with it is that it makes it consistent by doing the updates with ACCESS_ONCE too (for documentation purposes). If that's really the case: WRITE_ONCE(p->mm->numa_scan_seq, p->mm->numa_scan_seq + 1) should be enough for that. -- 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/