Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp351281rdb; Thu, 24 Aug 2023 08:00:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFrNAqYs1PbUce8C90ieRH3VxJvKNiPTUfWzHgwDKqlVxTnQVkOfJ2pQEAe/Cf94MAJ8bUq X-Received: by 2002:ac2:5e90:0:b0:4ff:ad35:8dce with SMTP id b16-20020ac25e90000000b004ffad358dcemr11255958lfq.22.1692889252694; Thu, 24 Aug 2023 08:00:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692889252; cv=none; d=google.com; s=arc-20160816; b=T3It4QVcoKFuAW1nsGI16qkjPqnNwgII9cUmOytZodyykuYjh3lJrVt/5rC1Kr1RHL CPyEzKKRh+pcPJGuVAooWp0980w4eUKKtXbP0vJYI33rDc9wK1RV/NZeIVkgxbmO/zqo xNPqsQkvogRAv+TBO6KKpYscfM+ujpcF8ls6qndJ03wbkYMFaK0yYZmOwlb279joX781 qTFuUDklXqlmyksJNQJpMsK7GT4WANDYwg64pEya8+aV9kwr6lpyksc2qi96gfAb1oYY qr0r1oB7UhUMNZmmufKYU52sGkuJwV/+bo9iP0hVgWj1DeiW5i0IabQkudShQawnz4TJ hgTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=vmw878lU/GzB2IN0KRvPYau/5RAMwsKERV57pqR5gxg=; fh=+8Yjxg5Hq5Qkh2kueyrMf+MPDuGm9TqkpgnpsBzK6eo=; b=HloUWBFYflQg69Sg0Y7Heb+HcR5HW1GzQpm9LI4qhFn1u97j2aJbRCR9beKWyT6ZzI lCOjbCHZyGDIEvxLnJF/XcywH7+a/dJRb+u9NP2gpWQrkddkBTBR7c5uQDP+lJWuhTi3 OdTdVluyb53SHlM+dFjoYYj0oInZhgQPEZcY2zcIeufofFRJWVsEnOPFvZUVcZF++VWB 13kGz+VekRbrwqFt2nuVL4tTcbcMvmAsvsbLKefdu8ymVO6vgMgiKfaCEENhLHsCFmgi XDnhnNjfrfK+VAA2TyRyFJlq+ci3QwuBwBbQXsevqLb6g0YkKL55hqC+f3/nXt8os92g HohA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nYagsicH; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j10-20020aa7ca4a000000b0052a0e8105c5si6203758edt.382.2023.08.24.08.00.23; Thu, 24 Aug 2023 08:00:52 -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=@kernel.org header.s=k20201202 header.b=nYagsicH; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241108AbjHXMxz (ORCPT + 99 others); Thu, 24 Aug 2023 08:53:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241389AbjHXMxj (ORCPT ); Thu, 24 Aug 2023 08:53:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F91E1BC5; Thu, 24 Aug 2023 05:53:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2F7A66186B; Thu, 24 Aug 2023 12:52:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8AACDC433C9; Thu, 24 Aug 2023 12:52:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692881564; bh=m8mTnCQFLBbU5msxA8RyJb+S6cYHpqcaY6LDaPQO678=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=nYagsicHZmErqj8eCXNxvs0bBsWBeRg3Ll/kSwJITXFOBcJAhtGfdVKYEzEl9VdPA 1DPv5pCvqQF7t9QqTw+e+ZXUU3cRPFrZD3vFxQBxxI3F7cQGrJtb9LjLNZk+5XWr3C FBYZY8uGP6zkgxHqCyhYEK7WqU8hcSj2oiZiGKH04i5YQWnwTILrei92KXbGtxsoZN vTTNX0NCu8NS+Pdfd5jBVkYyty2Nksac8nYeN4ageuiBKFEfycAxSUoVA+6r2LRydC vWuXYZztY0vnUqcZTdpd6BCMiYwQIfYta6S63xOz6Xxj0h+9krQH6qeVhRV3+tZ13i 81uaoq/+SVzIQ== Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-523b066d7ceso8428480a12.2; Thu, 24 Aug 2023 05:52:44 -0700 (PDT) X-Gm-Message-State: AOJu0YypjnTiBkemzyqWtcjdxIl3/lAaCjBQffTmFZScyNCJm5Sbd11w P3SX93bEuE5qmolSmQGkO8Ip3pCHZe8ZFUem3V8= X-Received: by 2002:aa7:c508:0:b0:524:547b:59eb with SMTP id o8-20020aa7c508000000b00524547b59ebmr11870649edq.15.1692881562847; Thu, 24 Aug 2023 05:52:42 -0700 (PDT) MIME-Version: 1.0 References: <20230822040248.329442-1-chenhuacai@loongson.cn> <87lee0dbmi.ffs@tglx> In-Reply-To: <87lee0dbmi.ffs@tglx> From: Huacai Chen Date: Thu, 24 Aug 2023 20:52:30 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V3] rcu: Update jiffies locally in rcu_cpu_stall_reset() To: Thomas Gleixner Cc: Huacai Chen , "Paul E . McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Sergey Senozhatsky , rcu@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Binbin Zhou Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 Hi, Thomas, On Thu, Aug 24, 2023 at 5:37=E2=80=AFPM Thomas Gleixner wrote: > > On Tue, Aug 22 2023 at 12:02, Huacai Chen wrote: > > + * This function may be called in NMI context, so we cannot use ktime_= get_ns() > > + * and ktime_get_coarse_ns(). Instead, we use their inaccurate but saf= e friends > > + * ktime_get_mono_fast_ns() and ktime_get_seconds() which will cause r= cu_state. > > + * jiffies_stall to be a little large than expected (harmless and safe= r). > > What's inaccurate about ktime_get_mono_fast_ns()? Bogus comments are > even worse than no comments. ktime_get_mono_fast_ns() is not as accurate as ktime_get_ns(), I get this conclusion from: * So if the update lowers the slope, readers who are forced to the * not yet updated second array are still using the old steeper slope. > > > */ > > void rcu_cpu_stall_reset(void) > > { > > + u64 curr, last, delta; > > + > > + curr =3D ktime_get_mono_fast_ns(); > > + last =3D ktime_get_seconds() * NSEC_PER_SEC; > > So this will trigger a warning when someone debugs suspend with KGDB. Yes, ktime_get_seconds() may cause a warning, I haven't noticed this before= . > > It seems the approach taken here seems to be to throw stuff at the wall > and see what sticks. I don't understand what's meaning, but I believe your advice in another thread is the best solution, so let me try. Huacai > > Thanks, > > tglx