From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2684C3DD523 for ; Mon, 18 May 2026 06:29:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779085759; cv=none; b=uPI0SlX2WDqZbrLuWFoa3VSFiu3Crrp165gMB+3UNgcfxORAVdQh/voCRDoDvZnXih5GYx0SRIMySDG5E2FHYqtgQJxGhupP85kFfciE+8JgAntedQfVkVws2+4M5KmuRdndcXFDvcHzbQ9MO0Ymnpkpomwx3k3s5BMrGcwlhDs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779085759; c=relaxed/simple; bh=I/XS70rALR6MwZ5SM6q/C17Gn2ByJj0otYaz4sWXm2Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ea5TBrMF6YBNO4DXgbGuYjFAFWaZCtHFmnmySC9oYlHqGIujrm1+R0N626bzpXs97UqKxaYInqh8D4moS4wZA4GIxHjburvAjYLmGSlSxoRqmPbPIQs3Yki3mf0hjm7L6R3mmKKSna7AQ4mC/TCi4o6iMVjfhgwSPmTZVSBD/Rk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hX9L/8rq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hX9L/8rq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E447FC2BCB7; Mon, 18 May 2026 06:29:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1779085758; bh=I/XS70rALR6MwZ5SM6q/C17Gn2ByJj0otYaz4sWXm2Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hX9L/8rquXn48G5XFv9DP46PUROid7yK9Oysd2Zo4UMpN/4d4QKBzRgMPZtjwufTc fmK1ZqrLN/XLDZ+/e9ZgON2hy26aOfYKk4RqkjqkX8norpOpooJye2aAw2HiDqS/bT MrAY0+DGMJGzGzQwuTk70hFHq3OBD/sA4J770ZdoHd08yUXmMjjqkwA0PysJWJ78QY EOaNXk8xZ7sTeC8mTNqyyjgdL+CfLjLtKaspea5fpf9zgJteTl7/zhC3rXCPqtT8cl lTd2AMkgG/pHPTOgPwPbNxdGaFMXbitTvvLp39TQLdG4Tsh9GTJQqD4yQMT9XxfCH7 byTmYwMD6YDbA== Date: Mon, 18 May 2026 08:29:07 +0200 From: "Oscar Salvador (SUSE)" To: Muchun Song Cc: Andrew Morton , David Hildenbrand , Muchun Song , Oscar Salvador , Michael Ellerman , Madhavan Srinivasan , Lorenzo Stoakes , "Liam R . Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Nicholas Piggin , Christophe Leroy , Ackerley Tng , Frank van der Linden , aneesh.kumar@linux.ibm.com, joao.m.martins@oracle.com, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 08/69] mm/mm_init: Defer sparse_init() until after zone initialization Message-ID: References: <20260513130542.35604-1-songmuchun@bytedance.com> <20260513130542.35604-9-songmuchun@bytedance.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260513130542.35604-9-songmuchun@bytedance.com> On Wed, May 13, 2026 at 09:04:36PM +0800, Muchun Song wrote: > void __init mm_core_init_early(void) > { > + int nid; > + > hugetlb_cma_reserve(); > hugetlb_bootmem_alloc(); > > free_area_init(); > + > + sparse_init(); > + for_each_node_state(nid, N_MEMORY) > + sparse_vmemmap_init_nid_late(nid); Would it not make more sense to hide sparse_vmemmap_init_nid_late() within sparse_init() and have it called at the end of the function? The flow would be: sparse_init() sparse_init_nid sparse_vmemmap_init_nid_early ... sparse_vmemmap_init_nid_late I think it is better to have sparse stuff all together in one place instead of scattered. -- Oscar Salvador SUSE Labs