Received: by 10.192.165.148 with SMTP id m20csp300801imm; Fri, 4 May 2018 10:31:23 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrKsdkEglITHf3hnRgEKV0FZYk4MBhYjvEiis6r/jeCy0/yj0gnLr+dzha2xhGnKf1cbI09 X-Received: by 2002:a63:85c1:: with SMTP id u184-v6mr23384002pgd.442.1525455083856; Fri, 04 May 2018 10:31:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525455083; cv=none; d=google.com; s=arc-20160816; b=imXlHGqvDRS+HnI6wxTxv4q48cnb+YBTLf7eggcOHv6nOY8IRhK68XgZK97rMjBNhD N9pFIiMfsDYkNt0K7Tns1m4u1JIakCgtRpqfAtHyDWji5GkygpFFerrCzyi4BzYpTyOl krWChO8CLp5q/g8gl5sDVOpa7LLnJP2ZKXI70DgNpJAGAeIruROxQUGwbIExv45pksa6 yST4DvOx/AiNVkCSn9xcTfr5t3YREXaCQhB8Nwg2tUf9rjvRO9TPV7oiHxcPSgwGE7qA 81ikwdsEPhnZw++yRAwIPOdngK87ov/REahWDivYNjWI42S/ojG/f6b4YumITWQcsrNt VuSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date:arc-authentication-results; bh=gqzUsu2I9ti+FCAZ1SM/3VhatzPB8Sn+zK3ERPJT9kQ=; b=tBlSJI729fb0lyAL1fCI0ur7R6DijAVOiNaeCCqUb223n1GvTIiVwB8O6TVyYBg3Do mlbSFQgdEqfsdXN0dFTEspFIi4KiOBN3ynUF2WRoRE8zPRG2doXuqP9TpcfXfVABtZMx immcAsCToN0pDTWnAOfIBO7mNMwNc3trfGd8EEnBNpeSvNU+rAadt8HTXh+8upI/Tq/V 6P4/tcWexO0bcR0HTH6i24LRmNH0O/s9/WWpwDmwT/a6y7d6ZLdPd2Y/XnypIbuHzBpr NiVAvtGTJM/jvmySIO2RLCFGHC1OmgbeyoZvavlrYxWKp5Qu8oyWrb1R2i1U0PC7pcXs 0pCQ== 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 r24-v6si13967996pgu.402.2018.05.04.10.31.09; Fri, 04 May 2018 10:31:23 -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 S1751605AbeEDRau (ORCPT + 99 others); Fri, 4 May 2018 13:30:50 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:36566 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751464AbeEDRat (ORCPT ); Fri, 4 May 2018 13:30:49 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w44HUOPS053015 for ; Fri, 4 May 2018 13:30:49 -0400 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0a-001b2d01.pphosted.com with ESMTP id 2hruej1fuj-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 04 May 2018 13:30:48 -0400 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 4 May 2018 13:30:47 -0400 Received: from b01cxnp22034.gho.pok.ibm.com (9.57.198.24) by e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 4 May 2018 13:30:45 -0400 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 w44HUiRe52166754; Fri, 4 May 2018 17:30:44 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7888AB204D; Fri, 4 May 2018 14:32:44 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.108]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id 41184B2046; Fri, 4 May 2018 14:32:44 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 0BB9D16C0E9F; Fri, 4 May 2018 10:32:06 -0700 (PDT) Date: Fri, 4 May 2018 10:32:06 -0700 From: "Paul E. McKenney" To: Steven Rostedt Cc: Joel Fernandes , Mathieu Desnoyers , LKML Subject: Re: rcu-bh design Reply-To: paulmck@linux.vnet.ibm.com References: <20180504123050.2841f80d@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180504123050.2841f80d@gandalf.local.home> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18050417-0036-0000-0000-000002EF8D11 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008970; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000258; SDB=6.01027465; UDB=6.00524844; IPR=6.00806598; MB=3.00020930; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-04 17:30:46 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18050417-0037-0000-0000-00004437678D Message-Id: <20180504173205.GQ26088@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-04_06:,, 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 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805040160 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 04, 2018 at 12:30:50PM -0400, Steven Rostedt wrote: > On Fri, 04 May 2018 16:20:11 +0000 > Joel Fernandes wrote: > > > Hi Paul, everyone, > > > > I had some question(s) about rcu-bh design. > > I am trying to understand the reasoning or need of it. I see that rcu-bh > > will disable softirqs across read-side sections. But I am wondering why > > this is needed. __do_softirq already disables softirq when a softirq > > handler is running. The only reason I can see is, rcu-bh helps in > > situations where - a softirq interrupts a preemptible RCU read-section and > > prevents that read section from completing. But this problem would happen > > if anyone where to use rcu-preempt - then does rcu-preempt even make sense > > to use and shouldn't everyone be using rcu-bh? > > I thought rcu-bh uses softirqs as a quiescent state. Thus, blocking > softirqs from happening makes sense. I don't think an > rcu_read_lock_bh() makes sense in a softirq. Agreed, any place in the code where bottom halves are enabled is an RCU-bh quiescent state. > > The other usecase for rcu-bh seems to be if context-switch is used as a > > quiescent state, then softirq flood can prevent that from happening and > > cause rcu grace periods from completing. > > > But preemptible RCU *does not* use context-switch as a quiescent state. > > It doesn't? It does, but only sort of. A context switch really is always an RCU-preempt quiescent state from the perspective of the CPU. However, from the perspective of the task, context switch is a quiescent state only if the task is not in an RCU-preempt read-side critical section at the time. > > So in that case rcu-bh would make > > sense only in a configuration where we're not using preemptible-rcu at all > > and are getting flooded by softirqs. Is that the reason rcu-bh needs to > > exist? > > Maybe I'm confused by what you are asking. The existence and use of RCU-bh in no way degrades the preemptibility of RCU-preempt read-side critical sections. The reason is that RCU-bh and RCU-preempt are completely separate, represented by different rcu_state structure instances. Thanx, Paul