Received: by 10.192.165.148 with SMTP id m20csp314420imm; Fri, 4 May 2018 10:42:35 -0700 (PDT) X-Google-Smtp-Source: AB8JxZog8YTAgKNotgh/v1dIiN01e6kCn3fN558Az2us9E9SHMrmypzIdlY8xEC6UT9H79twhEEw X-Received: by 2002:a65:64d0:: with SMTP id t16-v6mr5456271pgv.9.1525455755293; Fri, 04 May 2018 10:42:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525455755; cv=none; d=google.com; s=arc-20160816; b=DIW5leAEMi7oMbLjxo8+ZbmEo5ZCbfVNocXVuy7Lgiqx07UjUJekvL/DqJ8/tYWX6k GLJJNzHAmDfDQM+58Z9wXWa94+JM/vqLzJyXg7PQt+8/GCH+5euuglaWWm5Z0kRFiR2f vChX/cSa90Z+krJVbBoGBUioS3rEguYvBlJ5QCaMZtSCV9je7Q8/JeZ6zScnffQStRUu ZkxhaAYedx2I2iT/rxSk0XpAYzBAKDtZPiDKDd5fzQD0zT8yVVS300wCF+TGD26XnCFE Hqv8VoVJxrt/T47LF0jCvACB247gsQdmqXkztRdamrxC2LA+Wfr6Uqib9F1vI8kZUQNy dsVg== 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=CHmPIjQDLfO91T3XQiMmYhw6qluHfAx4q3QlO660wMI=; b=A2o5i9v5ixhDaM5k4TjPNOT3vD/CX3W9T4jmZ8whp8AwwqUgyaz9QbdFj52dGt0x1C /xGCJXAUEUhQeILS2Q8uAQNHuIsJhbUCL3fsnsODjjbwO+njudMyMgmr7iM5wGMuriLJ MlMj0Jc3ZvdaOyHp7r83sy4MJz4sRsUEY5njaww3BeM6J8Qv0WDX+4/XsKUkp/Mr7/pK azMMF8mz44I+Ew1kJT3KqPTRJVGDjEe48ZzJMOS4EEgr59noT5D59HMe+Nszg+zXZcBF oJ5SUZnri8wdHW+Uy2WI+IGsh9reXIB+zDVp+PpVvscaftT49FPTtKTNb+pdh/a8syle DYeg== 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 j7si15561475pfh.3.2018.05.04.10.42.21; Fri, 04 May 2018 10:42:35 -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 S1751753AbeEDRmN (ORCPT + 99 others); Fri, 4 May 2018 13:42:13 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:57662 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751501AbeEDRmM (ORCPT ); Fri, 4 May 2018 13:42:12 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w44He7dT128982 for ; Fri, 4 May 2018 13:42:11 -0400 Received: from e11.ny.us.ibm.com (e11.ny.us.ibm.com [129.33.205.201]) by mx0b-001b2d01.pphosted.com with ESMTP id 2hrs65ysu2-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 04 May 2018 13:42:11 -0400 Received: from localhost by e11.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 4 May 2018 13:42:10 -0400 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e11.ny.us.ibm.com (146.89.104.198) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 4 May 2018 13:42:08 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w44Hg8tp54919260; Fri, 4 May 2018 17:42:08 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 059A4B204E; Fri, 4 May 2018 14:44:08 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.108]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id A50D6B204D; Fri, 4 May 2018 14:44:07 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 73BC316C0E9F; Fri, 4 May 2018 10:43:30 -0700 (PDT) Date: Fri, 4 May 2018 10:43:30 -0700 From: "Paul E. McKenney" To: Joel Fernandes Cc: Steven Rostedt , 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: User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18050417-2213-0000-0000-0000029F3095 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.01027468; UDB=6.00524846; IPR=6.00806602; MB=3.00020930; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-04 17:42:10 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18050417-2214-0000-0000-000059FF0F69 Message-Id: <20180504174330.GS26088@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-04_07:,, 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-1805040161 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 05:15:11PM +0000, Joel Fernandes wrote: > Hi Steven, > Just for a warning/disclaimer, I am new to RCU-land and trying to make > sense ;-) So forgive me if something sounds too outlandish. > > On Fri, May 4, 2018 at 9:30 AM 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. > > Ok. > > > > 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? > > I thought that's what preemptible rcu is about. You can get preempted but > you shouldn't block in a read-section. Is that not true? Almost. All context switches in an RCU-preempt read-side critical section must be subject to priority boosting. Preemption is one example, because boosting the priority of the preempted task will make it runnable. The priority-inheritance -rt "spinlock" is another example, because boosting the priority of the task holding the lock will eventually make runnable the task acquiring the lock within the RCU-preempt read-side critical section. > > > 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. > > Sorry for any confusion. I was going through the below link for motivation > of rcu-bh and why it was created: > https://www.kernel.org/doc/Documentation/RCU/Design/Requirements/Requirements.html#Bottom-Half%20Flavor > > I was asking why rcu-bh is needed in the kernel, like why can't we just use > rcu-preempt. As per above link, the motivation of rcu-bh was to prevent > denial of service during heavy softirq load. I was trying to understand > that usecase. In my mind, such denial of service / out of memory is then > even possible with preemptible rcu which is used in many places in the > kernel, then why not just use rcu-bh for everything? I was just studying > this RCU flavor (and all other RCU flavors) and so this question popped up. Because RCU-bh is not preemptible. And the non-DoS nature of RCU-bh is one challenge in my current quest to fold all three flavors (RCU-bh, RCU-preempt, and RCU-sched) into one flavor to rule them all. ;-) Thanx, Paul