Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4257938rdb; Mon, 11 Dec 2023 13:40:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IHrMuGP/L55F2S0oFDPECqIx/CrwABbZhZnwyDxkcOwz7LTZMA8jftUDxQUDS8hU5wov/C8 X-Received: by 2002:a17:902:e54e:b0:1d0:b42f:e41b with SMTP id n14-20020a170902e54e00b001d0b42fe41bmr6337399plf.64.1702330806077; Mon, 11 Dec 2023 13:40:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702330806; cv=none; d=google.com; s=arc-20160816; b=hTaabt7l9IfB53RYXkkEH3fgGmFVNNIALsiuff03rj0Emw1oqXmZGplsYyvLbFwUFa msXY1UWHUioQyaFmgLIuNO3yImqyeaJFEhQK0GGaCIWaIpalTkxLJlP5GTFq7bphU5Y4 kZYzvCZ/CteWVXROyh/hBantMTHAE58mA8hKV4sMBa4KBWHuG9DeILehuzOZM/qQkOBx t61oWEeSxvbjrgnxF7cQCauDjYATWgO+nFd/caCwX7yCGTtLmrf370X1ZBpaflDrIX/2 UwEUwvEm7wiqhnKqc2vsmRoslZYRjIDaEesg9GeCzBH16yGr3h3XJMtus9xTmnG5fGeJ Ph/w== 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-transfer-encoding :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=ApAif4sdIhGbtj5EsHoy5mRbQp9h7xO0QLw3LU6dq8w=; fh=rNWjA2ScL8Z7LQbsoClDMjtIuo4AqswST0ClfY37BMI=; b=Za+9RPCugqz5U+q5hAWX5iURhPV4qleGFCt7mrz5DlZxeQ1wkCR2OKmi4V+OlNuNDO DnJXcwdws3iXWsJ3gp5N3g8zyykoJ7doG7REJUprexUgj15GwtZdqfWY3yJzLWgLU7So VJEBe/5Qn8BD7VCBP1lbPKpPt4MkvABGXkYgkYWvKk9f00VG9iuW1pEjPcwqdHa7ycUb +oW81rGz3fI1tX0pI5m6KAr74IRy9WbV4aDBKNEfUeRNc90+vttAuXCnF/m3S0lOi867 ptsfQ05Et8KkYOlJPOby8I7XcTVs+15otRvccsFT+M2Cz+2sDXCCmnoc28GqRqt/ZWX3 7Q2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UQBlTVCD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id l19-20020a170902d35300b001cfcb270ab3si6661037plk.528.2023.12.11.13.40.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 13:40:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UQBlTVCD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 779BB80BC130; Mon, 11 Dec 2023 13:40:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345324AbjLKVjf (ORCPT + 99 others); Mon, 11 Dec 2023 16:39:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230101AbjLKVje (ORCPT ); Mon, 11 Dec 2023 16:39:34 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F246C4 for ; Mon, 11 Dec 2023 13:39:41 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D657DC433C7; Mon, 11 Dec 2023 21:39:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702330780; bh=DJzT/+cc0AJqLW4pldSyhoXC+1cJku2DkenpvUYqIfk=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=UQBlTVCDf58q07TcrYjQ59xXuTWWfl6Vc6U1nDuWsfcVOavgqyypcqYhpVObRG4OQ dx1Y7/wRdLptSr+QtLwviqYjxk81q3yngumwNNl9exR/Fk9rq8lGomGig8+tWo+CWG uEbb9Noi21I2XOUk4Wt5Rwsdfb9RA3AOjX3mHdVIZ2cigw9e9xsSNzn9hX4GfFg9cg 9oQAidAd8l8/3+zTLgguS7nsoiLrNdSIAOy7Nl6mdaSlI4wROhyvDUHo9WYI1wYCTT aqSzxiA0in6ktR3FxAoFIylMRdv33A2dbi3By3n/+cs9PsqofjT75rAnbWodoOu3OT m6d59NmWGC58Q== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 76730CE04B6; Mon, 11 Dec 2023 13:39:40 -0800 (PST) Date: Mon, 11 Dec 2023 13:39:40 -0800 From: "Paul E. McKenney" To: Frederic Weisbecker Cc: LKML , Boqun Feng , Joel Fernandes , Neeraj Upadhyay , Uladzislau Rezki , Zqiang , rcu Subject: Re: [PATCH 0/8] rcu: Fix expedited GP deadlock (and cleanup some nocb stuff) Message-ID: Reply-To: paulmck@kernel.org References: <20231208220545.7452-1-frederic@kernel.org> <0be847d6-804e-4f9d-9eb4-beee9efb6c78@paulmck-laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 11 Dec 2023 13:40:03 -0800 (PST) On Mon, Dec 11, 2023 at 09:04:04PM +0100, Frederic Weisbecker wrote: > Le Mon, Dec 11, 2023 at 08:38:59AM -0800, Paul E. McKenney a écrit : > > On Fri, Dec 08, 2023 at 11:05:37PM +0100, Frederic Weisbecker wrote: > > > TREE04 can trigger a writer stall if run with memory pressure. This > > > is due to a circular dependency between waiting for expedited grace > > > period and polling on expedited grace period when workqueues go back > > > to mayday serialization. > > > > > > Here is a proposal fix. > > > > The torture.sh "acceptance test" with KCSAN and --duration 30 ran > > fine except for this in TREE09: > > > > kernel/rcu/tree_nocb.h:1785:13: error: unused function '__call_rcu_nocb_wake' [-Werror,-Wunused-function] > > > > My guess is that the declaration of __call_rcu_nocb_wake() in > > kernel/rcu/tree.h needs an "#ifdef CONFIG_SMP", but you might have a > > better fix. > > Could be because if CONFIG_RCU_NO_CB_CPU=n, the function is only called > (though as dead code) from rcutree_migrate_callbacks() which in turn only > exists if CONFIG_HOTPLUG_CPU=y. > > Something like that then: > > diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h > index 35f7af331e6c..e1ff53d5084c 100644 > --- a/kernel/rcu/tree.h > +++ b/kernel/rcu/tree.h > @@ -445,6 +445,8 @@ static void rcu_qs(void); > static int rcu_preempt_blocked_readers_cgp(struct rcu_node *rnp); > #ifdef CONFIG_HOTPLUG_CPU > static bool rcu_preempt_has_tasks(struct rcu_node *rnp); > +static void __call_rcu_nocb_wake(struct rcu_data *rdp, bool was_empty, > + unsigned long flags); > #endif /* #ifdef CONFIG_HOTPLUG_CPU */ > static int rcu_print_task_exp_stall(struct rcu_node *rnp); > static void rcu_preempt_check_blocked_tasks(struct rcu_node *rnp); > @@ -466,8 +468,6 @@ static bool rcu_nocb_flush_bypass(struct rcu_data *rdp, struct rcu_head *rhp, > unsigned long j, bool lazy); > static void call_rcu_nocb(struct rcu_data *rdp, struct rcu_head *head, > rcu_callback_t func, unsigned long flags, bool lazy); > -static void __call_rcu_nocb_wake(struct rcu_data *rdp, bool was_empty, > - unsigned long flags); > static int rcu_nocb_need_deferred_wakeup(struct rcu_data *rdp, int level); > static bool do_nocb_deferred_wakeup(struct rcu_data *rdp); > static void rcu_boot_init_nocb_percpu_data(struct rcu_data *rdp); This one passes TREE01 and TINY01, but on TREE09 still gets this: kernel/rcu/tree_nocb.h:1785:13: error: ‘__call_rcu_nocb_wake’ defined but not used [-Werror=unused-function] Huh. I suppose that there is always __maybe_unused? Thanx, Paul