Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4739486rdb; Tue, 12 Dec 2023 08:04:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IHrzDM3AlNHka5SbpKVGL1of7mjpGJVDpXZP7jksfmRNvfV0d1G1fPDbGvhZ6daMQTCHPA+ X-Received: by 2002:a05:6a20:a8a1:b0:190:7c:b3c4 with SMTP id ca33-20020a056a20a8a100b00190007cb3c4mr2902331pzb.24.1702397083650; Tue, 12 Dec 2023 08:04:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702397083; cv=none; d=google.com; s=arc-20160816; b=tst2wJ4oBKSZMYKfPMHy95bmbCatBzyf03IVXj5Wmfs3yfw+KWAgAFEqt1zKiw/mZx 5zAwkiJU/i4FAvXn0+1lL980LW35ZdHZbrsuLWuPwF5fhkiBqkiOMPn6wglYz8bXPrXc AI4oMTFUFfFzVQ5T9yi9y/KbmhiBONZ1dMdY7tK6gzIM/MMbcyKO4ObldIHySx9zDdaS sl3bU3SIKWb5SEBp0p3AQr1nD6bab2yK/3DtmAK66+r9W1YxVCyiYyYy/SKEcaaBRA4h RZJoyrpUamYCqMmmFlgNYlC6t9Y2Bdnwg804M0H9adFC4vcse26ntcZF4jGvf79XhgfB uImA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=EySWR5HSLbEbAwQsmlzOeqMwViU2YPMZzWbEWm+2Kgo=; fh=j19A0/VN1W+hj4MGMIFhpUByA0GoqGuUADpQqubhNds=; b=rtT/ehW509uH4LQG10faVOhQwYlD5fpz63ZEiL/1jP7A0efP9ITfXAZAZ9BZ5saogE I0ffcTP4GHBKmHZBPB/ug0CPDA77VF/oUjjOm6T/zNb6eBFCvu9TWSDWX/zOIFNI0VTr 6GoFvm/rbbKK4wo2F0TMONmSXcPzSuggRm1lFRbrFSnzHVewWW7Aam7/IL5cY/5/pU5e wvY7PPirFAMRG6cwuxfNwiZJGmnMpdvmtk7eHHo0GQmf2VuawpqGsQpWB8U55hUDBk5a JF2eaf0/HKWrjJ3l87ciNHAkhrEsjxu4x23p+apoGc2IfAUhWTO3vEarSEYWbRco03P5 cmrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=CyFnmGD2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id j20-20020a635954000000b005b42f4443b7si8110825pgm.653.2023.12.12.08.04.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 08:04:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=CyFnmGD2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id B585C808BE5E; Tue, 12 Dec 2023 08:04:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235002AbjLLQEW (ORCPT + 99 others); Tue, 12 Dec 2023 11:04:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232549AbjLLQEW (ORCPT ); Tue, 12 Dec 2023 11:04:22 -0500 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72976B4 for ; Tue, 12 Dec 2023 08:04:27 -0800 (PST) Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-548ae9a5eeaso13117a12.1 for ; Tue, 12 Dec 2023 08:04:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702397066; x=1703001866; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=EySWR5HSLbEbAwQsmlzOeqMwViU2YPMZzWbEWm+2Kgo=; b=CyFnmGD2rNk5SCz1aAqC1E7TtP9XCZ33skehfnNwi+ZaWcFr86n/Zd5eOrmUn+VJus 1LycG+H33eTazpAKP/mUcshd1rKFOJZDLl7qdH/6FYPYmIFETEtSk9vJNqWh8mWinaxx s65ZzTqop1r2pojI49Npz0UdXno/8d6SGi20g5kgcbzMfStQOLmpq8xCBiENB496iDZc HyP4xbQ92y6K8c5oNn2+1oKDMLv64D+yQNo/zE1quy+/xxqvZdHxJNwc5WU+BufmLc6k VXTXnn83/jW3niInfbENmoy3iivoYHIITKVkxCwtbcSDOgSD1dD9uf50pUabpY33xa3i UdBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702397066; x=1703001866; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EySWR5HSLbEbAwQsmlzOeqMwViU2YPMZzWbEWm+2Kgo=; b=GqIvIMafCILx/OhDqaMBcd6WJ8sIpX2VJ9jkYswQS3qRtvYkWYsTAGt21KuuM+Tqzu AVlYDQGUJcqhrthkavsjzLXDWmlCRtyLMy3rNvigIY8j3kmb2BjDE39WtQ51Rq7iwzd9 jBaW0QQKM3zlDcSO03ge2Ues9fWYHg6gVFqaZk1HWqlk1/zoZdqgCip63HUs1O2FtXNy T+Pf7u+SfaDzU57z0W+bklW5Z9d5gflGLw7pT0yPNzbL1/gkSj5r119UK8P3YH5xqbXS 3dOenDtnI8it7xAowySHlcIOpU3WNXvLLD4Y4QSS2i95/DC4ybWgWR4CN1F4Fdh0TEkh dA4w== X-Gm-Message-State: AOJu0YyMB2qlpsUvUXHcjzf9bVgPjpKdfMh4usjoVyYZr60cuQQj9Ynd jpj2HBf5kfT3adr6PZaCx9hm9mdrvJB/2hOkLkg3Yw== X-Received: by 2002:a50:9fc6:0:b0:551:de83:557 with SMTP id c64-20020a509fc6000000b00551de830557mr18211edf.2.1702397065602; Tue, 12 Dec 2023 08:04:25 -0800 (PST) MIME-Version: 1.0 References: <20231208220545.7452-1-frederic@kernel.org> <20231208220545.7452-4-frederic@kernel.org> In-Reply-To: <20231208220545.7452-4-frederic@kernel.org> From: Kalesh Singh Date: Tue, 12 Dec 2023 11:04:13 -0500 Message-ID: Subject: Re: [PATCH 3/8] rcu/exp: Fix RCU expedited parallel grace period kworker allocation failure recovery To: Frederic Weisbecker Cc: LKML , Boqun Feng , Joel Fernandes , Neeraj Upadhyay , "Paul E . McKenney" , Uladzislau Rezki , Zqiang , rcu , Anna-Maria Behnsen , Thomas Gleixner Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email 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 (pete.vger.email [0.0.0.0]); Tue, 12 Dec 2023 08:04:37 -0800 (PST) On Fri, Dec 8, 2023 at 5:06=E2=80=AFPM Frederic Weisbecker wrote: > > Under CONFIG_RCU_EXP_KTHREAD=3Dy, 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 kt= hread_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 =3D kthread_create_worker(0, par_gp_kworke= r_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 =3D NULL; > kthread_destroy_worker(rcu_exp_gp_kworker); Hi Frederic, Thanks for catching this. I think we need to remove the kthread_destroy_worker() in this case too. Otherwise, Reviewed-by: Kalesh Singh --Kalesh > return; > } > -- > 2.42.1 >