Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp3947834rwr; Sun, 7 May 2023 23:57:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4mzhf+pQVFuDRJyxqp0nPCi5q42ICmv4gW73Yq8+CXsj6+K4AgKzta3FXJYtg3521PhpA+ X-Received: by 2002:a05:6a00:2392:b0:645:ac97:52a4 with SMTP id f18-20020a056a00239200b00645ac9752a4mr4163466pfc.8.1683529043803; Sun, 07 May 2023 23:57:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683529043; cv=none; d=google.com; s=arc-20160816; b=dzWcMGWXLEwRRQOXvsGkqnq3H0QcLyk4Oi1ho56j4dAmy19kk/C4kK6QPj5WS+ihEZ wNp83UrmoLNDV2bTmmjy72wTiMF2b1HvCTsrUlCuAVeaB3jeTntGBa+mP74NTBVJXlA0 7YMTTj9VugSDGo9SmSqSnfKUtBpOHhz42FHerHi1IZYoFypwE1VweCXJA8XS0sj4Sxkh ON8nVQuNbdmqim3oWfJLuMBpDWXnHPE/3uu4eYlFUO1ZPI9PxolKo98mCJEEEee5jkKU LB7PTg2SzGcmi1MCjtma9OVUqeSN/UEY4GjiGl39l6gfn/V8PRYLoOKDROMao2slXeps kJww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=oP7DGThGpZGDNBqu8X6jnO1rCC4w3UXrojF/HjOHYmU=; b=QkeAzWJADv11W7pTwp56hyEopfypEudjnNwRDPu0p/C5iPMdAbZWvd/JoE2EJ6CS0D Rr/7pAlBqVGbxzACspkop79kgAVcuy78/jhXR+nJ38icF+9q3QlG/HXScM94U5W7ud2M 6tl/77W3pg1XDauoEZoDBCVWxzIM44aOhZYk243AomGdJh+r2hLi1qqFTb+LGCDNvaYL nFFWEfnxBpFIAee5vmBibqzqMS5CRH9LV4igIs+ZODO9mij6VN0S5DeU6z+nVpGKSA0m ahCI/Jsyl7fejg9OPwo+jPiyTwWTExprQ6OS02TlOGbpfWxnq1cgaOFbGKyHRzyt2ZUx UUkQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k64-20020a628443000000b0064387bc87cesi8167508pfd.22.2023.05.07.23.57.11; Sun, 07 May 2023 23:57:23 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233017AbjEHGzC (ORCPT + 99 others); Mon, 8 May 2023 02:55:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230433AbjEHGyu (ORCPT ); Mon, 8 May 2023 02:54:50 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5DC3A5F6; Sun, 7 May 2023 23:54:48 -0700 (PDT) Received: from dggpemm500001.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4QFBkl1tsTz18LDq; Mon, 8 May 2023 14:50:39 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Mon, 8 May 2023 14:54:46 +0800 From: Kefeng Wang To: Andrew Morton , Mike Rapoport , CC: David Hildenbrand , Oscar Salvador , "Rafael J. Wysocki" , Pavel Machek , Len Brown , Luis Chamberlain , Kees Cook , Iurii Zaikin , , , , Kefeng Wang Subject: [PATCH 02/12] mm: page_alloc: move init_on_alloc/free() into mm_init.c Date: Mon, 8 May 2023 15:11:50 +0800 Message-ID: <20230508071200.123962-3-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230508071200.123962-1-wangkefeng.wang@huawei.com> References: <20230508071200.123962-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,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 Since commit f2fc4b44ec2b ("mm: move init_mem_debugging_and_hardening() to mm/mm_init.c"), the init_on_alloc() and init_on_free() define is better to move there too. Signed-off-by: Kefeng Wang --- mm/mm_init.c | 6 ++++++ mm/page_alloc.c | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mm/mm_init.c b/mm/mm_init.c index da162b7a044c..15201887f8e0 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -2543,6 +2543,12 @@ void __init memblock_free_pages(struct page *page, unsigned long pfn, __free_pages_core(page, order); } +DEFINE_STATIC_KEY_MAYBE(CONFIG_INIT_ON_ALLOC_DEFAULT_ON, init_on_alloc); +EXPORT_SYMBOL(init_on_alloc); + +DEFINE_STATIC_KEY_MAYBE(CONFIG_INIT_ON_FREE_DEFAULT_ON, init_on_free); +EXPORT_SYMBOL(init_on_free); + static bool _init_on_alloc_enabled_early __read_mostly = IS_ENABLED(CONFIG_INIT_ON_ALLOC_DEFAULT_ON); static int __init early_init_on_alloc(char *buf) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d1086aeca8f2..4f094ba7c8fb 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -233,11 +233,6 @@ unsigned long totalcma_pages __read_mostly; int percpu_pagelist_high_fraction; gfp_t gfp_allowed_mask __read_mostly = GFP_BOOT_MASK; -DEFINE_STATIC_KEY_MAYBE(CONFIG_INIT_ON_ALLOC_DEFAULT_ON, init_on_alloc); -EXPORT_SYMBOL(init_on_alloc); - -DEFINE_STATIC_KEY_MAYBE(CONFIG_INIT_ON_FREE_DEFAULT_ON, init_on_free); -EXPORT_SYMBOL(init_on_free); /* * A cached value of the page's pageblock's migratetype, used when the page is -- 2.35.3