Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6331587rwb; Wed, 18 Jan 2023 04:00:48 -0800 (PST) X-Google-Smtp-Source: AMrXdXuuL4qvKDFg0LFgMzmdIQlySGnntqYFf7cLYjXe6hxvXKBvYzG4BvFbl+8N9M4kSbcFt82H X-Received: by 2002:a17:906:8d0f:b0:870:b950:18d4 with SMTP id rv15-20020a1709068d0f00b00870b95018d4mr7173386ejc.5.1674043248124; Wed, 18 Jan 2023 04:00:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674043248; cv=none; d=google.com; s=arc-20160816; b=Qltb+7sPaF7r7nu9fIi2T5ksIr8kwIncJe/DqMNcYJIL/iQI3ryeuiQ8U2HgW6T8Es UfNDwp4T7cM8t6mZyNQdSkeVJqhPgCjFT8r9znwLJ2o65w1mgxGK9f23glkeqhJLjbwN 88li/vWZMofgr0oDZ+9oyv9G18l+uOWaK65eMnlV/96XWY3vtkPAAjnYmklfni4VemSF s0Ubn6foKtQIdx8VeS06vK7rOoK3m4I9MASFzJCboh7RoTV6ADo0LFP0KMCc9Fzeoq4k yMsBv9yzPUwy0VP1PE1Sp9yae5m61GpYVOkxarayOD58opxxv+ErxVaI7qnX8sVt7UGo 7e1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=d55dAxvZ9ENX1ZC8dgWpiv4iakDMbiQet3UR1DCyxYc=; b=Clicg4CbfZx1++D+zZK5QpoatwBhU13ujyeDkH8/l5YWnDbjlPNwJDgh+l3IfMKc6X DjXbVIsFRpGjkTLN6Q+xvgh3QvzEhEv9QD+xb0rTHI/TusRLO1tEwzLfXnHI5ga7HqDi nAjwyEcORlm2Gj7o7NQb9+yA0JO21+L0jtJRk2FqmC+X4iMKiaRdQfhSnPyma3bwzVuw ZHtHjUL8p/oVE6sd67Lg5WJK1E8JaJiF+Gy7LXNiiT9HRDEHsNQm6pxKoxz2morp7PAZ VntHWFdP7nOYBmUutTi4KhwFc9jh/jViS/rYWTXFl9gLcG14E4dlNsoAZ6V/zJpybCRE F6Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HKNgm6TZ; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k26-20020aa7d8da000000b0048ee8cf8bb8si31841402eds.53.2023.01.18.04.00.36; Wed, 18 Jan 2023 04:00:48 -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=@kernel.org header.s=k20201202 header.b=HKNgm6TZ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229702AbjARLLr (ORCPT + 45 others); Wed, 18 Jan 2023 06:11:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229761AbjARLLJ (ORCPT ); Wed, 18 Jan 2023 06:11:09 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D12CD9084C; Wed, 18 Jan 2023 02:18:50 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6AC8361744; Wed, 18 Jan 2023 10:18:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62965C433F0; Wed, 18 Jan 2023 10:18:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674037129; bh=xJ/Cw2FUAmOw6EcpQrNQixoTROjtQ1A2Dd9PkmuNyrY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HKNgm6TZG0JRPNEKyK4b5p9suz8FUEJnJj4NnjXJd0OjpN8c6fAp707Uil5d10KFU oNy0V/GyZnBjeEw8GicYZEHO+qQLqc4JX8Tq+S7DDCVvB5u/9b1MRsGJqYaUZ/4cWl W5Aa8CAQ03rQQ1JrYEziaZhS4hFTQ/wjOEiMhg38BfKoSDAm+OK5v0mjBEYsSEvWue 8HDwY4g31JlwimOwfBYkRAqy9sIGIuVZ3L56ozzhn+KvM9QOSoXhX8mLvicS3quRzW WfSb7hxYHiatpRmy4GkpXVNi12m1wsuBQ7b31b42ylZ8Vh5rNaG0BaravQZiLVl1OO G7GfJ2MAA38BA== Date: Wed, 18 Jan 2023 11:18:47 +0100 From: Frederic Weisbecker To: Zqiang Cc: paulmck@kernel.org, quic_neeraju@quicinc.com, joel@joelfernandes.org, rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] rcu: Remove impossible wakeup rcu GP kthread action from rcu_report_qs_rdp() Message-ID: References: <20230118073014.2020743-1-qiang1.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230118073014.2020743-1-qiang1.zhang@intel.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 On Wed, Jan 18, 2023 at 03:30:14PM +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 > Reviewed-by: Frederic Weisbecker Thanks! > --- > 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 b2c204529478..0962c2202d45 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,12 @@ 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); > + /* > + * Current GP does not end, invoke rcu_gp_in_progress() > + * will return true and so doesn't wake up GP kthread to > + * start a new GP. > + */ > + 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 +2004,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 >