Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1064887rwo; Wed, 2 Aug 2023 08:13:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlEPxN9Fo18aZNe71iFfHRxGofoivr9xPzUcw+644KYyGpaD0xAOpkM7nO7zg6lRZoPnHZq4 X-Received: by 2002:a17:902:6bcb:b0:1af:ffda:855a with SMTP id m11-20020a1709026bcb00b001afffda855amr14970305plt.9.1690989233017; Wed, 02 Aug 2023 08:13:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690989233; cv=none; d=google.com; s=arc-20160816; b=G1UJJLq4VSWtT1r9JyxUM7B/v9NlGoS/9+s2V4a6llABJV/ftXk/VHxlhulwFhpHaX dmLaez5t6Fedzw5qY+hz63OAjjGNeDWXpmICenNYHJ7Ix8cTW5UJkhn+NjeIBk5UVBIs f60zfzVOrEWp9BhjYg5bBe1hlvJrtXO4y78ypXvzDcHtxlqY06jxToQ9tdq8MDFeLbm3 KZ+6mVOfwTN5XzX5gB12ySv4PKKbvVITflFvZqtb4euHppbW40xfQF2eu+NUONBwnhkO tYYU5Y1Dbb3RvdgEsbvD2hRCk1Q6gIurWktVdTVxaTnZIAzRDunvJ8umyla9ZEHyKo8m mJag== 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:message-id:subject:cc:to:from:date:dkim-signature; bh=qdQi2mv9muw9DffBMAB1+0IgmNFAGcbXE8p4Nq69xPs=; fh=UgJJx4saGoK60LnEbeY+ZFWIDGuIVuvdKA1eAebw9Uc=; b=R+tCR2WrMbFN3khWGwfrQ2OHw68BRyc+RtLjNr01czj3cEBpahxJsfET+weQcmD4NF rpRQdqFXDNKBLrSok2EUbk3gzXxklvpAuUwRtqc/SGVvN5GJ9nGiqQ0piGiTvoh0opPw nGq28J7CuGkt55esYnAqhpPQjkJrdu+71QO8eEYgAi4OO/V1iSpAN/rFTmOpEWd7Mc5P tztpEbNwOA7JCVvdeFp4jO9A92XCB+F/+pQ6xizkeS0IDnI1NKCjEHNcisLb+i3BP08q 1g+YptI8+9fTGnfkSiIUEMeXYzO0RsrZJZCpDK5QRr8qL4dkT79cL5ghb5u4T5oP+Ust C/SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mFSg7Mtu; 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 w8-20020a170902e88800b001a677821130si7892864plg.13.2023.08.02.08.13.35; Wed, 02 Aug 2023 08:13:52 -0700 (PDT) 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=mFSg7Mtu; 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 S233610AbjHBO65 (ORCPT + 99 others); Wed, 2 Aug 2023 10:58:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233215AbjHBO6z (ORCPT ); Wed, 2 Aug 2023 10:58:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B64EA11F for ; Wed, 2 Aug 2023 07:58:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 544CE617F0 for ; Wed, 2 Aug 2023 14:58:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 19F19C433C8; Wed, 2 Aug 2023 14:58:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690988333; bh=B7PJRVoGZn23p+r9ALJfQkaFSMSdvGQQe71SQW5MouE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mFSg7MtuMOK79DRkwdkU1CdTUuLXgUd5UXk21tLHtAp2+//+xfRPaGBeq6q+c+8V5 PchdJkSbL89oPhlZ1LqTQ0RluHHPPJ4dmC7ExFVW4BjAtW59549gjAO8Liq+A2AFzr KBqjk3Y/yN2afvObEQkvHOn45mc2ClgEoM++82Q/FFKOXS4pKl7dhMtfgUPhTBG1NX 5U2Ko34ctP+R5STcvGTLg/ndWCFbaanRDFCx6/PP8XT+xpIwuD7aFB499wHKo41APy zmvXRuBkfcxK2E3CnSySGbgYgjB5ml5HhmYZtRiZLlst16MDSNVNyXN563YsQfy9B1 kJ6istljo0Njw== Date: Wed, 2 Aug 2023 17:58:09 +0300 From: Mike Rapoport To: Peter Zijlstra Cc: yury.norov@gmail.com, andriy.shevchenko@linux.intel.com, linux@rasmusvillemoes.dk, Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, tglx@linutronix.de Subject: Re: [PATCH 1/2] mm: Mark nr_node_ids __ro_after_init Message-ID: <20230802145809.GE2607694@kernel.org> References: <20230802112458.230221601@infradead.org> <20230802112525.564928240@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230802112525.564928240@infradead.org> 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,T_SCC_BODY_TEXT_LINE 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 Wed, Aug 02, 2023 at 01:24:59PM +0200, Peter Zijlstra wrote: > Just like nr_cpu_ids, nr_node_ids covers the side of possible_map and > is thus constant after init. > > Mark the variable __ro_after_init to both improve performance and > enhance security, since the variable is exported. A module writing to > it would be 'unfortunate'. > > Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Mike Rapoport (IBM) > --- > mm/page_alloc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -305,7 +305,7 @@ int movable_zone; > EXPORT_SYMBOL(movable_zone); > > #if MAX_NUMNODES > 1 > -unsigned int nr_node_ids __read_mostly = MAX_NUMNODES; > +unsigned int nr_node_ids __ro_after_init = MAX_NUMNODES; > unsigned int nr_online_nodes __read_mostly = 1; > EXPORT_SYMBOL(nr_node_ids); > EXPORT_SYMBOL(nr_online_nodes); > > -- Sincerely yours, Mike.