From patchwork Tue Jan 17 02:19:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zqiang X-Patchwork-Id: 13104062 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B47F9C46467 for ; Tue, 17 Jan 2023 02:14:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234598AbjAQCOn (ORCPT ); Mon, 16 Jan 2023 21:14:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235193AbjAQCOm (ORCPT ); Mon, 16 Jan 2023 21:14:42 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76E311EFF8; Mon, 16 Jan 2023 18:14: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=1673921681; x=1705457681; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=VXpsPYKez3Jyml+yygKHWnUH1klujIbfV60IJCU7RIM=; b=i5R3k2wymEI8bAbCoayPGXScIXoB8HkyZjzb01Pc8ieCZX/glUK9cWmr HKoA6bBurck2lAmI5xCzGWqqzlBDbzgQa6eNH/xupNtRhCc9TPIktvzsI BgW0zamA4r0BVbsNkGtLIgXFPRDjkUPS1822OJgisVdxePgwFwRHDgsId coetSAZUE/DB1pgX8moqXRqjsdRT11m7seusBSJNQlvMNl8m9jQOOZ+iP YU7uvVnIoXHoi5WAqi9Z5hv81Pu8He9Xg62uy2zrWvDRbL2yOC+ggeOd9 4nYiccSUHdxahW6jBheawbCxjzxzGECTlWijU7/Ekbkce3gOkGtSOwTPb Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10592"; a="351839787" X-IronPort-AV: E=Sophos;i="5.97,222,1669104000"; d="scan'208";a="351839787" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jan 2023 18:14:41 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10592"; a="691442801" X-IronPort-AV: E=Sophos;i="5.97,222,1669104000"; d="scan'208";a="691442801" Received: from zq-optiplex-7090.bj.intel.com ([10.238.156.129]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jan 2023 18:14:38 -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] rcu: Remove impossible wakeup rcu GP kthread action from rcu_report_qs_rdp() Date: Tue, 17 Jan 2023 10:19:55 +0800 Message-Id: <20230117021955.1967316-1-qiang1.zhang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: rcu@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..477eb1a374e5 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); + 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);