From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60955C6FD1C for ; Wed, 22 Mar 2023 16:10:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229955AbjCVQKT (ORCPT ); Wed, 22 Mar 2023 12:10:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230372AbjCVQKN (ORCPT ); Wed, 22 Mar 2023 12:10:13 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5D2C136FB; Wed, 22 Mar 2023 09:10:11 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 7A3B533CCD; Wed, 22 Mar 2023 16:10:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1679501410; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1+7eyTKeVn1sl0E1m2LZkECMl7RTMp0jt5zZuoqxsew=; b=UvU8A7W2avxjunPSL/m9XAmogri1XixdGqLj+DBNKVOD0L07rFrG2jTryRX9BvxuqWx+qv GhuA27cWKfkYQnbgQJiLelw8eHrykrPOhoFt9GwHiqbzUh7lLlg3y0CEALMkLhkkG4VzAO KSn+bmx8CE3l9VKh7mLK2TJKP41Vas0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1679501410; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1+7eyTKeVn1sl0E1m2LZkECMl7RTMp0jt5zZuoqxsew=; b=pFtujWUPfcX+V8RK3RYZdmSAUw6NzcCwQFRSbCSR0ziPmuupZpSCXyE6okiXw0rEZUsPlR CZoVYZtJPHd8ATBw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4C15E13416; Wed, 22 Mar 2023 16:10:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Q47WEWIoG2TIZQAAMHmgww (envelope-from ); Wed, 22 Mar 2023 16:10:10 +0000 Message-ID: Date: Wed, 22 Mar 2023 17:10:10 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v2 06/14] init: fold build_all_zonelists() and page_alloc_init_cpuhp() to mm_init() Content-Language: en-US To: Mike Rapoport , Andrew Morton Cc: David Hildenbrand , Doug Berger , Matthew Wilcox , Mel Gorman , Michal Hocko , Thomas Bogendoerfer , linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org References: <20230321170513.2401534-1-rppt@kernel.org> <20230321170513.2401534-7-rppt@kernel.org> From: Vlastimil Babka In-Reply-To: <20230321170513.2401534-7-rppt@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org On 3/21/23 18:05, Mike Rapoport wrote: > 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(). Well, logic grouping is one thing, but not breaking a functional order is more important. So this moves both calls to happen later than theyw ere. I guess it could only matter for page_alloc_init_cpuhp() in case cpu hotplugs would be processed in some of the calls we "skipped" over by moving this later. And one of them is setup_arch()... so are we sure no arch does some cpu hotplug for non-boot cpus there? > 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();