Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp4874763rwb; Tue, 17 Jan 2023 06:37:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXvCi68ya0lkG6LRrs/GsFPIap09lsk/hmh8Q9fN953vjXUWngHXhrTHbspvl7SJUiHZ6Ii+ X-Received: by 2002:a17:907:2135:b0:86f:fe8a:be with SMTP id qo21-20020a170907213500b0086ffe8a00bemr3051880ejb.4.1673966271457; Tue, 17 Jan 2023 06:37:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673966271; cv=none; d=google.com; s=arc-20160816; b=oxFOYV98YBOWoiU52pBCQSyYPeFUoYmIahu8J8T3CexGruefbmXNvZ8pqq9PMGvYxA CWS+BMByyOyEiu18a28sgU5WZAOZwyOlVvpz6WQqTH5LvLW1rb9oOm4UKuY+6R3GQ33+ 7T1941oizYDw9DJAQYJr9loiqsWj8ndzfTft999lqJQg/tcFtvOmEwUb/Qv/3dcNJFwE Tn80WiHTZ+KyKUANYgySkfmPLE2vyBLtDkL7fhTVGEG61dT9HGkXJr0nc5jsmMNsOblv V3joEFPvf90A1EfgQE0e6+NnlhdZ7nyIvGeQYZMo1mRKUjtTmG4txyEkAV2Lwyf9M7De 4MBw== 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=kDoOvG7A8LsBCdaZCVwKDzSpGG2v6Lag9W8g3UnCllw=; b=pJNzojvuLa5x1f3UHzLjendLwy3Iaw8zh51/xnsXus/cNDSJbAwSrdais4+gXwLsId BoGRx72jdSRQe2cIRLTYufkBUDnid+X1+InnmNtIaX7sAhzR6yF+IC7nQQDNtmjZaBsW IvsLuNXyD0JYOSPuNOfQcm8LmnUjKfhXEDt3o3pe+YIP6ei+p218Bqh+5Bax5JFF4SH2 wLtwFx4thg0gfdVyJS2WK1HpNYiv+WxAr66qi2vR3x2dU6//9vEv8r9pGITM7cCS/rHv E0PrOtfvS+T+4RLG9HIGCt6+aZQQOrr1OsWjYuqWtsVIsUNP33Fn2rOyZ1EQkY+/ZN3z Xw+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Dktz/WYJ"; 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 hb16-20020a170907161000b0086f0552517asi10242979ejc.830.2023.01.17.06.37.38; Tue, 17 Jan 2023 06:37:51 -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="Dktz/WYJ"; 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 S230372AbjAQODM (ORCPT + 48 others); Tue, 17 Jan 2023 09:03:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229830AbjAQODJ (ORCPT ); Tue, 17 Jan 2023 09:03:09 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE0F538B78; Tue, 17 Jan 2023 06:03:08 -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 ams.source.kernel.org (Postfix) with ESMTPS id 5C143B8163C; Tue, 17 Jan 2023 14:03:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9463AC433D2; Tue, 17 Jan 2023 14:03:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673964185; bh=009ZkaKNNYtdbuuDx1qA9wZr22kzjPWN7yIb2q0DdEA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Dktz/WYJgv4QvyvDV2LbvZmxjtWZWLprYGVoku3jmdDH79C6Rr5ME968EUSWwVcih 5aouenxh36cnXsIEEFum2DRiZ7fyRn287tGrUNutJWRRQ9eRLncilq/HkQXZU5sozk 8LVH6IgiWeLZgkrL7aYIXc530jWklLqfNIt+Ic1JMHjSrXVsqoZ7oFOFwzvsYZ8Hb4 w9nXQds86zFR3FsxlHzM0KN0ABftoBpbKaEfnsnLlY4dXA4e6Zt4junWySb0wHm9nL PPm5Gg7QZWrH9fxX7gsLBKdVJk/MWjV9FiUWvahoFRggZnIrjvjjyj5yJP5IzIB6dZ Ai7kQS9PV+BNA== Date: Tue, 17 Jan 2023 15:03:03 +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 v2] rcu: Remove impossible wakeup rcu GP kthread action from rcu_report_qs_rdp() Message-ID: References: <20230117074443.1982347-1-qiang1.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230117074443.1982347-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 Tue, Jan 17, 2023 at 03:44:43PM +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 > --- > 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)); Please also add a comment explaining why we don't expect to have to wake up the GP kthread. Reviewed-by: Frederic Weisbecker Thanks! > } 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 >