Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2379757rdd; Fri, 12 Jan 2024 07:46:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IE78ZeIjvxYj8KrWBUUq+xVrj62OpvoYtO65QFm51QNP+iqRDsRUxXq6D4flALg17MAKY1f X-Received: by 2002:a05:6359:4c1d:b0:174:c9a0:cf99 with SMTP id kj29-20020a0563594c1d00b00174c9a0cf99mr1672861rwc.57.1705074411805; Fri, 12 Jan 2024 07:46:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705074411; cv=none; d=google.com; s=arc-20160816; b=afCpZB/juy3Hhixgcu3B2h6NibgUjzmXOmRRrvKmlQEn4i5g/KSYG5EA0BOS2ivcDx 0J4dIRimcxUrC5lwlAHYP9dplBwgy7WDfRxA2n6+4B3pp32C/DdpvOfVyFpd+bf4Rr4S iShHaTYIsxsM4JVEOWqF4UMKgNEuh82CLXeWkNBBGrVTy4rnMo3mDi6zX3Rheolhwv7k Uq6/QGqdu3muJVtIMQjlGkJnwaP7qA7vAGLwKRsNCg9Q7Ck0rlKhWTkHykQoW+Xq1xwp WBy6bVjg8h26kS9+37yi0UP/qGLuumXgtAKj4j9xY2Wzi1cnQWh6duE9RryXfu0Hr4mW FDkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=G1dUWDjk0pMP0PZi+Ldg4wEj7SvSc/wPa3tYQwhA0Lw=; fh=Vt4MF2mkEob8wHsiIEVO0FMp/tQ5kOJKjfDhEdncdXc=; b=HbDtRElgTDqyBb/MGq0o/W2a+G6vP4PsIS4oGfx4Lsitlx1OIiFqDmVVp9+J7hNR4l owOfiQ7/tM7o+H5flrQAa19gFSxNsC3w3+kq7y4GsZxtuZvtcQcOw3lMldvYw86tdKqe vO4EGHCqf3cR/28qNZG0catILSEqX0KI0dHCzo63kwYG8LBOCJqdJMifGYxHXRV6zrRM WnQvVm3EBHErtw4WJXIugwx4rtM1k1bEhAV+3sjbzTw2ymVHywpv6YklzmFr3qb5oatU Ui+ehdWDQQtcDkTXnqgiFmCxMnUGCHTWTKQGQW9mohPrsycq0tGBszutxK0yV9lBy4Nn wMcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hqvOXEaD; spf=pass (google.com: domain of linux-kernel+bounces-24819-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24819-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id fb7-20020a056a002d8700b006da2ef0e953si3573017pfb.221.2024.01.12.07.46.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 07:46:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24819-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hqvOXEaD; spf=pass (google.com: domain of linux-kernel+bounces-24819-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24819-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 7A8DF282588 for ; Fri, 12 Jan 2024 15:46:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0CF127316C; Fri, 12 Jan 2024 15:46:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hqvOXEaD" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D1366EB7D; Fri, 12 Jan 2024 15:46:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B2E52C43399; Fri, 12 Jan 2024 15:46:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705074393; bh=5LTULEAdFpJcQBG6D6ceSXiQtGzk7tED42bNjO0Rk+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hqvOXEaDSm1CyW5xE6ar9yif2JT/BSSeb2hAxaUYvxBC6RV1EP+KCjwxqnM4uTE5d ROXKPFvKXMRZAaQSuZlw9GGniXf904gAus9MjM1pD+J8eNFhVBCnk0jzebVLg92FUl cF3wK2nh3V0kXZI6b3Umu13fTPJTisxf4RZIHX7Yus7DyXamvjfI41l4vVq20EakH2 bddQVhGqId+9VUGOA3l5xGOFZHX6altm21y38nHW/TdVLH8m1QwYnexISLbIIF1jiK blXNHTKWz7zh31Y66VGCeg14Iimr3ahuwaE3N0rhD9BPwEUx5sVUc3OJ1hpNCo4e6y ekPoSnbYMIVWw== From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , Boqun Feng , Joel Fernandes , Neeraj Upadhyay , "Paul E . McKenney" , Uladzislau Rezki , rcu , Kalesh Singh Subject: [PATCH 1/7] rcu/exp: Fix RCU expedited parallel grace period kworker allocation failure recovery Date: Fri, 12 Jan 2024 16:46:15 +0100 Message-Id: <20240112154621.261852-2-frederic@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240112154621.261852-1-frederic@kernel.org> References: <20240112154621.261852-1-frederic@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Reviewed-by: Kalesh Singh Fixes: 9621fbee44df ("rcu: Move expedited grace period (GP) work to RT kthread_worker") 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 499803234176..b000c1a83fc2 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -4760,6 +4760,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.34.1