Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp1869849ybh; Sun, 4 Aug 2019 11:44:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsEQzgOcgEqtVQ+4QtjOivfxlWGkZVMURQVdL6fgVisE4acpq2gxcjqqBDxNuxnbnNhCHP X-Received: by 2002:aa7:9191:: with SMTP id x17mr69689811pfa.23.1564944269318; Sun, 04 Aug 2019 11:44:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564944269; cv=none; d=google.com; s=arc-20160816; b=g43zku/yOXER2+AFG9kPY595CNHnit9KupXT2SP8bOa/ys2ddz2bhkxtW30Qt4HCFT sfzjadw6rinkk5gBX/yblIJpcFz1wxsy5DK04pqFcvQaTSJlgQN3N+WWMzWAhiHVzEHV KytHL5K99Ut4ORGoHPF9vKFE1xQsfmgdIQe0PAbjkfkmTakgaYh/umrfXdSZ4i+0bn43 8PvZ5xySjc+lchsXKU2mozo7ff7pmas17Yc04A9MyRKX3aIIr3fbjI4stzMwOkzXassz xgm9hWYCWrBvnKIOm5aAc+AJCQW+jrWmIfLfeTFTvJqjx7Q11FHIGo/jJ2RXKXglLBxd 5ijw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date; bh=GADTAANCRTZpr3SbPD+DMAKYtEdHbwFyWQfWGWpIppo=; b=A7mSS+gIEYmA/FUc8tYyXwBeFm+Yrj4HlM7QIziOJzgABSHAVrzq00sh5JNKdpNUoL FLwFOItpDAMOUvebpLMqtXV2Um+sw9U03rgNLmxn7YyNH85JsI/23Besmd/KcqKtxIVI Zk5OHAQug6klSOvifQwrsPnjCvDcMDCxdkcJmR97aW8SG68woA/d5cUSUTvoy89xxIJc DPl28SnkmrRzEFrvb5UsouOxSUcDqI7PRTeOK+OpI344o7lSUEIQ8ffgaJuZD0/ztS8z 4KjaPtgnwJw3BoaBp8b8F8hexbfEphh7kaO1CeRLGf3WOZiqZFgYjG/aGcghvJFeI6It px9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l9si47152516pgm.43.2019.08.04.11.44.13; Sun, 04 Aug 2019 11:44:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726659AbfHDSnc (ORCPT + 99 others); Sun, 4 Aug 2019 14:43:32 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:60918 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726392AbfHDSnb (ORCPT ); Sun, 4 Aug 2019 14:43:31 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x74IfhHa039061; Sun, 4 Aug 2019 14:42:47 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2u5qkywc2j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 04 Aug 2019 14:42:47 -0400 Received: from m0098394.ppops.net (m0098394.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x74Igijb046865; Sun, 4 Aug 2019 14:42:46 -0400 Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com with ESMTP id 2u5qkywc24-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 04 Aug 2019 14:42:46 -0400 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x74IeUet002393; Sun, 4 Aug 2019 18:42:45 GMT Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by ppma04wdc.us.ibm.com with ESMTP id 2u51w6914s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 04 Aug 2019 18:42:45 +0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x74Igi9752953506 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 4 Aug 2019 18:42:44 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8D3AEB2064; Sun, 4 Aug 2019 18:42:44 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6B053B205F; Sun, 4 Aug 2019 18:42:44 +0000 (GMT) Received: from paulmck-ThinkPad-W541 (unknown [9.85.150.228]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Sun, 4 Aug 2019 18:42:44 +0000 (GMT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id BADC116C9A4A; Sun, 4 Aug 2019 11:42:46 -0700 (PDT) Date: Sun, 4 Aug 2019 11:42:46 -0700 From: "Paul E. McKenney" To: Peter Zijlstra Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org, mingo@kernel.org, jiangshanlai@gmail.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, fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org Subject: Re: [PATCH RFC tip/core/rcu 01/14] rcu/nocb: Atomic ->len field in rcu_segcblist structure Message-ID: <20190804184246.GD28441@linux.ibm.com> Reply-To: paulmck@linux.ibm.com References: <20190802151435.GA1081@linux.ibm.com> <20190802151501.13069-1-paulmck@linux.ibm.com> <20190804145051.GG2349@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190804145051.GG2349@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-08-04_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908040217 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 04, 2019 at 04:50:51PM +0200, Peter Zijlstra wrote: > On Fri, Aug 02, 2019 at 08:14:48AM -0700, Paul E. McKenney wrote: > > +/* > > + * Exchange the numeric length of the specified rcu_segcblist structure > > + * with the specified value. This can cause the ->len field to disagree > > + * with the actual number of callbacks on the structure. This exchange is > > + * fully ordered with respect to the callers accesses both before and after. > > + */ > > +long rcu_segcblist_xchg_len(struct rcu_segcblist *rsclp, long v) > > +{ > > +#ifdef CONFIG_RCU_NOCB_CPU > > + return atomic_long_xchg(&rsclp->len, v); > > +#else > > + long ret = rsclp->len; > > + > > + smp_mb(); /* Up to the caller! */ > > + WRITE_ONCE(rsclp->len, v); > > + smp_mb(); /* Up to the caller! */ > > + return ret; > > +#endif > > +} > > That one's weird; for matching semantics the load needs to be between > the memory barriers. This is to match the concurrent version, which uses atomic_xchg(). Thanx, Paul