Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4745177rdb; Tue, 12 Dec 2023 08:11:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IFOhUO7nOgOgvwOyEQlpzQ4FLZvtjTUpaKq7CbW/g19C0ne+qUPd5QYDtnWHMRvgWHiYBB1 X-Received: by 2002:a17:902:6f02:b0:1d0:6e9e:c96b with SMTP id w2-20020a1709026f0200b001d06e9ec96bmr5778840plk.35.1702397500168; Tue, 12 Dec 2023 08:11:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702397500; cv=none; d=google.com; s=arc-20160816; b=sD+hQ1tCzZBgSW+Iyf/QaeBj1091VL64Hm0bWhO/ZqXFYqKG3HSCrheVQxtwQs3Jhq Mj9tPJv7A2z0r3HmzqXFWSlKb5K0U9ES3H2tybubEQ18l40NCtldZfqT5FU3BOX9p1sw u5DpRTLNkAnX21YR9TY1ux55dElhM1YF2K8ghnpWuLNe3EYZzDpLTdgc3utaLHCeXeNE cc78RH15ntWoIHwRQlV6v5Ckrbh5CjfFyNHZ4nz/c3NYqmoLjjLGzygFcr6pyci5HnHK NsOOu7xJW0yMtfqKT1+2kI2NjHQee0hQAGfKjS/QUC792uwI8dHkuWFfsVHREGtVqtKe uFfQ== 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=UGe9rh3iyOih908rL0TnFfunkKRWZYAoojOQ7LaRSwM=; fh=j19A0/VN1W+hj4MGMIFhpUByA0GoqGuUADpQqubhNds=; b=OjKdqZzf9eQQ9oPisDGKwYu9USiNs4YZST4dmeteRdUO5pqVvAznkynE3LQ3yQ3tac bp0AgEAp/5RfQkWc1sBONxluxLU401FmaBG3mXQ45OQvVI+S2Q2L8xHmq2iZNkc7iJYp z7R9R7/fmHkyx+dsWxQAT2D6xBXxW3aeaTNMBOE2WYW/Ux95xKS4eVKD2oiSOqVuH7QE AJKVxeDf1CINRBUbGgIrz+SCFWY57egGEpHYlCtVccReEq0PRu6FKxCaOjllTYVeXVvn 7A7ZPt+Lh0IbPbH0oXYDPC+tOBFCNTIAb6YjiR2wxCo6Qh5qigwcG4MAAWYn1wr5ap+Z j9Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=fKioxMmz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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. [23.128.96.36]) by mx.google.com with ESMTPS id x64-20020a636343000000b005c1faa82bfesi7916148pgb.857.2023.12.12.08.11.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 08:11:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=fKioxMmz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 93F618026B6D; Tue, 12 Dec 2023 08:11:35 -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 S1346460AbjLLQLD (ORCPT + 99 others); Tue, 12 Dec 2023 11:11:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346535AbjLLQKv (ORCPT ); Tue, 12 Dec 2023 11:10:51 -0500 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBB03D3 for ; Tue, 12 Dec 2023 08:10:57 -0800 (PST) Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-551d5cd1c42so4080a12.0 for ; Tue, 12 Dec 2023 08:10:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702397456; x=1703002256; 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=UGe9rh3iyOih908rL0TnFfunkKRWZYAoojOQ7LaRSwM=; b=fKioxMmzJ8tiUgCHhM8xDWJTInyvYAEJJ26ZkXWijGMUkfuD9wRZ0FIG3naTuy1J0H EypFcKvY+c1b5XCtr4RWJulyS1tNu0GBPk4ekbO/Zii2pT2cbg6P88vYRazGN2bHsarM QM+gB1mpfFsU3i/VZXuKpLu/ZVOjmMiEsUdi7dKn0+r3zX5kmEAHeAS49zwdCcKbnWBu kijC4pj/L1syWS3uSwIVYdto2YKxHdaCRYNE5scboTxMktyZvuIxYD3v7alDPhN9dNX5 nfKc4ptweOn45+7V22C9eQ2QJcZz4TN+zm9m7kKHVv1yEnvoIwuOE4Dm1tr3QOtkBQZQ ueUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702397456; x=1703002256; 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=UGe9rh3iyOih908rL0TnFfunkKRWZYAoojOQ7LaRSwM=; b=Ce/rUS+kNT2lbZMGOJJj38tmFwOg4pDFY/UIRFYpz3PuYYvQiUNlvh2YYObd2p4Ai2 8WOCTymyVSvHpanYn/Z5eq+sD8/in93ZWtrwsmHyWWb3i/YNiKbBuFrBlvPzy/hFSW2s SBFBPxcMeEJLnQpqxav3npbmRwq36tTKhSNb+rOhIHPpOdVoQDyTE2l04TbnxqwFaNUH Vpd6Uw0QcUBjOLqmsQT38lFjx+EapRwtjGhZt4czZtf0VqXZaieTPYxT0u8DmPWKlKDv +AzUV0DLI7QMUGgPL858My8NRsBJmMbTm43ohTLl6AvwkF/A9M3PWgTY3qZCBlFz4ayN aCNQ== X-Gm-Message-State: AOJu0YxEscLlv2SusdyGSh4iaa/ysJYjtgDrvmZpiqkPEKDNUtni1w44 fbrEmcHvQcdgQKpYzFJJnFQ830NZYV7uL48rKJhZxA== X-Received: by 2002:aa7:d4d6:0:b0:551:d490:2748 with SMTP id t22-20020aa7d4d6000000b00551d4902748mr32260edr.5.1702397456151; Tue, 12 Dec 2023 08:10:56 -0800 (PST) MIME-Version: 1.0 References: <20231208220545.7452-1-frederic@kernel.org> <20231208220545.7452-4-frederic@kernel.org> In-Reply-To: From: Kalesh Singh Date: Tue, 12 Dec 2023 11:10:44 -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:11:35 -0800 (PST) On Tue, Dec 12, 2023 at 11:04=E2=80=AFAM Kalesh Singh wrote: > > On Fri, Dec 8, 2023 at 5:06=E2=80=AFPM Frederic Weisbecker wrote: > > > > Under CONFIG_RCU_EXP_KTHREAD=3Dy, the nodes initialization for expedite= d > > 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 =3D kthread_create_worker(0, par_gp_kwor= ker_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. Ahh sorry, that's the other kworker. LGTM. Thanks. > > Otherwise, > > Reviewed-by: Kalesh Singh > > --Kalesh > > > return; > > } > > -- > > 2.42.1 > >