Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp156055rwo; Fri, 21 Jul 2023 09:49:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlGsXwdzvs+RwB7qiA5IEMaUxBu1Wa0W0UIYgPb/u5+DrvGyg2dZ69CrtRluQLsmp5MsKfuz X-Received: by 2002:a05:6a20:a126:b0:126:8b2d:4462 with SMTP id q38-20020a056a20a12600b001268b2d4462mr4322753pzk.24.1689958159850; Fri, 21 Jul 2023 09:49:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689958159; cv=none; d=google.com; s=arc-20160816; b=O+RNijLE9LgAwVxAGPBQ51+qGWPFQc5r4/PrtGr1cDvXNMB/7JvUSALxg3iJsAz/65 A7jzr5hpZwsj3eIEzzzI3m6z8dvOL9c+Uc8+nkgtE2BTif2Rt3FHRbDEe1J8CYURaIts a//b5YHPwG2ndjdCdZP/RQ3yQxKDpECzqNDA3+eW57eDqeI4hFmcnabfMGCIeElf7Qxo iMzmOoDLhdehdj//fdud2sUIw97A9lccWYt8kT1fJnbsD9HLyicI1BR0AWkQx7XVQ21D Lru58J4DRsprRSZp8M3JvpMTG3Zm5ZriVwc73rJqTmLOhpYHDqKubqkAPCjbmshMYYqa FgmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=NDASCkQASL5X47aEohR+jPaPiB0eZFvwjOLgljDj15c=; fh=tIwqNrifMyj+c+OgVUCe7I7fIQtM4jtJ/Mna/ALWb2c=; b=ak6hbvbb/fWHJnb797Dan7/E+2jbDHMO1P47yfN357ih5CXY6sOKiSU9v+onQ9VsOT Mf6ZCMTUG4ka1xY/WHJA59AQN3Qu3ar4qnlpp2bWOO/rX8lUretiAJUvvHkC5QCmlphf L4WU78rotfCdmzFyvhrfuE6c31uavnnGSOYhNCgpXYpYFdmuSRIWmAjAFUgpPAVaXlaM pUyrKwR02HIgVyiC1Bj3PfjbBMask89j20lxWo9BI5+wJqInDUEYhTzJpr2wIbY/kr4B eLUu9KYSTpi5+936QfZzRFKDv4svJup9Y3+Lstl0Am1qfzWVGdFfQPCBDi6Z5ZtoH/8C aAkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OFTQ6DuO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u186-20020a6379c3000000b0055aff745fe2si3081502pgc.406.2023.07.21.09.49.05; Fri, 21 Jul 2023 09:49:19 -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=@kernel.org header.s=k20201202 header.b=OFTQ6DuO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231995AbjGUQJT (ORCPT + 99 others); Fri, 21 Jul 2023 12:09:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232344AbjGUQJQ (ORCPT ); Fri, 21 Jul 2023 12:09:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 712E22D50; Fri, 21 Jul 2023 09:09:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 018EF61D2F; Fri, 21 Jul 2023 16:09:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 689E4C433CD; Fri, 21 Jul 2023 16:09:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689955754; bh=BlEi7p0BDMKhiEwXg1jOq/zD4Xedk5tjgloH9k5cDxI=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=OFTQ6DuOnqrG6CVGHgozLdOfqNJoDAb4DdM10deIzFIcuAksLBrn/okq4ws1Ur9lw vnsF0PAylGPOwrvzqd8MD7OI6RQvWiDFcruohc1T27dsQlVcsq24OAk01Uc8ndiK4V 53gusbrsSeE7IS4F3aXX11DrNumr93rNPkzbgk6BqkWkpecmtxIc1RCSwyiRuReBW/ IcFeyllltS2xScVQstI79rpDOfa4H6ZPHQWUsAuDPJvk1Dq9LsQE2p69D0x+BcaX1W VlHj29+EmuuFk1Q1AOo/Ojy8Ijv1Fva0Kmm6Sj3z4ngf26Cy0NypimaJ5plEn9OvV7 JbudTDJwiSXEQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 0571ACE092F; Fri, 21 Jul 2023 09:09:14 -0700 (PDT) Date: Fri, 21 Jul 2023 09:09:13 -0700 From: "Paul E. McKenney" To: Valentin Schneider Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-doc@vger.kernel.org, kvm@vger.kernel.org, linux-mm@kvack.org, bpf@vger.kernel.org, x86@kernel.org, rcu@vger.kernel.org, linux-kselftest@vger.kernel.org, Steven Rostedt , Masami Hiramatsu , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Paolo Bonzini , Wanpeng Li , Vitaly Kuznetsov , Andy Lutomirski , Peter Zijlstra , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Andrew Morton , Uladzislau Rezki , Christoph Hellwig , Lorenzo Stoakes , Josh Poimboeuf , Jason Baron , Kees Cook , Sami Tolvanen , Ard Biesheuvel , Nicholas Piggin , Juerg Haefliger , Nicolas Saenz Julienne , "Kirill A. Shutemov" , Nadav Amit , Dan Carpenter , Chuang Wang , Yang Jihong , Petr Mladek , "Jason A. Donenfeld" , Song Liu , Julian Pidancet , Tom Lendacky , Dionna Glaze , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Juri Lelli , Daniel Bristot de Oliveira , Marcelo Tosatti , Yair Podemsky Subject: Re: [RFC PATCH v2 16/20] rcu: Make RCU dynticks counter size configurable Message-ID: Reply-To: paulmck@kernel.org References: <20230720163056.2564824-1-vschneid@redhat.com> <20230720163056.2564824-17-vschneid@redhat.com> <28d4abb7-8496-45ec-b270-ea2b6164537b@paulmck-laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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, Jul 21, 2023 at 04:08:10PM +0100, Valentin Schneider wrote: > On 21/07/23 07:10, Paul E. McKenney wrote: > > On Fri, Jul 21, 2023 at 09:17:53AM +0100, Valentin Schneider wrote: > >> On 20/07/23 17:30, Valentin Schneider wrote: > >> > index bdd7eadb33d8f..1ff2aab24e964 100644 > >> > --- a/kernel/rcu/Kconfig > >> > +++ b/kernel/rcu/Kconfig > >> > @@ -332,4 +332,37 @@ config RCU_DOUBLE_CHECK_CB_TIME > >> > Say Y here if you need tighter callback-limit enforcement. > >> > Say N here if you are unsure. > >> > > >> > +config RCU_DYNTICKS_RANGE_BEGIN > >> > + int > >> > + depends on !RCU_EXPERT > >> > + default 31 if !CONTEXT_TRACKING_WORK > >> > >> You'll note that this should be 30 really, because the lower *2* bits are > >> taken by the context state (CONTEXT_GUEST has a value of 3). > >> > >> This highlights the fragile part of this: the Kconfig values are hardcoded, > >> but they depend on CT_STATE_SIZE, CONTEXT_MASK and CONTEXT_WORK_MAX. The > >> static_assert() will at least capture any misconfiguration, but having that > >> enforced by the actual Kconfig ranges would be less awkward. > >> > >> Do we currently have a way of e.g. making a Kconfig file depend on and use > >> values generated by a C header? > > > > Why not just have something like a boolean RCU_DYNTICKS_TORTURE Kconfig > > option and let the C code work out what the number of bits should be? > > > > I suppose that there might be a failure whose frequency depended on > > the number of bits, which might be an argument for keeping something > > like RCU_DYNTICKS_RANGE_BEGIN for fault isolation. But still using > > RCU_DYNTICKS_TORTURE for normal testing. > > > > Thoughts? > > > > AFAICT if we run tests with the minimum possible width, then intermediate > values shouldn't have much value. > > Your RCU_DYNTICKS_TORTURE suggestion sounds like a saner option than what I > came up with, as we can let the context tracking code figure out the widths > itself and not expose any of that to Kconfig. Agreed. If a need for variable numbers of bits ever does arise, we can worry about it at that time. And then we would have more information on what a variable-bit facility should look like. Thanx, Paul