Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2337318ybg; Thu, 30 Jul 2020 17:41:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyn7v2DdYxLsUzGYTWgmEq/yE3w/HE3+Js4TEHB3TiscHIN8Shl9rJIvB0wMNNjXhzad3cw X-Received: by 2002:a50:bece:: with SMTP id e14mr1558750edk.190.1596156089146; Thu, 30 Jul 2020 17:41:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596156089; cv=none; d=google.com; s=arc-20160816; b=vETkHAsNot9dFkomUefX5ArP9p5DHkNxyi2pAhFNlwFyclXtUZPYZoM82+vbOcvxA9 gk3Igb7+i7SBy47ALdC7FmcNOcD5caArPO8U3zIUx8coqvLCpBOg4owYjy6GT5pTA67t SmxR3kg1u2UZ06Gnlr/Bj49S0sGitzndXhgj6nTDDwTe8leU+jrzz71mIwuMoV9fIjEO +RxPEvlFSi5/z1iK4r11ra9Ya17SZulblEpqOKG2V40DptM/MlJqgklvB+LjFqCKwNUf yamheGMm28W2HuxFphrJZu3A7WTaPAqEW4kJbFGAFD/w74wZBeGpvdTeZqWm38LDXKVH YTXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bbCcJZmt6eGN4Co8J2+ytDC8kXUiakoxhSvDXw3GNYk=; b=kYdf2HA+Ct46ot18UE9eBqK7HLLckGeWc67jz3EoCD4mn2MlbTW8KUXneOg09JiAGo EbKMa123f8bBrt4is1GuABmIxd5PqkxB7JLf+a68YEcLU5HIZ1U4NLOiPF+86DQXryhO uZv1dWbqt3cvTRc/ua3A6rxK/KMIryXxZrY5RqZ6Ri1s2k+Ga0XHAXNz/epqiUm2OsQu ywOBdoietgx63Ta3q34jY4XmdpJXS3mCNfw5PTdmcn/x9sHjV7I6FDKcadEdGayfGv9S Q0sJAauYai3sd1s42H4sf+Ije4OQLzaCpGOZc/tpANQaVN3lGpvTnFAKQ6rMKLjipMft y7gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=m3roDEvL; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n5si4310037ejl.286.2020.07.30.17.41.05; Thu, 30 Jul 2020 17:41:29 -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=@joelfernandes.org header.s=google header.b=m3roDEvL; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730994AbgGaAkb (ORCPT + 99 others); Thu, 30 Jul 2020 20:40:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730980AbgGaAk2 (ORCPT ); Thu, 30 Jul 2020 20:40:28 -0400 Received: from mail-qv1-xf42.google.com (mail-qv1-xf42.google.com [IPv6:2607:f8b0:4864:20::f42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A02F2C061575 for ; Thu, 30 Jul 2020 17:40:27 -0700 (PDT) Received: by mail-qv1-xf42.google.com with SMTP id dd12so8396330qvb.0 for ; Thu, 30 Jul 2020 17:40:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bbCcJZmt6eGN4Co8J2+ytDC8kXUiakoxhSvDXw3GNYk=; b=m3roDEvLZDluWMv4Jf0eK6iWRB7TE4WjwUmvl+Ztv1l8tlV3g5pqoewEx1NRGudSME bWnThrRj4f8XlOdkMX/Exib4j0mVJFa2bljwKeGs7+0toMNQeYwrepJ71djn7uHgLt2P u8cQ277PfKk6UV6kHQ3nSxlf+tB6jNBkysGHg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bbCcJZmt6eGN4Co8J2+ytDC8kXUiakoxhSvDXw3GNYk=; b=Ew1FRevfqpePQxQEBLEgXxoF2Bh5oGGbOrmEXUIUTFdj7jHtcjG9TN5+k+yVjYNoYN nhkwt8pv173S5R6MWYSw1vZCmBstAQ5kLhExmNI2j7v33qbfviN+K+vRDRQjXMbOr3bi VEwsh093pA9O2sYsICZczly1qZ7hoYLdKmkpcHZMurooqsQf+8po865QjnvtcZ1MNLGg zgkHPeNgZClSZP53j6Vltw0pvIvCf3se5ffgJG1xILWm4ip26fUgV+KizVbqzGk09VZz HSLAV6eyymsxdeb/0Lh5A3jFaY8Yi8Z9o7T732pAqRtEZAnwIAAgUVP6O4jFlb5zX75s D85A== X-Gm-Message-State: AOAM532YTWYjXgJ73/1C3+9KzaqGlDkvs9EASDHpk5FRf+B4vwX2aP1J H63oCYlbKzkMdbCRZ4TXvZxGosk8Ndw= X-Received: by 2002:a0c:c781:: with SMTP id k1mr1720225qvj.223.1596156026599; Thu, 30 Jul 2020 17:40:26 -0700 (PDT) Received: from joelaf.cam.corp.google.com ([2620:15c:6:12:cad3:ffff:feb3:bd59]) by smtp.gmail.com with ESMTPSA id c5sm3077320qtp.62.2020.07.30.17.40.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2020 17:40:26 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: "Joel Fernandes (Google)" , Josh Triplett , Lai Jiangshan , Mathieu Desnoyers , Neeraj Upadhyay , "Paul E. McKenney" , rcu@vger.kernel.org, Steven Rostedt Subject: [PATCH v2 3/3] rcu/tree: Make FQS complaining about offline CPU more aggressive Date: Thu, 30 Jul 2020 20:40:12 -0400 Message-Id: <20200731004012.2324147-3-joel@joelfernandes.org> X-Mailer: git-send-email 2.28.0.163.g6104cc2f0b6-goog In-Reply-To: <20200731004012.2324147-1-joel@joelfernandes.org> References: <20200731004012.2324147-1-joel@joelfernandes.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make FQS loop consider it an immediate failure if the case of an offline CPU reporting QS is detected, instead of a full second. This is because rcu_report_dead() already reports quiescent states and updates ->qsmaskinitnext under node lock. Light testing with TREE03 and hotplug shows no warnings. Convert the warning as well to WARN_ON_ONCE() to reduce log spam. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index a621932cc385..39bdd744ba97 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -1208,13 +1208,15 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp) return 1; } - /* If waiting too long on an offline CPU, complain. */ - if (!(rdp->grpmask & rcu_rnp_online_cpus(rnp)) && - time_after(jiffies, rcu_state.gp_start + HZ)) { + /* + * Complain if an offline CPU by RCU's books has not reported QS. Node + * lock is held ensuring offlining does not race here. + */ + if (!(rdp->grpmask & rcu_rnp_online_cpus(rnp))) { bool onl; struct rcu_node *rnp1; - WARN_ON(1); /* Offline CPUs are supposed to report QS! */ + WARN_ON_ONCE(1); /* Offline CPUs are supposed to report QS! */ pr_info("%s: grp: %d-%d level: %d ->gp_seq %ld ->completedqs %ld\n", __func__, rnp->grplo, rnp->grphi, rnp->level, (long)rnp->gp_seq, (long)rnp->completedqs); -- 2.28.0.163.g6104cc2f0b6-goog