Received: by 2002:a05:6a10:87d6:0:0:0:0 with SMTP id g22csp1147053pxr; Mon, 11 Apr 2022 16:40:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlKwlwP36FSMVaWW23PWKsvDQ4a5P7eB3qTHCId4h3vuN8rgggzoz8JYJgDC+vYxcc2Hiy X-Received: by 2002:a17:906:c344:b0:6b4:c768:4a9a with SMTP id ci4-20020a170906c34400b006b4c7684a9amr32539499ejb.151.1649720417085; Mon, 11 Apr 2022 16:40:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649720417; cv=none; d=google.com; s=arc-20160816; b=Dh48qwy/0JwYxA2lVHz9xI2cpRpyvk/P/dD+Y3eTHKbLzbZzisJA0Dp7iJkiERJL6Y ANhgXY5t1G3HlCRf4ILCe5dhrjlizGo8LFWqeWQXvXMqCnS9a9gcuG8pfylKKmMpcnh4 76YIHsqGERGjOq1drzrMaNCqvRYcrGJ0U4tyN6Fq0yiBxVLSHF6tDgDBFsvZtvynmyiH ozO0qiOiS0x25E5o0cnosepdUjeoxZyPjA6UTc/wkl/3uN7UBFzBJn1gRdHWdTzHKQCL uUdaVOZqSREpz2Y63kXORcg6n2Hbmjf+D82vBIXgWOGX7Ksc4klDqxVm3g8f3eWtkl3z W+sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=RYwXnig9f21Chdat6SF+WPZVd4H+/rQmk5ghVe03Nnc=; b=vjXNPUpI5Z/+XKDD1l+BR8UEu6vl1L0ZtBpf8lhWYbUh6PuKu/okjZ2DeuMl3ktjfF Rxa/rkhqOVYle2eYYiFMTEd2yD8mzBpJf2YlDvOki4D0JikSA0MS4W6MZPNyuCzPsPeU KV+iI3fAlprq4U4fU3KSLEgjCXuxyap2/D7nJSi9tBQnvE40QPp7Qi6TsN0Dz1EjJ+3R AQRMc1JmI8+B0VrL5QKYHyRKlniYzdxV2sSuaUw4Hhc34IbiRcitl4ieDNbkAaSwj11i GKEWcOl8lXe6e3fIT7Q4XC61bNAYG/mrueR3zfriwEFDbJnMR9y1NJrFrRFwAKObah+j /HFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=h0dxrAmJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bm6-20020a170906c04600b006e89a8e30d0si2296169ejb.252.2022.04.11.16.39.52; Mon, 11 Apr 2022 16:40:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=h0dxrAmJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237613AbiDHSYr (ORCPT + 99 others); Fri, 8 Apr 2022 14:24:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238561AbiDHSYj (ORCPT ); Fri, 8 Apr 2022 14:24:39 -0400 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DE923767C2 for ; Fri, 8 Apr 2022 11:22:35 -0700 (PDT) Received: by mail-io1-xd2a.google.com with SMTP id g21so11571160iom.13 for ; Fri, 08 Apr 2022 11:22:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RYwXnig9f21Chdat6SF+WPZVd4H+/rQmk5ghVe03Nnc=; b=h0dxrAmJeLpuLhuCdZMXB9uBDxr79JzYzqk41IZ3Cees0HePkzfq7y61ayTKYZ4Kp0 stXuxDVzJwTGmgi1Py3QiOg/Wo/l5wAxlJPBwlvu8vRzkDPo7CnCEcWnv+OWUJwXSxsT 670r3vFrfqToyuEk94z29hg+JrtVflXzwY7A0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RYwXnig9f21Chdat6SF+WPZVd4H+/rQmk5ghVe03Nnc=; b=Yleuw+orI3PxwYePvtBUCFuylF1npzu9oMBborFaNmbMprprJ1IuZCz79MJaICqoJq kwhxqDmG95SvrnPhw2sDpcgvvH1B1im6F6aaFmc7MjP2iiFSmaorQkxBiuMVfOnUN9lI GXJLwEnfiEqwEpHpmVd+1UNzuKgCqh3fkcai+3ylzocXT2qULCCmARfAU2vSIu6e059u jhf0T+6XhKL2B/9QvBC7rHTD+lzFRT+8f8TUGGaAQ+Ho/K5bOE/mNO2H4DdbJ9D6bfaW wvxUZyAuLzsSUNPW7cbC676tyiFrweVQl89QFH0OckPQcOYpI0hnJLKIPmDRD2XuxadH 4K8A== X-Gm-Message-State: AOAM531f5ON678HkEV7dUJ+MXrjDClDgcbnZp5uavjFdi40XbNIURQuu 8Tc5PLt3mDzJT1ru4f4SgqfxcK7WfzpzGKaOkfFmnAkZJ7g= X-Received: by 2002:a5d:8450:0:b0:64c:cc87:c5fc with SMTP id w16-20020a5d8450000000b0064ccc87c5fcmr8769758ior.190.1649442154606; Fri, 08 Apr 2022 11:22:34 -0700 (PDT) MIME-Version: 1.0 References: <20220407210734.2548973-1-joel@joelfernandes.org> <20220408142232.GA4285@paulmck-ThinkPad-P17-Gen-1> <20220408155002.GF4285@paulmck-ThinkPad-P17-Gen-1> <20220408174908.GK4285@paulmck-ThinkPad-P17-Gen-1> In-Reply-To: <20220408174908.GK4285@paulmck-ThinkPad-P17-Gen-1> From: Joel Fernandes Date: Fri, 8 Apr 2022 14:22:22 -0400 Message-ID: Subject: Re: [PATCH RFC] rcu/nocb: Provide default all-CPUs mask for RCU_NOCB_CPU=y To: "Paul E. McKenney" Cc: LKML , Josh Triplett , Lai Jiangshan , Mathieu Desnoyers , rcu , Steven Rostedt Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 8, 2022 at 1:49 PM Paul E. McKenney wrote: > > On Fri, Apr 08, 2022 at 01:20:02PM -0400, Joel Fernandes wrote: > > On Fri, Apr 8, 2022 at 11:50 AM Paul E. McKenney wrote: > > > > > > On Fri, Apr 08, 2022 at 10:52:21AM -0400, Joel Fernandes wrote: > > > > On Fri, Apr 8, 2022 at 10:22 AM Paul E. McKenney wrote: > > > > > > > > > > On Thu, Apr 07, 2022 at 09:07:33PM +0000, Joel Fernandes wrote: > > > > > > On systems with CONFIG_RCU_NOCB_CPU=y, there is no default mask provided > > > > > > which ends up not offloading any CPU. This patch removes yet another > > > > > > dependency from the bootloader having to know about RCU, about how many > > > > > > CPUs the system has, and about how to provide the mask. Basically, I > > > > > > think we should stop pretending that the user knows what they are doing :). > > > > > > In other words, if NO_CB_CPU is enabled, lets make use of it. > > > > > > > > > > > > My goal is to make RCU as zero-config as possible with sane defaults. If > > > > > > user wants to provide rcu_nocbs= or nohz_full= options, then those will > > > > > > take precedence and this patch will have no effect. > > > > > > > > > > > > I tested providing rcu_nocbs= option, ensuring that is preferred over this. > > > > > > > > > > Unless something has changed, this would change behavior relied upon > > > > > the enterprise distros. Last I checked, they want to supply a single > > > > > binary, as evidenced by the recent CONFIG_PREEMPT_DYNAMIC Kconfig option, > > > > > and they also want the default to be non-offloaded. That is, given a > > > > > kernel built with CONFIG_RCU_NOCB_CPU=y and without either a nohz_full > > > > > or a nocbs_cpu boot parameter, all of the CPUs must be non-offloaded. > > > > > > > > Just curious, do you have information (like data, experiment results) > > > > on why they want default non-offloaded? Or maybe they haven't tried > > > > the recent work done in NOCB code? > > > > > > I most definitely do. When I first introduced callback offloading, I > > > made it completely replace softirq callback invocation. There were some > > > important throughput-oriented workloads that got hit with significant > > > performance degradation due to this change. Enterprise Java workloads > > > were the worst hit. > > > > > > Android does not run these workloads, and I am not aware of ChromeOS > > > running them, either. > > > > Thanks a lot for mentioning this, I was not aware and will make note > > of it :-). I wonder if the scheduler had something to do with the > > degradation. > > It is all too easy to blame the scheduler and all too easy to forget > that the scheduler has a hard job. ;-) > > And in this case, the scheduler was just doing what it was told. No was just saying the scheduler has to do more work with NOCB because of the extra threads, so that likely degrades the workloads (context switch, wake ups, etc). > > > > > And is it really all -that- hard to specify an additional boot parameter > > > > > across ChromeOS devices? Android seems to manage it. ;-) > > > > > > > > That's not the hard part I think. The hard part is to make sure a > > > > future Linux user who is not an RCU expert does not forget to turn it > > > > on. ChromeOS is not the only OS that I've seen someone forget to do it > > > > ;-D. AFAIR, there were Android devices too in the past where I saw > > > > this forgotten. I don't think we should rely on the users doing the > > > > right thing (as much as possible). > > > > > > > > The single kernel binary point makes sense but in this case, I think > > > > the bigger question that I'd have is what is the default behavior and > > > > what do *most* users of RCU want. So we can keep sane defaults for the > > > > majority and reduce human errors related to configuration. > > > > > > If both the ChromeOS and Android guys need it, I could reinstate the > > > old RCU_NOCB_CPU_ALL Kconfig option. This was removed due to complaints > > > about RCU Kconfig complexity, but I believe that Reviewed-by from ChromeOS > > > and Android movers and shakers would overcome lingering objections. > > > > > > Would that help? > > > > Yes, I think I would love for such a change. I am planning to add a > > test to ChromeOS to check whether config options were correctly set > > up. So I can test for both the RCU_NOCB_CPU options. > > Very good! > > Do you love such a change enough to create the patch and to collect > convincing Reviewed-by tags? Yes sure, just so I understand - basically I have to make the code in my patch run when RCU_NOCB_CPU_ALL option is passed (and keep the option default disabled), but otherwise default to the current behavior, right? Thanks, - Joel