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 327DA1FC10C for ; Mon, 18 May 2026 06:32: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=1779085939; cv=none; b=UlD14Rr83FzuqB3Iw0q0PtzVlKybvoUYvmdZnZGKnk8xiI3WGxha4/dfCU+QW+74vxnK8wqeU3nq62suI9JJp3B9tiK02FUwT4+Wv9eYHa0h7m5mJ93canCgnJwPLd5a6/PWS91MzQI7YejJM0LFSekkv7C0CWZdxR5+dFz74gQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779085939; c=relaxed/simple; bh=/4HjBH+vAOnnqBO0QRSTltroD0Fs684VyTY2lkm/ndI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QhEhpSWwp619kQ4EX2pFstDepBw0nO9kBmkASpF8LuXBXYGNdLWo1f6KX+V0Gy0ScAA17Fsz7oZBvaRFV2fQpXfuGafalTZRwd/9GocGq/7NXHvyPTSPGah5aveGz8R+B83bD3mcVj7zysPwNI+kaWVVv634DMRQDyK3+sJSIsc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dWhipG0O; 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="dWhipG0O" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D750C2BCB7; Mon, 18 May 2026 06:32:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1779085938; bh=/4HjBH+vAOnnqBO0QRSTltroD0Fs684VyTY2lkm/ndI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dWhipG0OKFjQXNg7FkzE3XUnINSnZYONNmPsmlJSf29XR6GyBdPA3zqKBvpBMEHRQ pR5uMp9WaorOy9wK+kZWKsJLZ8eEjbKj7NRsykGQNrIP68nyLDUipJ7AY2iDs7aIWC WTX2BOJQG4oaQCSOS7L/Ko0Tx7Kn9vL48CKbByqTzn93VfBlf79o1vav5tXGiP8yi7 pj0gHkJALulY7DdgUCaWv3GaQMVB3qOPKn4YrRTpNWpYhvbo++AE9Mh+DeY9QNM8jy 6+JJKPaAZNCTCQ3ftGGF/ujWsUNRSQL6dmnodg3pepeJfq++rREkBW/EBXs28+P0Sz Y3RLctNR3M4Pw== Date: Mon, 18 May 2026 08:32: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: On Mon, May 18, 2026 at 08:29:07AM +0200, Oscar Salvador (SUSE) wrote: > 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. Ah, I see that you later remove this stuff, so disregard this please. -- Oscar Salvador SUSE Labs