From mboxrd@z Thu Jan 1 00:00:00 1970 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 A8FB1E776CE for ; Mon, 2 Oct 2023 22:46:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229753AbjJBWqm (ORCPT ); Mon, 2 Oct 2023 18:46:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229879AbjJBWqm (ORCPT ); Mon, 2 Oct 2023 18:46:42 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44EC493 for ; Mon, 2 Oct 2023 15:46:39 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7173AC433C7; Mon, 2 Oct 2023 22:46:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696286798; bh=6uxLXn2eoLVyGqYt2DJ+Syy39/MpG5Mf9aQIry0lVM0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ot1iFZwKfnldThvAiOqO7ZEBbnUlCPIblqg7xsUX5eok5WHmhKT2uY7a4DGfiG9cl blk/VkcRnE7raBpQolg7g4jL94Zm12r+fSlF2C1/1x4NuYnO4cJYUN6ihVYLHQqJSD muUR38rJHXIkvxcZBpsyjeOjYPnohC9kW9fsBpYq5n5dSc9FcBrH1bMbh7VD/gxtQX y9t+PGRSJKMxKm+9hyRaL74Sa00KaEFQrvJdkxoC0In+sCRm3jrwDu/OJhG/MsKEmi wmk7RXS2ogWv4kIWJyP22Xqa8rF7HY3yal9PXawjDd/Q1Ewi0G2VJoaDCkiLbMUHO8 MzNySKGMji9Xg== Date: Tue, 3 Oct 2023 00:46:35 +0200 From: Frederic Weisbecker To: Neeraj upadhyay Cc: Joel Fernandes , zhuangel570 , paulmck@kernel.org, rcu@vger.kernel.org, josh@joshtriplett.org, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, like.xu.linux@gmail.com, linussli@tencent.com, foxywang@tencent.com Subject: Re: SRCU: kworker hung in synchronize_srcu Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: rcu@vger.kernel.org Le Mon, Oct 02, 2023 at 07:51:10AM +0530, Neeraj upadhyay a écrit : > > And if this works, can we then remove srcu_invoke_callbacks() self-requeue? > > If queued several times before it actually fires, it will catch the latest > > grace period's end. And if queued while the callback runs, it will re-run. > > > > This makes sense, but not sure for non-wq context which link [1] mentions, > whether it needs it. > > > Also why do we have sdp->srcu_invoke_callbacks ? Is that workqueue re-entrant? > > > I think you mean sdp->srcu_cblist_invoking ? > > There was a prior discussion on this [1], where Paul mentions about > non-wq context. Actually I realize that if we remove that, then two srcu_invoke_callbacks() can race in such a way that an srcu barrier callback may execute before the callbacks it is supposed to follow. And if we must keep sdp->srcu_cblist_invoking then we must also keep self-requeuing. I'll add a comment about that instead of removing. Thanks. > > > > Thanks > Neeraj > > [1] https://lkml.org/lkml/2020/11/19/1065 > > > Thanks.