From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-174.mta0.migadu.com (out-174.mta0.migadu.com [91.218.175.174]) (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 70E443546F6 for ; Thu, 16 Jul 2026 07:16:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784186191; cv=none; b=fVpJeuCPa+OSyte9utJy+994tyiVNySRA2bv/jRFioDzqI5Iejpd1mFuMmGIEiH/PxK2Pd+T+Gyu95IOq/RRe8s0/zG5/iOMUVdoWDYUhX8SRXVUCjFVD75dKbk4QNccg18jecoWd/m2ZVqwVSyJrtUwEupukKEE0vUuvXaOcQw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784186191; c=relaxed/simple; bh=btal7aMidvIeiluWljNcvp5df6QMs1icTRSw54Hlicg=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=pygi8rpPyOa5uiwbNdfZHFkm5rxj4XBbXG6MrGgudXf/P3FXFR4hZEW2JBunGd2Lw/+xLqKlCPWUTKcgDm+ATIsmCG4QqjRkmpnGZlFZjnh/AwJcyFfa9T60DBad6s09b/9C6E5tD+aEIxtK9kpP713r0U4rs/4IElDgBAfZUok= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Il1LmLw1; arc=none smtp.client-ip=91.218.175.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Il1LmLw1" Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1784186184; h=from:from:reply-to:subject:subject: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=Ka7OQEn3Bn9THo57nc8lHQ3EG4DHzyPU0U5sKMxwB7o=; b=Il1LmLw1azfQsA4HQLc5SOf6uHhpjTcqe5HjSvB3bvQHfF0KD44/m3VPQb4lciGSXs5pbC 2W+cRU6LXU2ds0UfFeDA7OU+uTMag+EWsPO91pIZh1OJ6gOunExU4SkulzW933yWl0meQR DbBDtEeNXf3khWDc+pO6/uJu1rA6Saw= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.600.51.1.1\)) Subject: Re: [PATCH 08/17] mm/sparse: mark memory sections present earlier X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: <178409212284.638342.111920373776252779.b4-review@b4> Date: Thu, 16 Jul 2026 15:15:39 +0800 Cc: Muchun Song , Andrew Morton , Oscar Salvador , David Hildenbrand , linux-mm@kvack.org, Vlastimil Babka , Lorenzo Stoakes , Michal Hocko , linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: <62810479-97ED-42CE-9585-4EAA52D720FC@linux.dev> References: <20260702093821.2740183-1-songmuchun@bytedance.com> <20260702093821.2740183-9-songmuchun@bytedance.com> <178409212284.638342.111920373776252779.b4-review@b4> To: Mike Rapoport X-Migadu-Flow: FLOW_OUT > On Jul 15, 2026, at 13:08, Mike Rapoport wrote: >=20 >> Upcoming HugeTLB bootmem changes need sparsemem section metadata = before >> the HugeTLB bootmem allocation path runs. The memblock ranges are = marked >> present from sparse_init(), which is called too late for that setup. >>=20 >> Move the code that marks memblock ranges present into >> mm_core_init_early(), before free_area_init() and the HugeTLB bootmem >> setup. Rename the helper to sparse_memblock_present() to make the new >> caller describe the sparsemem-specific initialization step. >>=20 >> This is a preparatory change. >>=20 >> Signed-off-by: Muchun Song >>=20 >> diff --git a/mm/internal.h b/mm/internal.h >> index 8ec8b447d75e..11844b40f47a 100644 >> --- a/mm/internal.h >> +++ b/mm/internal.h >> @@ -960,6 +960,7 @@ void memmap_init_range(unsigned long, int, = unsigned long, unsigned long, >> * mm/sparse.c >> */ >> #ifdef CONFIG_SPARSEMEM >> +void sparse_memblock_present(void); >> void sparse_init(void); >> int sparse_index_init(unsigned long section_nr, int nid); >>=20 >> @@ -997,6 +998,7 @@ static inline void __section_mark_present(struct = mem_section *ms, >> int section_nr_vmemmap_pages(unsigned long pfn, unsigned long = nr_pages, >> struct vmem_altmap *altmap, struct dev_pagemap *pgmap); >> #else >> +static inline void sparse_memblocks_present(void) {} >=20 > Sashiko found that this fail comilation with SPARSEMEM=3Dn. >=20 > = https://sashiko.dev/#/patchset/20260702093821.2740183-1-songmuchun%40byted= ance.com?part=3D8 Thanks for the heads-up. I've noticed that as well, and I'll have it fixed in the next version. >=20 > Please build test your changes with FLATMEM and with > SPARSEMEM_VMEMMAP=3Dn. No problem. Muchun Thanks. >=20 > --=20 > Sincerely yours, > Mike.