Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7316567rdb; Wed, 3 Jan 2024 11:30:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IFBZUbFUTXPJ2wsa+51nsweRNAouq6r9UX4N7rPM0mVfh2p7CtlcdxuWSjR9mb6LAuvLeuh X-Received: by 2002:a17:907:2666:b0:a28:b9b8:2f8c with SMTP id ci6-20020a170907266600b00a28b9b82f8cmr237685ejc.152.1704310207825; Wed, 03 Jan 2024 11:30:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704310207; cv=none; d=google.com; s=arc-20160816; b=1JjHZuIYdA/7hUMsZk9h2j7/a3neMNASsTpPRgsjmxJUASRWZdP69l+e5gI1Dc18pF wk8KAiltdwf7mohrGO84p2F3hT8EyBUDQzoV6kIU+65r3z2HCy23Latjw7YOVvDFaSQE 487yPI7vj/7OC49Noldkive9SQ8lZ7aoDGF23Ea3c4V9WL7rjceYfzgEG7Gcd0X9Lba2 l7ruRqOQ00b3sNIuvh9eXcqmqNYqBf1ZbqbclHUqXPdSw6Tlu+Hu3XusX2c5tiE02uiz V5xavHWZ2VKvk2Dznf+OHyHlN6qua9c50oiINc73NL1trlgRpg7a83jM2qKDnOHmCzx4 XMhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=r4WonXh2TW2pUeGdcdhmWCQtMS4DevwM90f3GogkdD0=; fh=LCL/ACy2Wt4hF880rplFy1yv0BtnYFZp7eUyRRHyEA0=; b=GeRPfXJnUMePApU8NDjM3v7XIWNKtC0wdlOtGZzj2r6ir0iuwiLx939rsdk5nPRgXx hnveQ6miJqyYpePgexfJ3WDWrVYAWyz/ZPAwaagaVcPn9l34NimShYOEPTqhnKg5j/CU tKIkh7zeE8ErJPiLP+75Wg/V/31MfHrPeVgcUvrua+CSClnbUup2AicoyhSxUqZczZ2O gx8kycg0XkJDij9tTtdz77qPNOqZn34ayDc7bDviBMiiKxdwOaBBCaPQQDC9NffFiQye FTOzQPKjHwnNpbjmsLOhVeyv741j+KrHIRjaJdLsd05i+ayPibcvAj68idrmNrxSIrPm 9Lkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a7TVXpZr; spf=pass (google.com: domain of linux-kernel+bounces-15913-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15913-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id oq2-20020a170906cc8200b00a26f1e22c1esi7634205ejb.311.2024.01.03.11.30.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 11:30:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15913-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a7TVXpZr; spf=pass (google.com: domain of linux-kernel+bounces-15913-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15913-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8B1991F25674 for ; Wed, 3 Jan 2024 19:30:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AB9841CF9C; Wed, 3 Jan 2024 19:29:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="a7TVXpZr" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D81B31CF82 for ; Wed, 3 Jan 2024 19:29:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5768AC433C8; Wed, 3 Jan 2024 19:29:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704310188; bh=Unr4OY0Hx42q1pzNznUCuug80mRkrj/aXFvZHPSqafo=; h=Date:From:To:Cc:Subject:Reply-To:From; b=a7TVXpZrmMPVW+N9r64ybQlcCK17O9AndoUM3kYIJkOHrzb6JV3zyDtEZ4OsRnxXu 6lv9sYBzzgjpsOqS+/9dkiJPYhcZj7ssJ/0S/jGPigO+1cbKaWygnOXr5QTRbyhII4 hHytQVLC3OtTMwDFO2XUXb3kFsPkwJVeW48TlZrIH85PvbpxD7f4u+3k3C9O/Ph+l6 8NB+hI2DKKrhFQItSGWs5RrjQb7M+H+tTiPjzRzoYPfEnldW+oEvYN+rvb5V4+1/zS slgFUYPs3moQWEhyMnT77fZpFOfSTHtttRDO20xtfXeoNntpHkaWb0pM3rXxC9wD8B 4GaxU5Fuxdnpw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id DB2CACE09BD; Wed, 3 Jan 2024 11:29:47 -0800 (PST) Date: Wed, 3 Jan 2024 11:29:47 -0800 From: "Paul E. McKenney" To: Frederic Weisbecker Cc: linux-kernel@vger.kernel.org Subject: Prototype patch to avoid TREE07 rcu_torture_writer() stalls Message-ID: Reply-To: paulmck@kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, Frederic, You mentioned rcu_torture_writer() stall issues on TREE07. Does the patch shown below help? If so, I predict that your bisection will converge on commit af19a2526cba9 ("rcutorture: Add mid-sized stall to TREE07"). Thanx, Paul ------------------------------------------------------------------------ commit 7e9794bb7017593da427f555e4e23da2d42744e5 Author: Paul E. McKenney Date: Wed Jan 3 10:59:25 2024 -0800 rcutorture: Suppress rtort_pipe_count warnings until after stalls Currently, if rcu_torture_writer() sees fewer than ten grace periods having elapsed during a call to stutter_wait() that actually waited, the rtort_pipe_count warning is emitted. This has worked well for a long time. Except that the rcutorture TREE07 scenario now does a short-term 14-second RCU CPU stall, which can most definitely case false-positive rtort_pipe_count warnings. This commit therefore changes rcu_torture_writer() to compute the full expected holdoff and stall duration, and to refuse to report any rtort_pipe_count warnings until after all stalls have completed. Signed-off-by: Paul E. McKenney Cc: Frederic Weisbecker diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 50ac86a34876..b4317ef1b092 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -1372,9 +1372,13 @@ rcu_torture_writer(void *arg) struct rcu_torture *rp; struct rcu_torture *old_rp; static DEFINE_TORTURE_RANDOM(rand); + unsigned long stallsdone = jiffies; bool stutter_waited; unsigned long ulo[NUM_ACTIVE_RCU_POLL_OLDSTATE]; + // If a new stall test is added, this must be adjusted. + if (stall_cpu_holdoff + stall_gp_kthread + stall_cpu) + stallsdone += (stall_cpu_holdoff + stall_gp_kthread + stall_cpu + 60) * HZ; VERBOSE_TOROUT_STRING("rcu_torture_writer task started"); if (!can_expedite) pr_alert("%s" TORTURE_FLAG @@ -1580,11 +1584,11 @@ rcu_torture_writer(void *arg) !atomic_read(&rcu_fwd_cb_nodelay) && !cur_ops->slow_gps && !torture_must_stop() && - boot_ended) + boot_ended && + time_after(jiffies, stallsdone)) for (i = 0; i < ARRAY_SIZE(rcu_tortures); i++) if (list_empty(&rcu_tortures[i].rtort_free) && - rcu_access_pointer(rcu_torture_current) != - &rcu_tortures[i]) { + rcu_access_pointer(rcu_torture_current) != &rcu_tortures[i]) { tracing_off(); show_rcu_gp_kthreads(); WARN(1, "%s: rtort_pipe_count: %d\n", __func__, rcu_tortures[i].rtort_pipe_count); @@ -2445,7 +2449,8 @@ static struct notifier_block rcu_torture_stall_block = { /* * CPU-stall kthread. It waits as specified by stall_cpu_holdoff, then - * induces a CPU stall for the time specified by stall_cpu. + * induces a CPU stall for the time specified by stall_cpu. If a new + * stall test is added, stallsdone in rcu_torture_writer() must be adjusted. */ static int rcu_torture_stall(void *args) {