Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30870484rwd; Thu, 6 Jul 2023 11:56:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlHEWqUe1hOrsw5t46Z9QMnmKhXRA3N2yASyMqdfBzHedbVtOWUd001IOISzDuf0UsFL/NXG X-Received: by 2002:a17:903:22d2:b0:1b8:a4e5:1735 with SMTP id y18-20020a17090322d200b001b8a4e51735mr3286710plg.61.1688669796285; Thu, 06 Jul 2023 11:56:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688669796; cv=none; d=google.com; s=arc-20160816; b=js2UkBrnWDcihSuqKRP0V9KETkmUnlMX2Cp8YaznLLVv7ifFmDy3y2mkCuNnUbwDtu h3mypw4mEgpi40Fa0exHukWoHkdzARIVw1Lj9EJcR1c3oadImGmE5WghCKMCIM9HRhOM 0Vb+A44/nAO8TH5gzYi61V0iDBpovp/27Aeyj7OiL2OgQ5uxPM8wBeZNxYl3QMSd4Djd 5gygvmr8fsuL6rft5olgzkoFNqjB+FhwAv2m1nWc9zX1/Jh7KfB8jnvTU27KqWl69m0Y OEDTxgEStjGIWpGjfzvvfGoyGPlJ/t6TBwayv4ZIzlxQejshlNMeAPipKriEIRpsdCsU cLTA== 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=Mt4cbGq9d8jKpC8J/+jZJ74qgft1NY860RzeCaYTTAU=; fh=An2l4j8RRTmQzxrQLGc5btDKiB+Zniy0q9A7FJJvZck=; b=UuBbhnM5jjnR8uKHbi+Qusd1SgMxl0YvaqGub2Bhnn7I8J54zf+CHGhnPvVKUzDC6c tlNG+hAzZmcQ9OQMupBzkiUvb6X5FajhS/RvhgqvnDcvayOdPessINhJf/mMTVfzKI23 U3krRBKz0T0fAEPkF0i0sJ2o/pUF/NivypdNl3uXov6V7ZlczRN7Q0vm8CqLr0aIM8Wg HCXFXORFOVJc1jMeiEKqCk0e6Da2YgBX1IlGRdJQv3Kbld4lYsh+VUR0DjSgGj/n0Ize GfQ3Jnwls3a7I/YiSmjeCQppdXVYJZs3RMaAg9Sc/3octV57C/qQ2ka4QK7oSXDKag/L HOqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Xbx9k6ws; 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 y2-20020a17090264c200b001b8a39c6537si1657534pli.503.2023.07.06.11.56.21; Thu, 06 Jul 2023 11:56:36 -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=Xbx9k6ws; 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 S231954AbjGFSGO (ORCPT + 99 others); Thu, 6 Jul 2023 14:06:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230434AbjGFSGN (ORCPT ); Thu, 6 Jul 2023 14:06:13 -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 20C691995 for ; Thu, 6 Jul 2023 11:05:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688666726; 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=Mt4cbGq9d8jKpC8J/+jZJ74qgft1NY860RzeCaYTTAU=; b=Xbx9k6wsBCW6d/cNDU3L2sRfZ3uTuxbTeu53m2RyZg86DMdYdv8yHnfENl0GxXAkQ4/N73 DQSep05BvJItRkFGcjQgu+9tKe1YnRTPn/IExO/1BL/l7L65QNKj0GH3zWd/oUzt/GuMEO PojAEJSSMWZoRBA6WQ163MlV5b0QvmM= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-112-bO3qMpBoPFCjLkDEKG_gvA-1; Thu, 06 Jul 2023 14:05:25 -0400 X-MC-Unique: bO3qMpBoPFCjLkDEKG_gvA-1 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-634dacfa27bso11570626d6.3 for ; Thu, 06 Jul 2023 11:05:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688666724; x=1691258724; 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=Mt4cbGq9d8jKpC8J/+jZJ74qgft1NY860RzeCaYTTAU=; b=FZcvGiqPONTKXxTNJGQTJu+AwEk9GvP0X0ascki5N1pFlWAZdy+dqlNIeJrCdw3c5u 0ovLlLJxJx2hpgErfzo3yVS67VWM4aWp1bBiTtKsB+W56ZkXiiyHco9aXdMV1+VgeTck R8y1cn4ltPIltZWB+YEr/HIzT0YkT3agiam/B4X36aW7x/HW54B3Zm84qgZYW/IXijAO j2BLV82GKb4wQ0i1K5DJMgUBdNZUt3Hdwy2QCUPF1Q777eIFcNbzy1AX1JujblyI/K5C HRzghlnuY4G2uu85GZ7zt68Myqqk0C3MLJ9KRUH1CHPG91Dw4o87s+WAaLEOmLDpdUEW oTEA== X-Gm-Message-State: ABy/qLawd5O7J+MXSOojXRVepSPqaSoaOYcG/7WzZU0m7LMF6goFUiOF h5NnNdcXYR/StUEU15GBh6uFJk4WrtMnRe5pYS58EYOmSv7s9+55KXBHa9GQlfb4d8ez7LVuihW CzlTVTR2aX6stdHrPrNqHOzZw X-Received: by 2002:a0c:de07:0:b0:632:1da6:986a with SMTP id t7-20020a0cde07000000b006321da6986amr2462917qvk.17.1688666724510; Thu, 06 Jul 2023 11:05:24 -0700 (PDT) X-Received: by 2002:a0c:de07:0:b0:632:1da6:986a with SMTP id t7-20020a0cde07000000b006321da6986amr2462887qvk.17.1688666724257; Thu, 06 Jul 2023 11:05:24 -0700 (PDT) Received: from vschneid.remote.csb ([154.57.232.159]) by smtp.gmail.com with ESMTPSA id c12-20020a0ce14c000000b006260c683bf2sm1135942qvl.53.2023.07.06.11.05.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jul 2023 11:05:23 -0700 (PDT) From: Valentin Schneider To: paulmck@kernel.org, Frederic Weisbecker 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, Nicolas Saenz Julienne , 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 , Andrew Morton , Uladzislau Rezki , Christoph Hellwig , Lorenzo Stoakes , Josh Poimboeuf , 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 11/14] context-tracking: Introduce work deferral infrastructure In-Reply-To: <4c2cb573-168f-4806-b1d9-164e8276e66a@paulmck-laptop> References: <20230705181256.3539027-1-vschneid@redhat.com> <20230705181256.3539027-12-vschneid@redhat.com> <4c2cb573-168f-4806-b1d9-164e8276e66a@paulmck-laptop> Date: Thu, 06 Jul 2023 19:05:17 +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=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 06/07/23 09:39, Paul E. McKenney wrote: > On Thu, Jul 06, 2023 at 01:40:14PM +0200, Frederic Weisbecker wrote: >> On Thu, Jul 06, 2023 at 12:30:46PM +0100, Valentin Schneider wrote: >> > I'm trying to grok how this impacts RCU, IIUC most of RCU mostly cares about the >> > even/odd-ness of the thing, and rcu_gp_fqs() cares about the actual value >> > but only to check if it has changed over time (rcu_dynticks_in_eqs_since() >> > only does a !=). >> > >> > I'm rephrasing here to make sure I get it - is it then that the worst case >> > here is 2^(dynticks_counter_size) transitions happen between saving the >> > dynticks snapshot and checking it again, so RCU waits some more? >> >> That's my understanding as well but I have to defer on Paul to make sure I'm >> not overlooking something. > > That does look plausible to me. > > And yes, RCU really cares about whether its part of this counter has > been a multiple of two during a given interval of time, because this > indicates that the CPU has no pre-existing RCU readers still active. > One way that this can happen is for that value to be a multiple of two > at some point in time. The other way that this can happen is for the > value to have changed. No matter what the start and end values, if they > are different, the counter must necessarily have at least passed through > multiple of two in the meantime, again guaranteeing that any RCU readers > that around when the count was first fetched have now finished. > Thank you for the demystification! > But we should take the machine's opinions much more seriously than we > take any of our own opinions. Heh :-) > Why not adjust RCU_DYNTICKS_IDX so as > to crank RCU's portion of this counter down to (say) two or three bits > and let rcutorture have at it on TREE04 or TREE07, both of which have > nohz_full CPUs? > > Maybe also adjust mkinitrd.sh to make the user/kernel transitions more > frequent? > > Please note that I do -not- recommend production use of a three-bit > (let alone a two-bit) RCU portion because this has a high probability > of excessively extending grace periods. But it might be good to keep > a tiny counter as a debug option so that we regularly rcutorture it. > Sounds sensible, I'll add that to my v2 todolist. Thanks! > Thanx, Paul