Received: by 10.192.165.148 with SMTP id m20csp285464imm; Fri, 4 May 2018 10:16:07 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoWKBThawUsRa8bS8XeRLGsYasXuez5BxqesTAWmOQXI+6ABVcVBQc0t6NHx13SSdLRGlX2 X-Received: by 2002:a63:7344:: with SMTP id d4-v6mr22547189pgn.273.1525454167443; Fri, 04 May 2018 10:16:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525454167; cv=none; d=google.com; s=arc-20160816; b=H8szQ+GEqhy0gNNd7o+6kSQ46vsbEFeHPcg6/4chxbzoaon1UDbMyh6+D/cRUVfWpH YVpaZd4uf8fsjljrQ/lF8cR/w+iWLmwW0u9lsaRiF4P2wePRmHuUa2hF96aC4k/x1q4z bFOP/MIqT+7m/QEc1M62ijPAgiXoi1GS8Z16joHxVvmRPPseRuoBwvWUUxBTsh7soKPY TNPWscmsOneIwRLVajEFJFwIs0aB+zLOxov450+ETFeU3k60aeqVNLbUxtdulrLB21D0 5Z9F51VDePAUOVsRmNYCLuK7dAF2WJYmjfLDAjS2ietfvUe2Y/y9WUsGfoL+WKZUO4Yj 3LQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=eZ3SYPPFwc4wkiONDfs+Eiobro3RuKUP4cgH4j0XgVY=; b=NNRjFb0HIBNjKIQWC7ErOJBxzm9F9snqtCm3sohlyMWSc0C2vadlMMaWffZ7UY9Ora hc+yIVIUhEMdW2ZcjczYia26MyeaMmyf3wNyUsNVu46iR2P4s/LvflIrHfPtLW6jp2xU oWF1VadMD2jTcc4GmY2f7GEoDSnRb8yGWq6m5hj7bXakch6uOokD3cfzSx1IFXWWh1x6 6iVHly9rUtBuR+vHurTA4u/twqPAB/i0gbjpM7MOUewa47dWVuzi8D+Tlo+64gqR8+yV p7gZ+8R+HbMm//YOKujIVDO6j8h26680Y/7UBuOonqtG2ZT9dzrc0RLmleo0eH11P3rs ahhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=pLQ702xp; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v29-v6si14195096pgo.483.2018.05.04.10.15.52; Fri, 04 May 2018 10:16:07 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=pLQ702xp; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751822AbeEDRPY (ORCPT + 99 others); Fri, 4 May 2018 13:15:24 -0400 Received: from mail-io0-f180.google.com ([209.85.223.180]:41064 "EHLO mail-io0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751676AbeEDRPX (ORCPT ); Fri, 4 May 2018 13:15:23 -0400 Received: by mail-io0-f180.google.com with SMTP id e12-v6so26460489iob.8 for ; Fri, 04 May 2018 10:15:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eZ3SYPPFwc4wkiONDfs+Eiobro3RuKUP4cgH4j0XgVY=; b=pLQ702xpMgcKAH7pE+dtWI2XEHSvqEW37iEN4qEVrYSbP5RKRoEt8ocHlVa3kPtgDe AYSYrLmB0ONA6YLsPU1ElFmoteZ6eWqrQ2bbft9oYtn6bNAwvSb+Jf9Gzl1xPIOjzCem jNlLE24Hu8XQSwNIs4FZ+GhqQPf5dGYirU6pvtqlTjSvYUZfOKhsNPGCIx6/wkSmFaXG a7+LFN3x2vB1FSDPr9ql3MRstf3RvAS5BtexiHMqVp2I66rcyA59DhtR9JzXlnu32X6O RAc8hSLVBee3ayNpfeZ1u3BzYIjB72LWZyogrkxgXxSO56hhfm32z2VNPI0MxnZilvXW iUhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eZ3SYPPFwc4wkiONDfs+Eiobro3RuKUP4cgH4j0XgVY=; b=itRIfGYk2CiO6qavOkeEOXx3Eoap/uFP63bKPsCCTxZz7oYkliUSJJNcyMMasRtwsC Rbj2SbXxHutEEe+GJ5p3KdghSs+fWU120cBJK94JAZoWzdm84ky7hIQErGVWVBREEJm3 gw9MGVDX8hpCP4dkRVdxG1p2Ndc18cWFO6EXMdwd6p6w7181FNgUuKNcLQiKN8ig4OaI IdDuzD+w5tCb5hOvTbGjwJpoq53mB2Z9pcTrRoeEGVYUa2aEWOz9ThzTA+K+H8Xk6EpW /Xi0fyiT5lZ0zufHEs5mlsxEu45HXcaDJp00Ov/mow/MKfxYC6P6t1hRMDNZipjMUi9E DgjQ== X-Gm-Message-State: ALQs6tAN2sW4hZm6VtMWi58vQmiK2JXLw4Cydf3SKBydHREbQwtF1Glt uxyk+BySv4dCz6RtOMQEqclMOiha8dCWLAVEnznVRQ== X-Received: by 2002:a6b:be01:: with SMTP id o1-v6mr29220591iof.299.1525454122140; Fri, 04 May 2018 10:15:22 -0700 (PDT) MIME-Version: 1.0 References: <20180504123050.2841f80d@gandalf.local.home> In-Reply-To: <20180504123050.2841f80d@gandalf.local.home> From: Joel Fernandes Date: Fri, 04 May 2018 17:15:11 +0000 Message-ID: Subject: Re: rcu-bh design To: Steven Rostedt Cc: Paul McKenney , Mathieu Desnoyers , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > > 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. thanks, - Joel