Received: by 10.192.165.148 with SMTP id m20csp371631imm; Fri, 4 May 2018 11:35:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZquQHti2Mdn0cghuOMzuIaxoDwEuSkmdE5h7P+1DGmX3u6mZ4Jryb4I5A4wsw+pYvNYyKGo X-Received: by 2002:a63:56:: with SMTP id 83-v6mr22543450pga.29.1525458919009; Fri, 04 May 2018 11:35:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525458918; cv=none; d=google.com; s=arc-20160816; b=JrVtJ2KsExLea/DLV0m7DlcHedrs6UzLCvN7bm7pXoGC+025ARCGt6cnjnm8lqKq1B FdQPuXH2CbgE5XYrcXtNIxzvOZ+6c3wKtpUONQfpi/VIjU+6pqlPlpvl9QnRQS/UQDRG NLLB8/UwDkde34qUxIPF6UoMYEo/ZcsxwCNwJ6WbOMxLNQTyb9poIBBjGwqT4F15+kMi AwPcMSS92tjGG/OVaT7HAmiFgUNRvUa3lJlBCVVBKLdKcR+jB/lJqFKkfoazG1Vt4A4k GZIDR9JI7BiFJrzwnLfxdjoAJNb3iXX6XduFwZRhqDnXEx3xGervlYreUJDxU5a0VWAx o6WQ== 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=4VvelBK3/BV2YWadUVlHaZDvGAL48dg8iI340/WaX+U=; b=gH16WU6wBjvvPMU8n/Hf1GE4BYHkacIAJGY2jeK30ysrBAUirXNeTtjL8LZH5P6pfR ah84FhybHrnpMhUJ9OPbnWGy9iWmzOANjpUtmstrHesBULHm4YI0j6uY2TwuUnPjkvsT caTqm2Rx3G+twyvSR+866OKSkdbcKalne6jX7cTie9w8DwA5sI1jVAAEczJCpmENYMB8 dEL/aNguT+O8QC0a3E5WkI5y/A3b1TGSy2pJKIRo174EnvovyQ6C6VQKOsYW3R6TOYDd U90mqoXTeUADUAdxb3HSoZ5yH0hJ+PyMZfZZ8T8iMWAXmyrZW9HPDuCiGvCx6nUgPA/4 T7XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=QuLp/1d/; 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 r11-v6si507074pgf.666.2018.05.04.11.35.04; Fri, 04 May 2018 11:35:18 -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=QuLp/1d/; 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 S1751822AbeEDSep (ORCPT + 99 others); Fri, 4 May 2018 14:34:45 -0400 Received: from mail-it0-f48.google.com ([209.85.214.48]:53478 "EHLO mail-it0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751507AbeEDSeo (ORCPT ); Fri, 4 May 2018 14:34:44 -0400 Received: by mail-it0-f48.google.com with SMTP id f65-v6so4487255itd.3 for ; Fri, 04 May 2018 11:34:44 -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=4VvelBK3/BV2YWadUVlHaZDvGAL48dg8iI340/WaX+U=; b=QuLp/1d/JHQqSogVkEx9UJNZnmGzpq4bTaWf/m4MvOI0DYl38c8xLlXgJn1fbrOBlb 0B9U1nNokPPWsOKJONVUiVYdTXFNkKuHzkvOZNH9pc2WCwT+w49Etb2/Oeq3Rnkctf4X jx+pKLk+aYzgbMaRnov5bt8SznUYgwWFwFGXs3oXP0nr494U4Kb9h+5M+2Wb03+hgOam OLtWUom2tJpDWFlsfebtVcJPbu7ZslM59btQIM+qnoYpzhCNAfMWYDEtsRt3WiRFY3+5 uqSiasifWhvHbal+uS5A6kbhSguM0GeVnb3Vx6hMjqaPwD4lYBtEuwic4lcwn13dzOym RmSA== 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=4VvelBK3/BV2YWadUVlHaZDvGAL48dg8iI340/WaX+U=; b=Z94I72JFL3elSowVfg6IJrpveJUHzFiX1ev9zL+AO9OX3dgrMVNqJ7h4mOTysBYt9g iwPbtKLk+mUu27l90pB7uZMY22tGe71/RQNfE/ZPEwZknLKs7x7sepXdhW65OZWRCKXM G0XE4usilpLdmpahvi5BnmFbpDdrjgNODjozEdK88G8Ecg2qjWtXhmXwyBLcTXXAGwar GUvJlpAQpFwQ5SBfUHDPpRbuS8RcIxR87k5JrFPiX3dNxl+fwhCQarShQGECYqhgwwRx WIZb8kOX5VmVnYsUl0ADkb0W3GuoP7GAhcOR2H/tCkHG0D0qDxbiwL0G07ny0khuBfUP H9Jw== X-Gm-Message-State: ALQs6tCfO+LLbrSMPttlXcY6SKDQnbSl/KrrN7TzCwp328IAP+QagDPn cvvC6DN4aQFySpreTFgaxB4REboIr0IUW8ch+NiKAQ== X-Received: by 2002:a24:5783:: with SMTP id u125-v6mr23837369ita.126.1525458883575; Fri, 04 May 2018 11:34:43 -0700 (PDT) MIME-Version: 1.0 References: <20180504123050.2841f80d@gandalf.local.home> <20180504174330.GS26088@linux.vnet.ibm.com> In-Reply-To: <20180504174330.GS26088@linux.vnet.ibm.com> From: Joel Fernandes Date: Fri, 04 May 2018 18:34:32 +0000 Message-ID: Subject: Re: rcu-bh design To: Paul McKenney Cc: Steven Rostedt , 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 On Fri, May 4, 2018 at 10:42 AM Paul E. McKenney wrote: [...] > > > > 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. Yes I understand priority boosting is needed with preemptible RCU so that read-sections are making forward progress. I meant (and correct me if I'm wrong) that, as long as a task doesn't sleep in a preemptible RCU read-section (rcu-preempt flavor), then bad things wont happen and RCU will work correctly. > > > > 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. ;-) But what prevents DoS'ing of RCU-preempt? That means all RCU-preempt uses in the kernel are susceptible to DoS'ing as well? Isn't the issue the heavy softirq processing itself which can also lead to other issues such as scheduling issues (other than the OOM) so probably that should be fixed instead of RCU? thanks, - Joel