From patchwork Tue Mar 21 17:05:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 13182968 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF26EC761A6 for ; Tue, 21 Mar 2023 17:05:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 519396B007D; Tue, 21 Mar 2023 13:05:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4FBC8900002; Tue, 21 Mar 2023 13:05:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3DFB46B0083; Tue, 21 Mar 2023 13:05:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 3126F6B007D for ; Tue, 21 Mar 2023 13:05:57 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A58E9160212 for ; Tue, 21 Mar 2023 17:05:56 +0000 (UTC) X-FDA: 80593532712.19.090150A Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf08.hostedemail.com (Postfix) with ESMTP id B569C160037 for ; Tue, 21 Mar 2023 17:05:54 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=VV0W2zZW; spf=pass (imf08.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1679418354; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=UkIaXt+ePedAKBmi84zwc0JbiwWbm2uBq3ujDVLhM+k=; b=L+lkGgEa7o+okCBba+2sntqMKYF9VZ9BSnp2ihWN/LnmDm2+hzNfFoy7+vCv8yt3wRVokc 8iBl11kzooZCoXrwTFc8uvfn7vW/9iNFVmVYXeLs8b/QEhg3qEX2HDUvJDhU60U4S77K5l jKjSSUaLJluEPdcohvWsPDI4HpiRUnU= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=VV0W2zZW; spf=pass (imf08.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679418354; a=rsa-sha256; cv=none; b=YkqE3OUBEUiJve7YCYAQEWU4gn3GAKtTXYXsdllgHEWAZ78d2CzTd2Xx095yDZH2vUP0C8 W7eg/dgs018CkIfsNS3hdeG+JSb1naB+YViZ23utSCBe60TDpSRBXIRQKFiEWSgB2cpuu/ HLIPPVwYfSTw3rc0FBhiRHSVKEu49mA= 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 5B894B818F2; Tue, 21 Mar 2023 17:05:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5914C433EF; Tue, 21 Mar 2023 17:05:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679418352; bh=PM92BQVLa2WxBbnDUdLvSknVaFsEpK5ocCyJK48uW0c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VV0W2zZWcfrS0Pnp7+uSdWblosvpxij7nM1hHcrlG6KllIxLpgkWjfxg6L8pJn6fS BuLcNFnrrsqJZ2HjcQZgwa16TIsHGm+PlSEnS618ROJunWIwJUgEEKS9BmC8kn9mtZ +a/7bhMFsF80Ers2bOuy4wk2Hv6uXB6fN16IauXtYO3TdhOGMD2w+MVQYE18Gy8lNX I0UmErrOkPo74b4zSg9+e3g/fu3Q03+8nBlqGdPNQDWEi47Z/ABd4ZcARfsXP8gp/4 en9kBBqp2MCxbotDylFJMqcRb66FWu2xCKl7T8IUAf9yteeqDDhCD3NcqHA5r7EPKp 9OrwGIUQYSbLQ== From: Mike Rapoport To: Andrew Morton Cc: David Hildenbrand , Doug Berger , 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 v2 06/14] init: fold build_all_zonelists() and page_alloc_init_cpuhp() to mm_init() Date: Tue, 21 Mar 2023 19:05:05 +0200 Message-Id: <20230321170513.2401534-7-rppt@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230321170513.2401534-1-rppt@kernel.org> References: <20230321170513.2401534-1-rppt@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: B569C160037 X-Stat-Signature: buf4mj7zgoiw1om4o7ky6anx14mp8tjb X-HE-Tag: 1679418354-114237 X-HE-Meta: U2FsdGVkX18HppjDYpEjhkaFxoxaC7Zp/GH1FimIHDQljKE49/1Q5gDQER5sg1XYrIt3pAsgll56EASSawHf7kYtRJ+qyOum3ESwkES9U1oPrxcam1kKusoNZ2MHUyPpMlnIy63BovSrA78Rvezz5DFHywUA0OPCvy1OECoTLH+52kfm2dej5/SMmf1y7QhJAxg2r9AidzPQTvIHQPHyFK3rDFSIFr3+wVHioozt9WTQm/N4ljn8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vLbPYg4CcchL6i9st7EDFfZuj7zevw7r2oGFzSXSK6QYUmuxxMjSpPizeMJirmigBSKhCSHAU3q7zVC94rVDzqD6thaTx4efmPKyMntM= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 Reviewed-by: Vlastimil Babka --- 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();