From patchwork Sun Mar 19 22:00:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 71905 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp901106wrt; Sun, 19 Mar 2023 15:28:22 -0700 (PDT) X-Google-Smtp-Source: AK7set88YLw59DXmHGx61A6tpp3YY5p+dQ/VpFM7Wn2MP+98C25/HMLqU2HunmzAI026rebqXm6A X-Received: by 2002:a17:90b:1b47:b0:23f:9439:9a27 with SMTP id nv7-20020a17090b1b4700b0023f94399a27mr5192371pjb.20.1679264902335; Sun, 19 Mar 2023 15:28:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679264902; cv=none; d=google.com; s=arc-20160816; b=njeWoyFLIUtI3dUiwfUvSLPOm+0plAtPfe7O74Ai3yxdGSGv4FAtZtSMVBUNOkPWVq 3VQ+B3LSTalARedlZn1NfWmIUx5x2m7pcfUyHee40/7vy4DOtBfvRC6R+bkQpLrtaNVI JCZjAMLkotzjd/B+bfHLmRado0wjMOYxy9uYbdGU2kimTUKHfuOBWHeV1BIJ5ftZYAKr P/iBVRL565todMNBI57y4ASdn3OB5OLXqGf5RK/fCErmZDu1rm6DQ/6hZIMw9ar69uRG 0pVd417UZr7w7GHf/HT7nmxV4mB01J7jpGkRAsjswD5cMFeJ+nIwNal9WPKk3eBMO3qy mKRg== 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 :dkim-signature; bh=z6BzX5RSxqlEnHYkDBKrxJnZmz/tx4Z0P6dotv8/xaQ=; b=o18IsUlq8VmEHpbX/pR3QgDct2br0DVZlXTMbqEyZ5x3qCByNmxA1n5pr8y/qny/Bh mj1VVae8kXPQm5U2e6MBzaSd7/WRO69qtOz7MgvCosdAsBcQ6OK+6/S6C16XH/nKm/e3 dbFqS3ZFNpOUdmAJ1ib29UqGZ762c+KlppkJH2m56knPsxicew5/90MGDGwKuCqbpJm6 55RfgX62JEoflmuDjOjB4gb/A8/L2j2Jb6Zq/jJApYwd3gotlaPOYREP72iL3PUbh4+6 TpgqOygwhNNjq5/iGwFJ+kr7vBBsTj3DyLP0YWPLVxUfh3M+XOSqr1iz+16jssxkDN78 CBrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SGon4fha; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gx19-20020a17090b125300b002332c17dbfbsi14182637pjb.70.2023.03.19.15.28.09; Sun, 19 Mar 2023 15:28:22 -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=SGon4fha; 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 S229997AbjCSWBs (ORCPT + 99 others); Sun, 19 Mar 2023 18:01:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230229AbjCSWBf (ORCPT ); Sun, 19 Mar 2023 18:01:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58D871EBD3; Sun, 19 Mar 2023 15:00:50 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id 5123DB80B8A; Sun, 19 Mar 2023 22:00:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17416C4339E; Sun, 19 Mar 2023 22:00:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679263248; bh=EYqScWvKSkV7BdC+HRlB0XJbRdBQ734VVz9MaIm+3GE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SGon4fhaJq517bPBRcHKmjkvN4o0CTIjBqWQ7HGujGdtR6/e1N65HwBjOyIcIUVW9 tDfA6jl/oGozUz9exf6JhuiAK1fRBaCBLBZQwLiZ6h6cBOSPk6EgNww8ffo54jFMCk 99TUCf1bgX4TdLghfR4z3OIXg3Iv6YP91TQyYK/LW3xkr0CljUk1W0NbwqGx4JNsKf IMjabdz34G4b94oIhDLS1kgx6k3Ha6F8ooBAOwkWk8rfbIj+e/NrR0W6thXB0OF3U1 lm9woc3T1itzI8f9Cw7TK6yWn0iU506wYbkiU34TTT9y3cf4qZIVRPpsikb9koDCx5 1PVwJYaQ236rA== From: Mike Rapoport To: Andrew Morton Cc: David Hildenbrand , Matthew Wilcox , Mel Gorman , Michal Hocko , Mike Rapoport , Thomas Bogendoerfer , Vlastimil Babka , linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 07/15] init: fold build_all_zonelists() and page_alloc_init_cpuhp() to mm_init() Date: Mon, 20 Mar 2023 00:00:00 +0200 Message-Id: <20230319220008.2138576-8-rppt@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230319220008.2138576-1-rppt@kernel.org> References: <20230319220008.2138576-1-rppt@kernel.org> MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760836874196752005?= X-GMAIL-MSGID: =?utf-8?q?1760836874196752005?= From: "Mike Rapoport (IBM)" Both build_all_zonelists() and page_alloc_init_cpuhp() must be called after SMP setup is complete but before the page allocator is set up. Still, they both are a part of memory management initialization, so move them to mm_init(). Signed-off-by: Mike Rapoport (IBM) Acked-by: David Hildenbrand --- init/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/init/main.c b/init/main.c index b2499bee7a3c..4423906177c1 100644 --- a/init/main.c +++ b/init/main.c @@ -833,6 +833,10 @@ static void __init report_meminit(void) */ static void __init mm_init(void) { + /* Initializations relying on SMP setup */ + build_all_zonelists(NULL); + page_alloc_init_cpuhp(); + /* * page_ext requires contiguous pages, * bigger than MAX_ORDER unless SPARSEMEM. @@ -968,9 +972,6 @@ asmlinkage __visible void __init __no_sanitize_address start_kernel(void) smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */ boot_cpu_hotplug_init(); - build_all_zonelists(NULL); - page_alloc_init_cpuhp(); - pr_notice("Kernel command line: %s\n", saved_command_line); /* parameters may set static keys */ jump_label_init();