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: 13180636 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 67AF1C7618A for ; Sun, 19 Mar 2023 22:00:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0995A90000A; Sun, 19 Mar 2023 18:00:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0491B900002; Sun, 19 Mar 2023 18:00:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E538590000A; Sun, 19 Mar 2023 18:00:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id D7A21900002 for ; Sun, 19 Mar 2023 18:00:52 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 7C9DFAAC81 for ; Sun, 19 Mar 2023 22:00:52 +0000 (UTC) X-FDA: 80587018344.23.72B1ADA Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf02.hostedemail.com (Postfix) with ESMTP id ADF9C8001E for ; Sun, 19 Mar 2023 22:00:50 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=SGon4fha; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf02.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1679263250; 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=z6BzX5RSxqlEnHYkDBKrxJnZmz/tx4Z0P6dotv8/xaQ=; b=BbCaNeuGyyAUUgySDGjq043j4GyktJRyMFxEwQMMVYZ3KhK/WxR3GY/Mazy3cwfaNdVcnT 6CN/2F5TQTFXdkDFEGLaIpHGM6zqVeIaWax3UAUB42Y2EOls+KVSYbKDO5wKAOJSfznZP3 u6mGBiQgm1kOnZPjXlW4CPSLCcCY8BE= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=SGon4fha; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf02.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679263250; a=rsa-sha256; cv=none; b=URxYoYrUhr8FczVw4qEIg4UqEvTSFCsKtxkkpAKd6Siqvo9I9tksYMPBnsaGC+SgVSXN9n b7QBZSqh3oHiVDh2SEJiYLz2YV6hnrd7WnxqdpFNW0SMmfo2Dqv47kWWN5blBGt3kB9YTa nCF4T5n6j8TXRa8QN3DTh9Tiz18+UNM= 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 6980FB80D29; 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-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: ADF9C8001E X-Stat-Signature: m4157i5gg1bjnb3385i74miyip5m4kb5 X-HE-Tag: 1679263250-348993 X-HE-Meta: U2FsdGVkX19+UTEusIu9HMdyuue1mG5VyHUKe8qzEOGRDobohASiKNB190gAdGBGPJw9aw4ooiCts1CCBt/7oI71esRLa0gHzwyncpXY9OOO4ACBk7pf/9g+NVdUZHS0SOZTEgW2/JclUbB4wU+wkDxecQsM3wmLWciz7Y5eyiPuAiWElrSxjb+VHGWwqFAg5vbsxWiHVhyc6biBGE5b6BEUIQx3ff4OWE9q8vZNv+TSoMU0DqRhV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h7FKMekk4lbUlqkpr0P1qnqSHM4Wz83uEyV4OUSdJkD/sShkvfLGqAxiDNRpek3BHtEQ0NVnCBqTz+IOKQitXCPjx1wmcg== 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 --- 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();