Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10951381rwp; Fri, 21 Jul 2023 07:15:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlHSGhDM1CW3vaGpP2Mix14VopnwAuvU7coMiZQXZZx+v6NCRRnA8yddKJX04g5yDwuH34/L X-Received: by 2002:a05:6512:b8d:b0:4f9:6528:fb15 with SMTP id b13-20020a0565120b8d00b004f96528fb15mr1551634lfv.12.1689948929904; Fri, 21 Jul 2023 07:15:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689948929; cv=none; d=google.com; s=arc-20160816; b=nHc9xuqP4VhQqUsaINhfKDdgiXzRZbFQm5dLV3/o9RjwKX8Gvv84TGWOj7r8sVwcr1 5Qgv98+sxbo1Ug/non+Ivd77S3Nan8GIsyWBSeaoOtxlNyPJ4tESPl7w6LaC3ZBAX4d+ fDlwm2byOxW9h5OcjjDyf/tQ49Nd/YURhe/hEaY/USB+RN4DuSxuxZMlNwlXKlOr/PIn TDF5BiEMvMa/FjgyddOQbeL4fK/gS8n/+XWF8Un1YDJlWB4Y46By0g2u1qm4aKton4dv d8ih/cn5HbYJfpSUtFdxRKI8sHy4zF0mGxuhcBXTPDwB0Ekvr0kLvu1EMPMgo/joEdfE YBdg== 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=gB8SfKP87DwT9kSBXaf0Dr57Xbbqd3MXgUGGPy3mNf4=; fh=tIwqNrifMyj+c+OgVUCe7I7fIQtM4jtJ/Mna/ALWb2c=; b=Ed5LX0en9ra/9DkfHH1sxUQ5D9aGRkmfv5FwrB1NtFDO3zt6n9/RmTA+GMzVM8DS/F Iy6c8TgjiYGSOvsDNf1t8XquBCXh+YKIgvQCDc4r94mUqkt1iCCDTYA5Vzp4ZAgyJMTU x40+sxyVgPuwqtXrHaqSHsB0D9y/QkrrQwJk8UPTmE3KuP380dEAdAO3OCDiGFbZNaH8 7YS1q27ShLGGvWGj+atrhauomdDnZpx/ZiYV4otfPqzQquZgpnm/AF6g9l91dqGgUKqb bh4Zzx9Z/0qE7cEYzBqRGWwQqD2oGCeGO5tRefyndPCX2+BEbcRQTA06wyGY8s6s+H29 QiGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mwXJ4tWA; 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 a4-20020aa7cf04000000b00521cadfcff0si2298041edy.203.2023.07.21.07.15.04; Fri, 21 Jul 2023 07:15:29 -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=mwXJ4tWA; 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 S229960AbjGUOKH (ORCPT + 99 others); Fri, 21 Jul 2023 10:10:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229487AbjGUOKF (ORCPT ); Fri, 21 Jul 2023 10:10:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7170CE; Fri, 21 Jul 2023 07:10:04 -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 6558E6195D; Fri, 21 Jul 2023 14:10:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C39B4C433C7; Fri, 21 Jul 2023 14:10:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689948603; bh=mqpc+bgxfipMEEmdMi0c2/ZJlESRyidyP20iwu1ubiU=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=mwXJ4tWAGVS1YQv279yKam6lNor4fbv+EyYgPE9RKEXpJy6cXNZvFlP/KKxzKOTcB +lqGPmG2ffZZ0Efx0S0TqnBE8IaMzk2MnCLGRhRMBEWpOJudId0i07k3cmP/nZVUaq SHQPI6oYI5J2Ttnh4Enh9amoPJh7ypEjFICnaRQdDw7U29St7RlFkhJ+D7ihhqnWOv xJjOEA3EUwNJAeTjNQJuuLgeXIWPSt3vBhtsEYX+1h3uDFaCPOyDIo8LBS3B298nuq TrABcFKxVgUZNpuCKIaTgVNCGRGx0+QB9sHGcYJxF9jYzQi65FyVdVCSm+wLi6c1Xq S45vKWYuRh3Iw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 5E67BCE097F; Fri, 21 Jul 2023 07:10:03 -0700 (PDT) Date: Fri, 21 Jul 2023 07:10:03 -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: <28d4abb7-8496-45ec-b270-ea2b6164537b@paulmck-laptop> Reply-To: paulmck@kernel.org References: <20230720163056.2564824-1-vschneid@redhat.com> <20230720163056.2564824-17-vschneid@redhat.com> 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=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, 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? Thanx, Paul