From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753373AbbFLHIj (ORCPT ); Fri, 12 Jun 2015 03:08:39 -0400 Received: from casper.infradead.org ([85.118.1.10]:46629 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753228AbbFLHIf convert rfc822-to-8bit (ORCPT ); Fri, 12 Jun 2015 03:08:35 -0400 Date: Fri, 12 Jun 2015 09:08:27 +0200 From: Peter Zijlstra To: "Paul E. McKenney" Cc: umgwanakikbuti@gmail.com, mingo@elte.hu, ktkhai@parallels.com, rostedt@goodmis.org, tglx@linutronix.de, juri.lelli@gmail.com, pang.xunlei@linaro.org, oleg@redhat.com, wanpeng.li@linux.intel.com, linux-kernel@vger.kernel.org, Al Viro , Linus Torvalds Subject: Re: [PATCH 11/18] seqcount: Introduce raw_write_seqcount_barrier() Message-ID: <20150612070827.GN3644@twins.programming.kicks-ass.net> References: <20150611124636.448700267@infradead.org> <20150611124743.374180021@infradead.org> <20150611153341.GK3913@linux.vnet.ibm.com> <20150611214557.GA4249@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <20150611214557.GA4249@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 11, 2015 at 02:45:57PM -0700, Paul E. McKenney wrote: > Color me slow and stupid. Maybe due to reviewing a patch too early in > the morning, who knows? > > There is nothing above that prevents the compiler and the CPU from > reordering the assignments to X and Y with the increment of s->sequence++. That's actually fine. As long as we observe an odd value the read side will repeat. > Of course, this assumes that the accesses surrounding the call to > raw_write_seqcount_barrier() are writes. Which is why its got both write and barrier in the name :-)