Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2360159lqp; Sun, 24 Mar 2024 15:40:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVUHnJTanHThDB0k5TJVsP1RzQKx39QAbksa27TVmZmGo6hiKV0lza3eY2DEi5DaJS7WY2XN/eSjbb02IZKQKKlAGZ8Zl3w7sOORuG9LA== X-Google-Smtp-Source: AGHT+IFHw4Eqd3/nSPzRS2bv73CnDIdBeGubEQuOyqRFckm4SxkBXs7mLj0X84jRpkfp70EwsdQ3 X-Received: by 2002:a17:907:7293:b0:a47:533b:10 with SMTP id dt19-20020a170907729300b00a47533b0010mr1668173ejc.62.1711320025778; Sun, 24 Mar 2024 15:40:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711320025; cv=pass; d=google.com; s=arc-20160816; b=Kpo/QBkYozj7fiH6jjLno6Aa8XfWiBxghVxXHNnktLZWy2rPx043Qcmzbfx/0XPrxu DUrq+NfKmt9wM9k+Y1I7vcQ3P4JF8p5KD6Io8pG/fB5hr4jr01HSkiq7YE4HLLEAEPjO pmdagTCAuxk3AA+Ziq/YbLjGCYsphNW9nABaMOkmSepLFsP6AR1NVOAlVICgXa5lKIZY DFshBvIU+afV1+K6+34bv0WuvUNOLhlu3IHE8LIlN/1s6d+DdZm/J+Cw8DBG+KvThqVT fL8MSR8xc6ZW8pi6ZfawBbaod3e1izvfY9lX4b78tlb1JhxrDc3qmQJ/LU2bBR1yusMJ QL8A== 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=jscSrBXqiTxfShg3lQgPsoheNDFlupuWSwjiA6MS+9Y=; fh=jmVxg9ePdovGaaB5PTqsO5w+8k7oSL/2L3/Kp0pwx/c=; b=dk6v+3iYgQ0RWVpLXNMIrTKA1t0wOdh/3AAz+bFWmnKdP+yFKWLJRGeZMBUCgECgcG wG9qkS1S+nHdWI8u7QZh7FuHTjCedBkZna13pWISpBcmIPzRPzHnRv6dG2+1SlNNS4V/ jydS1+3MHaeXDfJ71zrhwFk+gxyzK5kDYZ/RUdwZlCPUIwqA75qH3JhpBdy0HcngR6qB G8ti29jSnpEDRdyAl8ktfuezlcElcWVqmflIbgTnAlrFxh6bSO9+KXGGfpOAI+MTFrkL y/9GVakQIB5IZZkVzyVeUmoQ6G/LjZPpEugENy+NAMOEt+nShfw//Bffrs/Ho4hRZev9 2s8w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vPuMTlRn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112907-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112907-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id sh12-20020a1709076e8c00b00a4a38d9ff55si138695ejc.419.2024.03.24.15.40.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 15:40:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112907-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vPuMTlRn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112907-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112907-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 62A4F1F2170C for ; Sun, 24 Mar 2024 22:40:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0987D5D47E; Sun, 24 Mar 2024 22:35:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="vPuMTlRn" 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 2AD3B45033; Sun, 24 Mar 2024 22:35:17 +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=1711319718; cv=none; b=TBUMa19CEVOhDQSqPFSWRuh+qy/F1SlbDunGw7Z1HAio4wvJn6T6EqOYceLfAxA7MtHKPrzrvSaUCeGwLhpJJwCWr6NeWxUhPrhNythMgQ59G8txqhmdeQGTTuT2ALwUPyUxeO/2sLysXuwforiVOpRH5sQZAhev8ZWGCEB/yzM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319718; c=relaxed/simple; bh=Oy/tMwvVydN42G0bJnVh71AIihietZ6FD/F8TRdgP4Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=muxZubRKPQtKwvtJKWIUmFdOP5a7zAAvjujEmm9YOTNO3Urcdq/tdOrvztm25ZqafZY75rT+1OJPNvtlLxMBwx82L+NSK0znXWJT1FO0DxZMb1olS71mw39lyfc3qGk2zDHRnJeuR8zRO9TpA20izVBIx5t5cJFsErqyytGIW5s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vPuMTlRn; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E382EC433B2; Sun, 24 Mar 2024 22:35:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711319717; bh=Oy/tMwvVydN42G0bJnVh71AIihietZ6FD/F8TRdgP4Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vPuMTlRn23RcT0+oXGi+82vA9LeWgqlPz4I8YM9sNcV+vMyGFq6k2SctP3fhxtmPe mVxJy6R5APmY+6EHmcjsLHR97cb0B/eaGTehdZFuna0f3xyUe4ewc5emyDE1EqxHuy mcGbrDbDrmiM6q5rhtfqlBMziUqtgHXrk7aM2+osGujM2TOAUl1gMuQwDeZCk+7rco cSWYyvg3cIqMYbbN5TFwY0aLdg2/HyAft/SGrUoN0f5fXsiovuqp2bxNvnh2E8EIRE Np57OcqaNiWeNJhjtKSjNxVfWyyC24s1eNDjFNMmcgWSl2UnWn9O+93aMPUBybCDdQ SVZv7qraqtzkg== 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.8 020/715] rcu/exp: Fix RCU expedited parallel grace period kworker allocation failure recovery Date: Sun, 24 Mar 2024 18:23:19 -0400 Message-ID: <20240324223455.1342824-21-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-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 b2bccfd37c383..38c86f2c040b5 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -4749,6 +4749,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