Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10605374rwp; Fri, 21 Jul 2023 01:47:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlFkTP42mQf4ocuWM4+7+wpZfnYdo25pGlTqdLDYD9D18HXiD3H7m2YaE479VwGV4FK3xmT3 X-Received: by 2002:a05:6402:160a:b0:51e:1a3b:bd6 with SMTP id f10-20020a056402160a00b0051e1a3b0bd6mr1116723edv.31.1689929249116; Fri, 21 Jul 2023 01:47:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689929249; cv=none; d=google.com; s=arc-20160816; b=VRbvWlR9pq+06lyVQHrCBnbfOb/aMkMRtDUIFahGG84HVrfgMaZkcOpnZgjmW1IN/Q mJz1e5wNFRob8QDIc+OFU7xMs0Uuo5Ul/OMh67XDEVGGoDOvpgnzO1bQ8/A6mgvNu5Uj zrPklG80hn+P51YpQYuEiKRdTc3urxivlncrvX+78pefCAbtNizjp3YQrCRBWi6szuvU kxql2HPxECqDMb7L1fmH1tl1p+vKeO3erQdT4Z0wdFYIhO2aQI5NIL+OZvErYyB+aoBH JPIUohrsRLYjkwFuOyqc9V0dttddAS6RXSb+w3DhwJOePIRjFcVGH1OGcWCbNb711OkW P91Q== 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=wWAtfDt+4FFr8z2L0240XKTF6ityOHMPZsX6cXcmsiA=; fh=U2GUEVWBS42vD/onTPNzcQTUBHdJ0DtcJmXYH+cs1is=; b=flZRZpSW63hRdqMTq+8W3v5/tEJZ66SkJb4+XYXwGY4H84eZT2VzfNefzxkQkWEpj9 e1yCuRovxADwswRUFI1nBsw/RtRo+wMLTVWf3gN2CW+HHlmoEntmd6DifG6FRjuTMC8P D90eBiM9uhD6yjWjWl9lpYpDzLWutz5Rl/wq7mhKlvw8ERkJZgujaGSYNWBberhIxLE+ vld1Onh0is+r5687bekhtVVoykM7LMZPerb05kya+n+9Z6y+kmdBkwBULrj+N86Hov2d 3w6Ex1dP3sksX9FFEw1l4hkYaVEd3EhPz6et3V3ul+W1aoadMmhzv/KRyQBO9EUYhXXl K7Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WZpMWO4b; 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 v23-20020aa7cd57000000b0051dec563f99si2162328edw.73.2023.07.21.01.47.03; Fri, 21 Jul 2023 01:47: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=@redhat.com header.s=mimecast20190719 header.b=WZpMWO4b; 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 S230356AbjGUISs (ORCPT + 99 others); Fri, 21 Jul 2023 04:18:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229905AbjGUISp (ORCPT ); Fri, 21 Jul 2023 04:18:45 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A59BED for ; Fri, 21 Jul 2023 01:17:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689927479; 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=wWAtfDt+4FFr8z2L0240XKTF6ityOHMPZsX6cXcmsiA=; b=WZpMWO4beRwM+SPbuB+tKbOC/vhyIC9v++ghRgWsSRlTCr77jmHfQloQxJzqfTvzaXJxgU GzSWg0yQfYkIA7UJqo2cmK724biq6lq89AULqZ4EtavDIZG2fz5NdpIW1BlMbS3DsAbqQI F9q/o6xdfXjnP+76IdDKzLMi5t6uwI4= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-575-6fC2t9STNwys54FKbLhkLw-1; Fri, 21 Jul 2023 04:17:57 -0400 X-MC-Unique: 6fC2t9STNwys54FKbLhkLw-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-3fbab56aac7so8737535e9.1 for ; Fri, 21 Jul 2023 01:17:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689927476; x=1690532276; 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=wWAtfDt+4FFr8z2L0240XKTF6ityOHMPZsX6cXcmsiA=; b=bsRpO3SGpDST31BKNEC4FkOnAxUQLTm9QOLCH6bin4SUGqQg7fSnXtgDzoKOnl94Gl OI0HkQLHq3L9PrwrhbbFnGDqyeN280DFNv//IRow/jhaImOUbY+E+FIraYCU5+y9uKE1 BthgvDQWrHN9ERlfMFbYW45QDcZssjHJRBtcJMQfQ3/z2ntR27/GRCD5oiJh1eFTAGli hyPgsMAwMNKg6fhoxUfDcVMRcu+7/zrfKlUXsVw0TqyX2ZIbqjEun7xL0AYH3TA6dTPL wiS32uAJ9vrrx0edJtYE6yjvq702MuLUP/x5PNl3Mf1CVRBUBXaOY5WiNOWEMEak7cDx roNQ== X-Gm-Message-State: ABy/qLY2mr09v14aTRW1SaCgY+gwu0RCYSABtQUmG4BpXrr/iwxbQPTb mIxzpjvu8l1WIgBgUSocB2o2fIeOzhYRHilhDlSOpEigEUfR4R8wLelTp2D1/b7HBgfCjjYT7c6 E/vwt8moXyeoDa09kkzA1Qqw4 X-Received: by 2002:adf:e44b:0:b0:314:23b:dc56 with SMTP id t11-20020adfe44b000000b00314023bdc56mr932451wrm.71.1689927476493; Fri, 21 Jul 2023 01:17:56 -0700 (PDT) X-Received: by 2002:adf:e44b:0:b0:314:23b:dc56 with SMTP id t11-20020adfe44b000000b00314023bdc56mr932410wrm.71.1689927476191; Fri, 21 Jul 2023 01:17:56 -0700 (PDT) Received: from vschneid.remote.csb ([149.12.7.81]) by smtp.gmail.com with ESMTPSA id j6-20020a5d6046000000b003143b14848dsm3444226wrt.102.2023.07.21.01.17.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jul 2023 01:17:55 -0700 (PDT) From: Valentin Schneider To: 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 Cc: "Paul E . McKenney" , 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: <20230720163056.2564824-17-vschneid@redhat.com> References: <20230720163056.2564824-1-vschneid@redhat.com> <20230720163056.2564824-17-vschneid@redhat.com> Date: Fri, 21 Jul 2023 09:17:53 +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 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?