From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751618AbdJLSZB (ORCPT ); Thu, 12 Oct 2017 14:25:01 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:58122 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750722AbdJLSY7 (ORCPT ); Thu, 12 Oct 2017 14:24:59 -0400 Date: Thu, 12 Oct 2017 11:24:54 -0700 From: "Paul E. McKenney" To: Sebastian Andrzej Siewior Cc: Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] srcu: queue work without holding the lock Reply-To: paulmck@linux.vnet.ibm.com References: <20170922152806.22860-1-bigeasy@linutronix.de> <20170922152806.22860-2-bigeasy@linutronix.de> <20170922184610.GT3521@linux.vnet.ibm.com> <20170928160357.anfyrkwq32tyamez@linutronix.de> <20170929011046.GW3521@linux.vnet.ibm.com> <20171010214313.GA19221@linux.vnet.ibm.com> <20171012085334.slen6jkovswhxbt7@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171012085334.slen6jkovswhxbt7@linutronix.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 17101218-0024-0000-0000-000002E2134B X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007886; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000236; SDB=6.00930178; UDB=6.00468231; IPR=6.00710445; BA=6.00005635; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017510; XFM=3.00000015; UTC=2017-10-12 18:24:56 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17101218-0025-0000-0000-000045B5CD6C Message-Id: <20171012182454.GG3521@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-12_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710120264 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 12, 2017 at 10:53:35AM +0200, Sebastian Andrzej Siewior wrote: > On 2017-10-10 14:43:13 [-0700], Paul E. McKenney wrote: > > diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c > > index 6d5880089ff6..558f9e7b283e 100644 > > --- a/kernel/rcu/srcutree.c > > +++ b/kernel/rcu/srcutree.c > > @@ -830,7 +866,7 @@ void __call_srcu(struct srcu_struct *sp, struct rcu_head *rhp, > > rhp->func = func; > > local_irq_save(flags); > > sdp = this_cpu_ptr(sp->sda); > > - raw_spin_lock_rcu_node(sdp); > > + spin_lock_rcu_node(sdp); > > This and the same thing in srcu_might_be_idle() does not work because > local_irq_save() + spin_lock() != spin_lock_irqsave() > but > local_irq_save() + raw_spinlock = raw_spin_lock_irqsave() > > I think that preempt_disable() for a stable this_cpu_ptr() is enough > here. I replaced local_irq_save() with local_lock_irqsave() on RT which > provides a per-CPU spinlock (for mutual exclusion) and disables > interrupts in !RT mode. > > I've been testing this for a while and it seems to work. Thank you. So I keep mainline as is, and the local_irq_save()-to-local_lock_irqsave() conversion happens in -rt, given that mainline doesn't have a local_lock_irqsave(), correct? And just so you know, there is one patchset adding call_srcu() that I am following up on. Looks to me like it is OK with this change, but if not, well, back to the drawing board... :-/ Thanx, Paul > > rcu_segcblist_enqueue(&sdp->srcu_cblist, rhp, false); > > rcu_segcblist_advance(&sdp->srcu_cblist, > > rcu_seq_current(&sp->srcu_gp_seq)); > > > Sebastian >