Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2555255lqp; Mon, 25 Mar 2024 02:25:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXGEvWrTIB9L3Dbk9VVDLxuzHYTy8IHp4g38ieaAnQjdTPR436Xfg9SoSdvvt+7JdGeqnWodb++knwGDScIeFNN9VgxFNowPB+bHPftIQ== X-Google-Smtp-Source: AGHT+IETDruC34FzUK5Le/8vDVVhHiRYAT7mlTLwMy5K34ZhnC8qF6HCfpBiv6sjaFVKs/H0Sd4z X-Received: by 2002:a17:902:d491:b0:1e0:bf32:8ef with SMTP id c17-20020a170902d49100b001e0bf3208efmr2367298plg.52.1711358752447; Mon, 25 Mar 2024 02:25:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711358752; cv=pass; d=google.com; s=arc-20160816; b=SpMLh0RkLvuMvo3IUm5VZX7SJ1+hGTemGd6Eq3PTwm2b6usp8rm1BJllS1h6Q4EevZ 25/OENp+5wGUySd5jh7SX23o7ecNRaAHuc9ne/jLvXtWKnME4uVq9ukpuQi8ddDbsHLw Fv6lTw10x0+NPOCyDKRnM4YmIHu0GDkF8FJ4C7qysyE6+iB0zlLpN6ZbkUXJJmi6g9Wx d536lJCnGjk8vOGtHq7+dVBWuRAg7HqfZRFTS7dx4d/VRyc1uRtRgtnORRn7Kp4E+Wrm 7MU3YxGokgak5mPzrEKxaOEmtYEfqJheZWKjZUmE195D2M8tBhR78ylNWzEkb02DI+d1 WlzQ== ARC-Message-Signature: i=2; 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=97x8gfyJLv/90WSX/8JpjVwYYUxfiMumxUhiMzsrPRg=; fh=jmVxg9ePdovGaaB5PTqsO5w+8k7oSL/2L3/Kp0pwx/c=; b=trNBqzVdJgSthUtNd1V0ATP3qp5xBv94kY1rESbEVWVijKPHUlEeSNzD8JVKfgD0Ow bJjbl53hXie08Vq6m9RgfNoRFTpQOsW/TVsYZ4nyjUXQQoIhjXE2EVH/CHdKvDzwTI9D D6XEIKFI5azrFZWNE+EotXyFFs0GJIOpgzr1QkbWAkSHchyiUfBo1RLjxEr0f1cXHgBs U/sQQ84gylSSSuL18x+wrBm/wXuZGq2xCWTl5nIrQ4lJutNILTR+w4tBhUyhSh/vy745 9BiEBUGllXLCuKqO2wr6WxteAi+1nREEWzw3Jv5PtfxndDaQQwTv/Mkyv7G6taGHwZ3L rRVw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="WAkMMrV/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115805-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115805-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ja15-20020a170902efcf00b001e09c57009bsi4387705plb.587.2024.03.25.02.25.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 02:25:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115805-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="WAkMMrV/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115805-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115805-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 C26E229D49F for ; Mon, 25 Mar 2024 09:25:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A486A373FAF; Mon, 25 Mar 2024 03:01:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WAkMMrV/" 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 8E5AE145350; Sun, 24 Mar 2024 23:13:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321991; cv=none; b=Go8Nh6KGtpBV35u+VB89nakAb8OnlHmWTpKrbJUtJJYJwrthyY3YhSQWLdvFVLs6MFAMFeWJ2QA+Nf3pngTTkmvRcIBqxuLBhpGL6WSiO2LaKogJ2Pk8c2o9ClSES4S/1TZxWSyvgQ+9iVzSDtMQ/PcesEjvhynhjLR8sFb0O98= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321991; c=relaxed/simple; bh=Tw2Mo9pMwb8UWfiQMOBnWjkJa+eOioaYjMoii0+/Lik=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t+XElpkk1hvtOrwsdubcMcLZxw0fyffwsjlDQ2DtqyZbULlQ5c8JzyGTgCspGjwjYzaaKI72NNBZ3dfG83uigGyTU3dGX8WwZ3htr810bc0TlVhWo2mc2f0tMkGj4g5ArullRnaDHG5Ifm4GbL19lVvmm5eKjZlCZux/mVKdQr8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WAkMMrV/; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59C6BC433C7; Sun, 24 Mar 2024 23:13:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711321991; bh=Tw2Mo9pMwb8UWfiQMOBnWjkJa+eOioaYjMoii0+/Lik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WAkMMrV/eglPj3oNSgwyQh93HexX8RVkkQvvlXcqegZgV21aG4wSAWPEGQiYEi9ZW 2s1DhUmrs+cUBrX+GZNeGA+9zuGmpQYLJ4l1vm+/sGO9cMUSBnJ7IyJB/471TSUaNr QevaejDBrNnmdFs1MtAaGVYrKGYFr4YQFHMkZovui7YtDZo1gv+GrOBlBzyCfIrVMF 0etEMTpLSIYO98uRqURZwNMbndjkWOkn5oLoiKEe3HEXJgWVUo12D+/btZDmOlcdAJ Vy+F4v+Q2gleWTKvk0iroaKq1DuntW1nj+5iLfZaZmi3PUi65T4RCzkzo1fZgeMBWM flfcqPdBwCDLg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Frederic Weisbecker , Kalesh Singh , "Paul E . McKenney" , Boqun Feng , Sasha Levin Subject: [PATCH 6.1 063/451] rcu/exp: Fix RCU expedited parallel grace period kworker allocation failure recovery Date: Sun, 24 Mar 2024 19:05:39 -0400 Message-ID: <20240324231207.1351418-64-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Frederic Weisbecker [ Upstream commit a636c5e6f8fc34be520277e69c7c6ee1d4fc1d17 ] 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 Reviewed-by: Paul E. McKenney Signed-off-by: Boqun Feng Signed-off-by: Sasha Levin --- kernel/rcu/tree.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 9d7464a90f85d..c879ed0c55079 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -4471,6 +4471,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.43.0