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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0195EB64D9 for ; Thu, 6 Jul 2023 18:05:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 57C468D0001; Thu, 6 Jul 2023 14:05:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 506726B0074; Thu, 6 Jul 2023 14:05:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 37F7C8D0001; Thu, 6 Jul 2023 14:05:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 230B66B0072 for ; Thu, 6 Jul 2023 14:05:56 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id DB2961C8923 for ; Thu, 6 Jul 2023 18:05:55 +0000 (UTC) X-FDA: 80981965470.21.F07A83B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf24.hostedemail.com (Postfix) with ESMTP id 16D58180059 for ; Thu, 6 Jul 2023 18:05:26 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Xbx9k6ws; spf=pass (imf24.hostedemail.com: domain of vschneid@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=vschneid@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688666727; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Mt4cbGq9d8jKpC8J/+jZJ74qgft1NY860RzeCaYTTAU=; b=iN4n6QztE3VKUWpBp+mmQFP8ToOrxqWxHdND81VAP1qm4OdqDa8nvtURHnfSDsIFdJP08L CV0rmS8ZJdKpdoVEYGGqN4MCgcpYqECbkNCQAtH7z9R0e9jmaP3V8AWhSm75OJIxp7TH+w w9kJtqNUcP284yFLCPwKMK0klXHTuJI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688666727; a=rsa-sha256; cv=none; b=zJC4dgMZkXfoacoEHotvl8XKlig0Xj76FDv3kYLvaeFBwabrJ04x9q2CG0Vxznx0i7CzIj MA0ORepmeU7irfUOaVGWUv/QZrLGRcKpvgFuKicYPYr8aOF0Ef8yuc4M7ISjwD+PQfX1Y9 VlrNjuUcY4Hk8oS0pGzKRE3o/j1FLcA= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Xbx9k6ws; spf=pass (imf24.hostedemail.com: domain of vschneid@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=vschneid@redhat.com; dmarc=pass (policy=none) header.from=redhat.com 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-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-600-HEPK2QWcPreCi28KGE19bA-1; Thu, 06 Jul 2023 14:05:25 -0400 X-MC-Unique: HEPK2QWcPreCi28KGE19bA-1 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-634dacfa27bso11570576d6.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=lGwFm4urlovROMmlMtvN8EmfUbFlhktqg8/UMRvm41jVU7muHjBpZe91D3Wd5ZPzlr Rz0ikcO9hzcVnQwy0JHbKJgwwPp9ojz4unCaSl4m7epWNfDNPGz5vzAj43SsqFGUgOZl 8i3sPJOtqjGEOFKU9wIeXu8DNgiQY++Cbj9hsz9BOVEJbsZU4bMQtCzFKS5uJsjkNN2W t7PPZ6Vy/z6zJB7dQksxsowXZWiGZHqPXejHyS4NlIHG2bvGqhzDOXnn68pcMq05smLY 0N6nPxZKfJG9j3voeV+ij33u7UVog824GNMzYwQPYNppNiCci9ITPz82JUJZdTbkb8ky tBxg== X-Gm-Message-State: ABy/qLY7ZoksZBaPyL2K5/HN4hj/o3iNvpUM6Fa+Jm0E5S4FsJ9LQ/hV tMM0etlTIpFri0XiZy0vuUDjXFytlL1hCr4PHPFd7lNLeH6xIEUpdspfADAShFFGwauagEYL0nI 4GgKjbH5JuO0= X-Received: by 2002:a0c:de07:0:b0:632:1da6:986a with SMTP id t7-20020a0cde07000000b006321da6986amr2462928qvk.17.1688666724512; Thu, 06 Jul 2023 11:05:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlFmb0Wl2yHupEnJvTRYWB02b+IYD3YW7L4gL7H6IsZmD2crA+l9iItFZbkC9he8nK0QEubsug== 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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Rspamd-Queue-Id: 16D58180059 X-Rspam-User: X-Stat-Signature: ph7zmo5gkmfzxk4uwgai9ub6hunubhwe X-Rspamd-Server: rspam03 X-HE-Tag: 1688666726-744146 X-HE-Meta: U2FsdGVkX198ItrzwTH6jV175rZX6sGofYd2WJt0YACGED7+ezNLwEuSf863Us3XqdpyYUcMl2ERqLdL5EtoGKGHeHa5MEbIAHfiw8Avvl/WU6fAJ+0J+dpLcILJ9fT/m6Q0r/GkLXSaN5tdAnXOKoBYmOvUbyD1OGEchP8Tzmu11YrPB0bK7w1zAsVETgnv78AuX/r0VEFhuLrD1isvtjPpMDUJNyOAO9/1gvNs0zWG+Kcxrksy3v/B+/9Ntu5HYpCzyK9IZrLu4q4njumb3No3HdfgIqjOMsULmbw0DGPdERez9PZiUwT3DEWfVn7S0lHtxIqJE4cllDcTyb5qBs+NUCglWMIaQlqOXfuNIQ0idr1VHAWk6236BoUHxzpsJvUcfe1uJc1naKpmqT8YtuaEh+JT4AYx6yZjZe7ISctn+O4oOuaeX/eJ4/Uv2SqUDlDYp6VCUdEcMNq0x4eUxwaRjP0uPwwIbqsU23Pm0P0CCvrdyP2SaHCRWt1S1Ptbm/FWb5ceJMir0K4ICFhyvJ0COghpcKS6IN9Vi8qhLUwFScdqEXz/D16DGG0UqyaCDlzqlRMuK4yLXkkBvlQPMHaQSSb6EYBHeIEsQDjnKcf5RZgg/tMaCZEp7o4sVfHvbYoV8vIo1U2EtgXTQhSfrRuKItb2joJgHbgSd5OOlpc02W5KR3pEHS/72kKiSOfwFyiMwbOQtX1UdudqZLuBR7ukD44Sf1FbxqONihZ23WCheW1ppTA9Xn6MkO4vspkvzoLmbJwcZNfqNrO86lNOFLPPGCvQsan6tXtm2V1Lqdj9+hFm++CCCPaTjXms6kct3BDfniDIJ1qlbNBBKex5Dy10YDuDlV4EemZxn/TsD+jLP3XAGcZ/DvqduufSgTGN+f20KQ9RcgPyIorlplxEhv4kuP3cCoEHZFzZZ8jDc3RV6f+v2JKU0FnAzeL73HHzGxzi5VrKktxA+ymG+A1 Cz2nY8l4 E9W8P+z/eb9NK0t5CO8fwou/wy6/OFVGWT3bGjT2nZBvwCO04v7dYDoXjhovijfEBaN5QMMSe+Mf1BSdCgXj/DaozmDuDgj2OkmlAoqTbiK3eUd2F7p+I0nrKucnzAWZYAZ2BbesvpBG/TNXMxH0jeV2o37WKsMC82IDBr3+GFf1BkSZO+hrDUkzKDZAoJM1qHyCaQfrEyeS7uUKEFPCk6GtoSi0pzBDizjmMRAzpQtpaWEbYCbcNZ0CvcCTMOF5s/9ugOcHfaXTHHquneaOXDI9Ppg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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