Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1811118rwb; Fri, 11 Nov 2022 00:12:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf58WWuAR81hU5qddGswAWPrmbq0hadupjd524QC0he93F/oZPnwakAnSY1MG9VryN5qE9S+ X-Received: by 2002:a17:90a:4f4e:b0:212:ffd2:440a with SMTP id w14-20020a17090a4f4e00b00212ffd2440amr814259pjl.7.1668154341587; Fri, 11 Nov 2022 00:12:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668154341; cv=none; d=google.com; s=arc-20160816; b=fj0r4kXH9A8ys9ZQa3sUlqT8XKYoPAmp7RpwIhEUizKGHSlDVf1kOX8lcC4GTIMpdy 6DEVLWYmE3ePbK/WbZKq1rOn4PyI8SwEO3du7F/72tKgW1rpUBSRUM7FgONNIuJ0KZvW ukhCirCjWpDdiaFGioeQ57N6Puq/AZlA+F821uAUxO3rztMIYfONGMTO+lxq3F4DoUks EZfFbVlU3Uiai2qy+hpEePQoDThGKf5LbjXAYi4Phuu3+UfQNsrHLwe2nB2C/I3hOfCH ZUmXVL8AkKorHd0fLmye4XJYKObgY59tU+Upt0v2Qy5n8sSOZndbRkLIixCU/d5FXMIP rM+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=8l/b/+FRVLoTEq6Gh4lh9QGttkACjURiQoQp3ikronU=; b=EVri1A9EfvH59r7gpQY2tv5tyEKCLQeQvayKXamnabbac8Sd2PNNxqhdN6pSvUMkJ4 iSYQF9kz6oT5VZg2k6R0p1qKdizk8jnCmvY7UwJ+drV7OIsKvb7hU87AJFGrdF/bG4vD Yb73MBQu05Hh54MzZlu9fSnwUQ28uh7cmxUnLq6njAv7QKYfLic8HPuJlOrtTOPr71n0 uqZRG0xL4FwmLm0J7X8bWIZnM+Zy0rGX1XCGv3KTLKYjxzzj2RQlg743rADA3wLur9Vd MEjMx3B/SbrHd0RQgv2RtdrWbeqywJ6Gp3grd8KXm42vECw5TiBGuoa9OgNE/BDDXpyJ 2Bmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jUljLXKb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e19-20020a170902e0d300b00186881e1ff0si1641868pla.302.2022.11.11.00.12.09; Fri, 11 Nov 2022 00:12:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jUljLXKb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232825AbiKKHrA (ORCPT + 92 others); Fri, 11 Nov 2022 02:47:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230043AbiKKHq7 (ORCPT ); Fri, 11 Nov 2022 02:46:59 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0CF1748E1; Thu, 10 Nov 2022 23:46:58 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3608F61EBF; Fri, 11 Nov 2022 07:46:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7EFCFC433D6; Fri, 11 Nov 2022 07:46:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668152817; bh=vv62wWwduqinrCtZbQZIaSqRP/SZaLuyOTjLzL5M2II=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=jUljLXKbTkBM1clnDanu46i0KM2d1foJBR6/TP/rfUQrkVzilDLS1L3siifcm+wxA y0sxUEcus6M0Wdrk4/dUCYeyfYY+5PFOaKmVSz3K6ySWVkjSypYrW+PK9WsuoxpQUZ NjrYuePXAi/mVkUyhaHAbVS+fyvEYGzk+N45gXinaX9lKafBxLbnFpQnre8tGz6Izo +AlvrWCkI4NZhIhUkLNLToQRk+Krq331WnrdxrSD+Y8pDbDVwc235rWURLudsVyF0g s3noIW7AwWbgtvozfegpTSgzfi+r3qlh28W7STwc3o7wRH1l543RCTAAI0D4FJryIr fxcQ3zIPp1p9w== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 165005C13DC; Thu, 10 Nov 2022 23:46:56 -0800 (PST) Date: Thu, 10 Nov 2022 23:46:56 -0800 From: "Paul E. McKenney" To: Zqiang Cc: frederic@kernel.org, joel@joelfernandes.org, rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] srcu: Release early_srcu resources when no longer in use Message-ID: <20221111074656.GT725751@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20221110073013.1302564-1-qiang1.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221110073013.1302564-1-qiang1.zhang@intel.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 10, 2022 at 03:30:13PM +0800, Zqiang wrote: > When the "rcupdate.rcu_self_test = 1" is set in bootargs and CONFIG_SRCU > option is enabled, the early_srcu will be tested, currently, for TREE SRCU, > if "srcutree.convert_to_big = 1" is set, the srcu_node structure will be > allocated at invoke init_srcu_struct_fields() time, after the test is > completed, the early_srcu will not be used. > Therefore, this commit invoke cleanup_srcu_struct() to release srcu_node > structure. > > Signed-off-by: Zqiang Queued for further review and testing, thank you! Also with the usual wordsmithing, so please check. Thanx, Paul > --- > kernel/rcu/update.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c > index 738842c4886b..a05e23648c6b 100644 > --- a/kernel/rcu/update.c > +++ b/kernel/rcu/update.c > @@ -589,6 +589,7 @@ static int rcu_verify_early_boot_tests(void) > early_boot_test_counter++; > srcu_barrier(&early_srcu); > WARN_ON_ONCE(!poll_state_synchronize_srcu(&early_srcu, early_srcu_cookie)); > + cleanup_srcu_struct(&early_srcu); > } > } > if (rcu_self_test_counter != early_boot_test_counter) { > -- > 2.25.1 >