From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751499AbbGIOVb (ORCPT ); Thu, 9 Jul 2015 10:21:31 -0400 Received: from e37.co.us.ibm.com ([32.97.110.158]:45440 "EHLO e37.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751054AbbGIOVY (ORCPT ); Thu, 9 Jul 2015 10:21:24 -0400 X-Helo: d03dlp02.boulder.ibm.com X-MailFrom: paulmck@linux.vnet.ibm.com X-RcptTo: linux-kernel@vger.kernel.org Date: Thu, 9 Jul 2015 07:21:16 -0700 From: "Paul E. McKenney" To: Dan Carpenter Cc: Peter Zijlstra , linux-kernel@vger.kernel.org, mingo@kernel.org, laijs@cn.fujitsu.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, dvhart@linux.intel.com, fweisbec@gmail.com, oleg@redhat.com, bobby.prani@gmail.com Subject: Re: [PATCH RFC tip/core/rcu 05/14] rcu: Abstract sequence counting from synchronize_sched_expedited() Message-ID: <20150709142115.GZ3717@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20150630222530.GA12044@linux.vnet.ibm.com> <1435703154-14659-1-git-send-email-paulmck@linux.vnet.ibm.com> <1435703154-14659-5-git-send-email-paulmck@linux.vnet.ibm.com> <20150701102717.GT19282@twins.programming.kicks-ass.net> <20150701221804.GW3717@linux.vnet.ibm.com> <20150709083809.GA14145@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150709083809.GA14145@mwanda> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15070914-0025-0000-0000-00001507045D Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 09, 2015 at 11:42:49AM +0300, Dan Carpenter wrote: > On Wed, Jul 01, 2015 at 03:18:04PM -0700, Paul E. McKenney wrote: > > > > +/* Adjust sequence number for start of update-side operation. */ > > > > +static void rcu_seq_start(unsigned long *sp) > > > > +{ > > > > + WRITE_ONCE(*sp, *sp + 1); > > > > + smp_mb(); /* Ensure update-side operation after counter increment. */ > > > > + WARN_ON_ONCE(!(*sp & 0x1)); > > > > +} > > > > > > That wants to be an ACQUIRE, right? > > > > I cannot put the acquire in the WARN_ON_ONCE() because there > > are configurations where WARN_ON_ONCE() is compiled out. > > I think WARN_ON_ONCE() always evaulates the condition. You are maybe > thinking of VM_WARN_ON_ONCE(). Even if it happens to now, it is only a matter of time until the tinification people make it optional. > I'm on a different thread where we almost introduced a bug by using > VM_WARN_ONCE() instead of WARN_ONCE(). The VM_WARNING conditions had > long execute times so they are weird. New one on me! At first glance, they look like they map pretty directly, though. Thanx, Paul