Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp75471rwo; Fri, 21 Jul 2023 08:44:00 -0700 (PDT) X-Google-Smtp-Source: APBJJlFybDLIOH77CLrgd3fDIlLkZnVd/Q79IfcCqMQDK1iGvUn110xvmexcfjdXQUWQ1hijOTn/ X-Received: by 2002:a05:6358:9312:b0:133:595:1c with SMTP id x18-20020a056358931200b001330595001cmr202952rwa.31.1689954240421; Fri, 21 Jul 2023 08:44:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689954240; cv=none; d=google.com; s=arc-20160816; b=Vb/wS24L3Z4hW6mtJOrRO/DzdyEjeNXU/zMLSsmpnXIGuxjXWOAwH4EGzvpT+DgWdo OBsMzlujvSSx9lVTxiVr3QfyNFAHV1TzvhtfXoierPcRkh65+uQk7gvrp1jU8Kz+IN5E S2xSRCXAOYa4KCmiGU+Rj5G+fRgCTAYcFZduj6gILLljcOstV/uiH6KUbJCVIV2KkKc3 c2pJqdpx9oI4pv6pqp7VW0QjBBUQAGVZZ8UW5avseRogc5EJTk0yvwA5mqwrvRJXXR76 ktmnWDW3GkoK5g4dldxZhrSAoG3nTQwTpwKqHTbt+ZmGgHLB6P77VCOBfjew5OwCO2LQ H/bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=SD81e7NZBdmvFs/0moOEoRHsNzw2ypppSDOfYt+K9oA=; fh=AAu/ImhLtm2ovl+Ccr/WS2GtaSXprMXkjDtOVOblHBw=; b=f2jZDyEgfab/GE+vpGE9G+3febgeX+5wvSN8OO9+okXJas1jS2ih7eOuYPQWKtbDzh vm9PL3ODn1mi2qFl0omms4Wl+inLW41pdDN8IAamdQXUpOsmGgHi5isnkxEUhHsWUCPl yZYkIMPdqkYPMkaP62AYZHDfVVvdgHqbstKq3444b0a1Cg+KJUd95BmET6epMiRH4lNJ 1i2/BaFn+BoHfJI9jSAb7CcsyNcK6fFiWvtDWZdSLP3rCoo3T4IWWMwLnFwtQoj36vWj mHhGbd4IEg0b84k7G1Mu1KwGJmR740uFeqQaPgrGBXpWF9yzK0vqcR2IRIUOFrwZns2A DQ3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HwZSLzxi; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c5-20020a6566c5000000b0056370a8b95asi3113847pgw.878.2023.07.21.08.43.46; Fri, 21 Jul 2023 08:44:00 -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=@redhat.com header.s=mimecast20190719 header.b=HwZSLzxi; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231840AbjGUPJT (ORCPT + 99 others); Fri, 21 Jul 2023 11:09:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231830AbjGUPJI (ORCPT ); Fri, 21 Jul 2023 11:09:08 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E8AE30F4 for ; Fri, 21 Jul 2023 08:08:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689952096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SD81e7NZBdmvFs/0moOEoRHsNzw2ypppSDOfYt+K9oA=; b=HwZSLzxi0P1oAdGrffqa8WSat0EVVskjrWXXVBpZ8+doOSiy6LZnGhz0tGpLx9EuROcd+x HbqZeBdo/ARZ+i1IfjwKh5Xu4Wzj20gsYUL/ulclIRpCYM9j8D2YOfVSOOuErRfbLmutU+ +7cbCnryJszXJUl5lmN+702Ri+DIMYs= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-562-WR2i1kEmMKGI6YynXlxdew-1; Fri, 21 Jul 2023 11:08:15 -0400 X-MC-Unique: WR2i1kEmMKGI6YynXlxdew-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-3fbe4cecd66so10678355e9.1 for ; Fri, 21 Jul 2023 08:08:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689952094; x=1690556894; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SD81e7NZBdmvFs/0moOEoRHsNzw2ypppSDOfYt+K9oA=; b=elP0/rtueCvGZ6y7u9M6D3iK86nISZYHvpvgNUdaMHRCYi8NFj2lQYMym36qWPJeNn 4phcoUUi8HNE/dZIuxwWBj7gs/qB3zqrRNrkt5GmXrLUwx02kzvrENUxeld6YjXGwxXD Rdg7cEywt6sJxaMuLqNj/4w0/p3eNoS5PpnnwxrV/h2rXehUel61FOmGUCsxqp16FRDT M4YUXab1VaFqw+nbO1LK1H+wxUk7jsBdJ5qJNM2qE+YglWydEesK5BHBau3PApCVUitS g7PlBwjNDxyl4004xXOAbuhEc/NEuzduJMcHG4aSXWUms7JXudb1S6yfNWPhVLsjI+nK HHaQ== X-Gm-Message-State: ABy/qLYLervGIkkbfrR3KMO2lN47YrxinNk6CWK7WyvhnW6VeztliZxU +NI5P1o5dTvek2lrdq+h3LqAquWhAGLsbnLfOkYSR3EcgEeRlKDwzHHe6mlsVWE3aN2OIRR82z0 meXgv+g2NhDyfmQliYYMBQARD X-Received: by 2002:a7b:c455:0:b0:3fc:627:ea31 with SMTP id l21-20020a7bc455000000b003fc0627ea31mr1714690wmi.38.1689952094111; Fri, 21 Jul 2023 08:08:14 -0700 (PDT) X-Received: by 2002:a7b:c455:0:b0:3fc:627:ea31 with SMTP id l21-20020a7bc455000000b003fc0627ea31mr1714619wmi.38.1689952093765; Fri, 21 Jul 2023 08:08:13 -0700 (PDT) Received: from vschneid.remote.csb ([149.12.7.81]) by smtp.gmail.com with ESMTPSA id q7-20020a5d5747000000b0031434936f0dsm4459951wrw.68.2023.07.21.08.08.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jul 2023 08:08:12 -0700 (PDT) From: Valentin Schneider To: paulmck@kernel.org 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 =?utf-8?Q?Wei=C3=9Fschuh?= , Juri Lelli , Daniel Bristot de Oliveira , Marcelo Tosatti , Yair Podemsky Subject: Re: [RFC PATCH v2 16/20] rcu: Make RCU dynticks counter size configurable In-Reply-To: <28d4abb7-8496-45ec-b270-ea2b6164537b@paulmck-laptop> References: <20230720163056.2564824-1-vschneid@redhat.com> <20230720163056.2564824-17-vschneid@redhat.com> <28d4abb7-8496-45ec-b270-ea2b6164537b@paulmck-laptop> Date: Fri, 21 Jul 2023 16:08:10 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain 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_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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 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. > Thanx, Paul