Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2629889rdb; Fri, 8 Dec 2023 14:06:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IGwdQptiGitZ8TGL0PoMscBKRPeWSNjvyPvwTV3md2xPXmMyDb1frHBqnX9zpDqcdJ8YAN9 X-Received: by 2002:a17:903:24e:b0:1d0:4759:bb60 with SMTP id j14-20020a170903024e00b001d04759bb60mr2051742plh.26.1702073205040; Fri, 08 Dec 2023 14:06:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702073205; cv=none; d=google.com; s=arc-20160816; b=hYcZ8e0oqtCGJRHgMcZtWY2Vy/D5op+azB3W8XW3POd+2OBR1R1aglOUNQIjCXuraX BnJz0/FsCF8PmKzYk6mUKJNNgDqBemSp0PITDBJomwOr1fFSryHqgOk5lCDLAAdTjgnP HxDPW2cm3SEWbfNauQtR5ijXYDndz+PeKc4C/73B62tHMcuKepwOtjQ3Q9tzqRycF8Yl 0ndkDdgwOqnK6Zi9rDgZN1EiSnjTZXgwa1BeS04f2xWFg9bRz0EPS45Zhb8ND6vFWm11 N0UHkjv1F1h+D74nxUQHS8X7L3YYkf1I8Ed5vPALopXXN0nWzNf8Orxhngzo+3uWWgx7 /zQw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Uh5OANqX7FMWY3V9rBp+IcxRcWoBA18zMMXCxoygkls=; fh=z8Ne2JrnnXKUY28f9pwEdqls7nShSFwQTzvJMmkinP0=; b=DW/f9UDOfL2hAJZ3Luoxejq05zcwnqpWws1aZEUhdwtuyzyrHqlWb8me30ugjIbmI1 YLlhhQgmRhJMJFkxfthW9n4IEwzQuv8YEB4YBnPVDpIR/BfhsU3IdxUIEg0Lz/EOpXZn rFORuU/fGUeUK9efHcSCdskhWyljoLRq7K1PrBd4IKZVyehtKvWP+NGVM9Fo48eXaib6 xvVxbnoPvXqNHb5Q0A93861cplCRCSlTWirx98nCPN3/e62g39jg8uCzCVCFYmdJQOEh OxwvEllXRSa9KayAuG/Xa24OUJPxE5mdIZ1avKsvYyuSH0HC6EeHeesUQ1CCrcrYWx45 BeuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VXojr6rg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id w9-20020a631609000000b005c6b4e26664si2121078pgl.548.2023.12.08.14.06.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 14:06:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VXojr6rg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 475E281121DD; Fri, 8 Dec 2023 14:06:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1574867AbjLHWGQ (ORCPT + 99 others); Fri, 8 Dec 2023 17:06:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1574886AbjLHWFz (ORCPT ); Fri, 8 Dec 2023 17:05:55 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A980E1712 for ; Fri, 8 Dec 2023 14:06:01 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8C95C433C7; Fri, 8 Dec 2023 22:05:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702073161; bh=6Rj2/Ew9i8og8UV1rs/YRIIkk8Z14PNfosvKFa7ip4I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VXojr6rgF4CVtj1/yBPc4JDT25DImi7RK6bjPnZ/E9+OwRt5xlCa7VBBdmwAuZRQk aSMyIc9cocqzJ7LMudOAEPf9o4ryZal2Oa/HV7IOcfmPXz4JSTHA6hflKzWJ/j5U04 47RHygrGazdzJEjuHxp0zlfgxtpGTF+qVfmMzN8SY2ZLR55GpJobnvyxwHk7UYALl7 4STCMLMjN779SK0D/wWSsCw1K+XE/WQfSuIe67z0e0HnM3EUh57lV7WsdRJ2iUezAj fb1y3eftmg/tb2vDlQw7dP4H+Gb2wIPAd2efJnXF2+n9aW8kKJTT1tmwcbg5O9rDhc iINxxKaf0URqg== From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , Boqun Feng , Joel Fernandes , Neeraj Upadhyay , "Paul E . McKenney" , Uladzislau Rezki , Zqiang , rcu , Anna-Maria Behnsen , Thomas Gleixner , Kalesh Singh Subject: [PATCH 3/8] rcu/exp: Fix RCU expedited parallel grace period kworker allocation failure recovery Date: Fri, 8 Dec 2023 23:05:40 +0100 Message-ID: <20231208220545.7452-4-frederic@kernel.org> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231208220545.7452-1-frederic@kernel.org> References: <20231208220545.7452-1-frederic@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 08 Dec 2023 14:06:28 -0800 (PST) Under CONFIG_RCU_EXP_KTHREAD=y, the nodes initialization for expedited grace periods is queued to a kworker. However if the allocation of that kworker failed, the nodes initialization is performed synchronously by the caller instead. Now the check for kworker initialization failure relies on the kworker pointer to be NULL while its value might actually encapsulate an allocation failure error. Make sure to handle this case. Fixes: 9621fbee44df ("rcu: Move expedited grace period (GP) work to RT kthread_worker") Cc: Kalesh Singh Signed-off-by: Frederic Weisbecker --- kernel/rcu/tree.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 82f8130d3fe3..055f4817bc70 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -4723,6 +4723,7 @@ static void __init rcu_start_exp_gp_kworkers(void) rcu_exp_par_gp_kworker = kthread_create_worker(0, par_gp_kworker_name); if (IS_ERR_OR_NULL(rcu_exp_par_gp_kworker)) { pr_err("Failed to create %s!\n", par_gp_kworker_name); + rcu_exp_par_gp_kworker = NULL; kthread_destroy_worker(rcu_exp_gp_kworker); return; } -- 2.42.1