From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3A13C04FE1 for ; Fri, 21 Jul 2023 15:09:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231836AbjGUPJU (ORCPT ); Fri, 21 Jul 2023 11:09:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231828AbjGUPJH (ORCPT ); Fri, 21 Jul 2023 11:09:07 -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 7373F30FD 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-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-149-gUNtqBpZMy6YXCHUNAaXdQ-1; Fri, 21 Jul 2023 11:08:15 -0400 X-MC-Unique: gUNtqBpZMy6YXCHUNAaXdQ-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-3fb416d7731so10659255e9.2 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=AeMr7uQvgyNa0I5b6/ij7NcITvs959nNokJ4r/2bdynDxLVgxmZwkxFcM3T9dJVrrV nMRaMUvtiMpH4BZNuyYSWnBr+BKMlHdszdj/6kqU9AlFmMjDQ83Qsxo2pdGGuHIGjE5Q a2rs3VjRFJQyXS8L0y1gElkHXVN9xZmOwHwtTRUfjC1Lv660X1ecOAR1px8/iN7dJupa dzVG0xIf6eIa3HBEkjWO7MaEOJdC7pCUXbszNdXwijY65v7YEABTJtzFINCiPOexgY4D wxrVVT3US+th5AP8WEiqbMmQYNkeWGh4oCnaLa2ZLoOyy2vv42cqoJOtoY7xZARjLtGX nC+Q== X-Gm-Message-State: ABy/qLZ8HDrKvV84ZJOh5yb7aKPDpLNjXsXDEk6zN02sC3WjACQI0V2b Oes2ED2HQ5nSrONQoXFYDN0PrbEs1Jbm3ga/o1i5UtQA3h9QnEmOw1WV/ZM7GaFW6keTlMiIunh zCZlQUMMrYVly+AiHMS4c X-Received: by 2002:a7b:c455:0:b0:3fc:627:ea31 with SMTP id l21-20020a7bc455000000b003fc0627ea31mr1714668wmi.38.1689952094108; Fri, 21 Jul 2023 08:08:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlF9fiPWFBcIAw2j2QV4lTYmt4mtAVTwBGD8BbL2O21cgVm0IYBel5tSTfnfWuFcEvQp7qgXww== 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 Precedence: bulk List-ID: X-Mailing-List: linux-doc@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