Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp4416898rwb; Tue, 17 Jan 2023 00:03:28 -0800 (PST) X-Google-Smtp-Source: AMrXdXvHvPHnnwuyLHvBgl+P/VBpQ1+rxR1trBjFVZgQpoYF+7w/i6WCJCi5VB2cBO4IblNQD6PG X-Received: by 2002:a17:907:29c4:b0:857:b916:94bd with SMTP id ev4-20020a17090729c400b00857b91694bdmr1489976ejc.60.1673942607867; Tue, 17 Jan 2023 00:03:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673942607; cv=none; d=google.com; s=arc-20160816; b=HdH9DVED5pB9pp8k+F6OmAH6VFSa1Dizp79uVano486a5i/gEZ8kh2qVEBr24AKChe nnx7GY0wcS9bGIX2SYIfIAHPz7+udiSnfjIqIPWFDw7NPWYm0W9hzwT7EmvzQHMbnkxJ AeYKwFYFTlv/c/4GFLZS/SlgDskthUEONLrFwdmr5BIJz7W/eMb3Kmi3vgSXL8AsyrdI TnnIo+mUc5VUj7qhANhU/KhSFAkB42SMd9UTKra5k3KkN8pwet+s4GCtB0a3wHwZAbym 3KL+12NxmFr++O2ynfdOsR4LTfnkZYbMj+m1sclvv7L4Z1H7qlVLxiM6usRgVK/GBf4F bcKw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=SpoVQ2Ty9NKU9zZ3li/emwgN9dDbz0LRg6SiX6DXnO0=; b=vRTRbQWIobA/1QdTumnEmT0kP9qYgij0vEzpehnupIkCnxgUxXPMnb9xZVkcUMpPwo HHtsn2udXafH9lKsUyptagZz9Xz8VmBwq1WMb4ZpNdA8rktOmdMr1iD2egRsg6KaHNgW z3+5vS3qhmqjFQubxpsr8hBidlqvK3k/gO/i4QAdPSBS0byUyiUKaT4/BDBx92jCc4NY vW2slV7bFQXxo0jrRXC9/qw7ffZ/QPFiLcy884F6m3LHiiTfQlq6QgD3pX3RV+bHfySm nItYoq4qGAV/qLzfFO0Gs6KHvWqt+KBm5o+KcIUClluwPRfPZChngDj1ZEXckb+AdGwz u8UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gZarcBaT; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz18-20020a1709077d9200b00871f4a5d229si3302206ejc.420.2023.01.17.00.03.15; Tue, 17 Jan 2023 00:03:27 -0800 (PST) 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=@intel.com header.s=Intel header.b=gZarcBaT; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235898AbjAQHjw (ORCPT + 49 others); Tue, 17 Jan 2023 02:39:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235896AbjAQHjq (ORCPT ); Tue, 17 Jan 2023 02:39:46 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98862241F5; Mon, 16 Jan 2023 23:39:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673941181; x=1705477181; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=OymUx5WFjRv4twSVzDF5ORdlt+mfD9H/c4rO83TER9k=; b=gZarcBaTIflOUJCxCiHigjdGKzytGOadQXQW6hZQ92AGG0267HfkR+ga PYIH+MN33lmfEpDjZzTtd0EqINW+bqSlOglsN9f9z+qHKryAO/2eCyGhX ML+AInPYTBB1MJ0re2jUD1sCzqTS8MdNYzes8uGur+SLPE8MTgavZlnqc pSkHgwVLLoS/wu5FT3zLGY4Glt6/jpjbpzH3H7oTsBMkUP8PZjh7GpnOl eY19xCXeepHC7N1vxbPH5woKZwUwVl/XyyyeSv9Ks27W0KogterPKuxVG BQtZCI9yVbRDz3Hwe4tvfQU23mW4zW/VcJLl3Tc7++NuWYv6udoxK5bfO g==; X-IronPort-AV: E=McAfee;i="6500,9779,10592"; a="410871143" X-IronPort-AV: E=Sophos;i="5.97,222,1669104000"; d="scan'208";a="410871143" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jan 2023 23:39:29 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10592"; a="833067078" X-IronPort-AV: E=Sophos;i="5.97,222,1669104000"; d="scan'208";a="833067078" Received: from zq-optiplex-7090.bj.intel.com ([10.238.156.129]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jan 2023 23:39:27 -0800 From: Zqiang To: paulmck@kernel.org, frederic@kernel.org, quic_neeraju@quicinc.com, joel@joelfernandes.org Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] rcu: Remove impossible wakeup rcu GP kthread action from rcu_report_qs_rdp() Date: Tue, 17 Jan 2023 15:44:43 +0800 Message-Id: <20230117074443.1982347-1-qiang1.zhang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 When inovke rcu_report_qs_rdp(), if current CPU's rcu_data structure's -> grpmask has not been cleared from the corresponding rcu_node structure's ->qsmask, after that will clear and report quiescent state, but in this time, this also means that current grace period is not end, the current grace period is ongoing, because the rcu_gp_in_progress() currently return true, so for non-offloaded rdp, invoke rcu_accelerate_cbs() is impossible to return true. This commit therefore remove impossible rcu_gp_kthread_wake() calling. Signed-off-by: Zqiang --- kernel/rcu/tree.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index b2c204529478..c78d48482583 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -1956,7 +1956,6 @@ rcu_report_qs_rdp(struct rcu_data *rdp) { unsigned long flags; unsigned long mask; - bool needwake = false; bool needacc = false; struct rcu_node *rnp; @@ -1988,7 +1987,7 @@ rcu_report_qs_rdp(struct rcu_data *rdp) * NOCB kthreads have their own way to deal with that... */ if (!rcu_rdp_is_offloaded(rdp)) { - needwake = rcu_accelerate_cbs(rnp, rdp); + WARN_ON_ONCE(rcu_accelerate_cbs(rnp, rdp)); } else if (!rcu_segcblist_completely_offloaded(&rdp->cblist)) { /* * ...but NOCB kthreads may miss or delay callbacks acceleration @@ -2000,8 +1999,6 @@ rcu_report_qs_rdp(struct rcu_data *rdp) rcu_disable_urgency_upon_qs(rdp); rcu_report_qs_rnp(mask, rnp, rnp->gp_seq, flags); /* ^^^ Released rnp->lock */ - if (needwake) - rcu_gp_kthread_wake(); if (needacc) { rcu_nocb_lock_irqsave(rdp, flags); -- 2.25.1