Message ID | 20230117021955.1967316-1-qiang1.zhang@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1518516wrn; Mon, 16 Jan 2023 18:34:56 -0800 (PST) X-Google-Smtp-Source: AMrXdXupMJsgmAydxBGBUJZOxYR4qFRfYlTPln4w58vFAXR1bNsqGPY6N3LkNjOb7rmug59erylH X-Received: by 2002:a17:906:6b8d:b0:7c1:4d21:abb7 with SMTP id l13-20020a1709066b8d00b007c14d21abb7mr1234444ejr.54.1673922895828; Mon, 16 Jan 2023 18:34:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673922895; cv=none; d=google.com; s=arc-20160816; b=S5yiCJGt3U/8Mt7pt/TFQ3Jtf+Quq7cxvswkuaYSwb18xOltrDnT0ea5fCKtsH0AkD ms2NGwyv3h4ozR7r3K+aFkHhXWGS287wgD6AMwHKJsWKfJxEU18IhkoBP300/JiHRGU5 FL+N/rVyTWp6woh/HXzu1GzGx9cr2MFuY7FadXKsgLmkU13hnLLzwRm8ViWgwC3FcMgJ Kzra/Ya5rBNndaJUguOTRor9owwV5HBRdSXkFzegeCM4fMdzVBUXI4NsTt/jh4ellWih suZErvm/6A3OrAHjEJE49e3gXdfcxyR7k3H6mUC7VJgIInvQLRWplmyOjwv4Yo8cAe8R tvrg== 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=g+OCAvJ3dUvdgXDPC6pdoBb7isk+udMxw6u9yNbGS30=; b=MwZwOx009gECSjFgOSRUBQ9k4io3TNgMy9APiyfJKF0oTo3jf+QOSZNNVTAuPf8hfn 8tnJYzzThPw7FYhcBQNc8iXqj6btH7MVogSYA9giQZ9PKRd7xJGGZiW8EswkloQTIZdC Z/ezblS720+pIiEOE7F7CJiUvYgl27PRHgUUviwI6jQ4l/u2IRJ6Hv4mzDoiT3nzG/JJ RcLfju/cRTKy42NgJwu84cGy8KsQ2ZtkhWTR4FBYppF6Llyk0GaEncs173beiSsB4+Ma czsyWlJTCbKmEvJj1BFkKyWLuhTzLErajcEBcn4loy/xTD2LQ/8UIjCT89SzWbX+0iLj b0ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=i5R3k2wy; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f11-20020a056402068b00b0048bffdbb775si11676154edy.202.2023.01.16.18.34.32; Mon, 16 Jan 2023 18:34:55 -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=i5R3k2wy; 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 S235303AbjAQCOp (ORCPT <rfc822;stefanalexe802@gmail.com> + 99 others); Mon, 16 Jan 2023 21:14:45 -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 <rfc822;linux-kernel@vger.kernel.org>); 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 <qiang1.zhang@intel.com> 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 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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755235374380639373?= X-GMAIL-MSGID: =?utf-8?q?1755235374380639373?= |
Series |
rcu: Remove impossible wakeup rcu GP kthread action from rcu_report_qs_rdp()
|
|
Commit Message
Zqiang
Jan. 17, 2023, 2:19 a.m. UTC
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 <qiang1.zhang@intel.com>
---
kernel/rcu/tree.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
Comments
On Tue, Jan 17, 2023 at 10:19:55AM +0800, Zqiang wrote: > 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 <qiang1.zhang@intel.com> > --- > 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); If it is impossible, we should use WARN_ON_ONCE() or similar. Just in case the system disagrees on the impossibility. ;-) Thanx, Paul > } 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 >
On Tue, Jan 17, 2023 at 10:19:55AM +0800, Zqiang wrote: > 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 <qiang1.zhang@intel.com> > --- > 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); > >If it is impossible, we should use WARN_ON_ONCE() or similar. Just >in case the system disagrees on the impossibility. ;-) Thanks for suggestion, I will resend v2 😊. > > Thanx, Paul > } 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 >
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);