Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp6184795pxb; Wed, 21 Jul 2021 13:50:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxPy62SAbYSKFx2qvFb7/2eqkKYFN+r1+0p0ZYYmqQJGSWNX28/vfnlgkEef8+OAxaty8p X-Received: by 2002:a17:906:1b14:: with SMTP id o20mr39723305ejg.204.1626900630281; Wed, 21 Jul 2021 13:50:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626900630; cv=none; d=google.com; s=arc-20160816; b=c6e5gmYp30ehTaFzWADrC7ERZZPi6th8GTfRc3ker81F+98rRnd7LuI7675p5f/myU XPPCFwFwnfUPKn42uvgOfijgq4RSVjU0X7YB5RRMvp4jGHGMX4bcIg/xTS/jtDYey9cG EsBmiAMIBNvXa3k48r12yeV6vnmW1TWjlPzUNoAxeY7AeXw9uHeKGjHeTHofoWfc/KvQ h20Xk4kfnIDGjEI0pMixfS98N2R5jNbfBbmR3Ru0lrdagCe/NDnlOkCrRLSnjo/JFdeJ ZOGLHS3tQLTzhRAarcCCiSU6Oa3YYyPUPiQsEfMDMPi7XpN7RBYaDAdDkwERJd8ZOhLk 6HVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=F/wZLyNHaWGKN8S32nhyQiLRwL5RwYWwaOlQEnCFKTg=; b=P5eQj88bcj5TaLCOqfPEAIQtAifd782w4F9P++c4ekpyUAgqD9SmVUcmPnlS3rIiUa hmkYPJUrfA/KOqtDEZR9iqvk/uN+Ty5lE26z+iQGR2lqMUbx45/3VedJVo2nI6/Gw2gB 6Yc5OxFaDUM63vU4l/NiquDpSuc+1NhVhSv4WOd3zlUtHaw/Z86igj+7KfYgzpXLSmE3 diLxhbjJo4+Y3dhsbYkY7E+DbynSR7q/czB/J08otHam4nlDpPLSSUGokZga4RKAW89z vb46UxUvOsrV+yb4YgV20CCpeSQRgvEJu4Px5nnUnGy7FT7/5GxI+d2sc0PQ0w1+slvF O24g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U5nAYhXV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bd12si30046423edb.236.2021.07.21.13.50.06; Wed, 21 Jul 2021 13:50:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U5nAYhXV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S238059AbhGUTlH (ORCPT + 99 others); Wed, 21 Jul 2021 15:41:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:50066 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236645AbhGUTkx (ORCPT ); Wed, 21 Jul 2021 15:40:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A08B661353; Wed, 21 Jul 2021 20:21:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626898889; bh=QUqMqT880NTnSp4mKtTyqHOCDRWBO5LbjpDhT+NOKN4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U5nAYhXVaf1nG9NC1Fd/CoKUkFS0v6Qc8tH6fy3MJtu/2UIM7IMrBLVozP3zoKHrq nlx4G+KdlD7sQFFCHIiUp1vSeekJSp16g0o7vjz9xG33ynRPRHusEyxOzoFy4TFT1x Eo/IEs2U4pA6d3B69TYTGIUTmgLKWBbSSy3h9VI80vXhY/G4ukUzc6Zzd27PVhBdbs t3PDZkml3zJsCzINuxo6IYo/V9DOxjXG+sezpE4wUjjcWWAxicU1JD+rXwvfS4A+jg kor7rE2hxPNUPXBR+BuJK7gvAwmo7ljgJ3XBNjKo5cT7J7AgSeVHP9u9F4pzfLlRNe HlCOjionKi85g== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 23B0A5C0DBB; Wed, 21 Jul 2021 13:21:29 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, mingo@kernel.org, jiangshanlai@gmail.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org, Sergey Senozhatsky , "Paul E. McKenney" Subject: [PATCH rcu 08/18] rcu: Do not disable GP stall detection in rcu_cpu_stall_reset() Date: Wed, 21 Jul 2021 13:21:16 -0700 Message-Id: <20210721202127.2129660-8-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20210721202042.GA1472052@paulmck-ThinkPad-P17-Gen-1> References: <20210721202042.GA1472052@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sergey Senozhatsky rcu_cpu_stall_reset() is one of the functions virtual CPUs execute during VM resume in order to handle jiffies skew that can trigger false positive stall warnings. Paul has pointed out that this approach is problematic because rcu_cpu_stall_reset() disables RCU grace period stall-detection virtually forever, while in fact it can just restart the stall-detection timeout. Suggested-by: "Paul E. McKenney" Signed-off-by: Sergey Senozhatsky Signed-off-by: Signed-off-by: Paul E. McKenney --- kernel/rcu/tree_stall.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h index 0e7a60706d1c0..e199022dce9dc 100644 --- a/kernel/rcu/tree_stall.h +++ b/kernel/rcu/tree_stall.h @@ -119,17 +119,14 @@ static void panic_on_rcu_stall(void) } /** - * rcu_cpu_stall_reset - prevent further stall warnings in current grace period - * - * Set the stall-warning timeout way off into the future, thus preventing - * any RCU CPU stall-warning messages from appearing in the current set of - * RCU grace periods. + * rcu_cpu_stall_reset - restart stall-warning timeout for current grace period * * The caller must disable hard irqs. */ void rcu_cpu_stall_reset(void) { - WRITE_ONCE(rcu_state.jiffies_stall, jiffies + ULONG_MAX / 2); + WRITE_ONCE(rcu_state.jiffies_stall, + jiffies + rcu_jiffies_till_stall_check()); } ////////////////////////////////////////////////////////////////////////////// -- 2.31.1.189.g2e36527f23