All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the liveupdate tree with the mm-unstable tree
@ 2026-07-28 16:27 Mark Brown
  2026-07-28 17:38 ` Mike Rapoport
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2026-07-28 16:27 UTC (permalink / raw)
  To: Mike Rapoport, Andrew Morton, Pasha Tatashin, Pratyush Yadav
  Cc: Linux Kernel Mailing List, Linux Next Mailing List, Muchun Song,
	Muchun Song

[-- Attachment #1: Type: text/plain, Size: 4296 bytes --]

Hi all,

Today's linux-next merge of the liveupdate tree got a conflict in:

  mm/hugetlb.c
  mm/mm_init.c

between at least commit:

  7b558c2570017 ("mm/hugetlb: refactor early boot gigantic hugepage allocation")

from the mm-unstable tree and commit:

  7c967e2d549dc ("memblock: make HugeTLB bootmem allocation work with KHO")
  f476132a8999e ("mm/mm_init: don't rely on memblock to get KHO scratch migratetype")

from the liveupdate tree.

I stared at the conflict for a bit but with my minimal familiarity with
this code I have absolutely no confidence in my ability to do a working
resolution for this in a timely fashion so instead I merged the version
of liveupdate from next-20260727, I'll have another look tomorrow but
would really appreciate it if someone could help out here.

diff --cc mm/hugetlb.c
index a77c3c1cb8943,ab4afc818e8cb..0000000000000
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@@ -3076,23 -3027,51 +3076,60 @@@ out_end_reservation
  
  static __init void *alloc_bootmem(struct hstate *h, int nid, bool node_exact)
  {
 -	struct huge_bootmem_page *m;
 -	int listnode = nid;
 -
  	if (hugetlb_early_cma(h))
++<<<<<<< HEAD
 +		return hugetlb_cma_alloc_bootmem(h, nid, node_exact);
 +
 +	if (node_exact)
 +		return memblock_alloc_exact_nid_raw(huge_page_size(h),
 +				huge_page_size(h), 0,
 +				MEMBLOCK_ALLOC_ACCESSIBLE, nid);
 +
 +	return memblock_alloc_try_nid_raw(huge_page_size(h),
 +				huge_page_size(h), 0,
 +				MEMBLOCK_ALLOC_ACCESSIBLE, nid);
++=======
+ 		m = hugetlb_cma_alloc_bootmem(h, &listnode, node_exact);
+ 	else {
+ 		m = memblock_alloc_hugetlb(huge_page_size(h), nid, node_exact);
+ 		if (m) {
+ 			m->flags = 0;
+ 			m->cma = NULL;
+ 
+ 			/*
+ 			 * For pre-HVO to work correctly, pages need to be on
+ 			 * the list for the node they were actually allocated
+ 			 * from. That node may be different in the case of
+ 			 * fallback by memblock_alloc_hugetlb_bootmem. So,
+ 			 * extract the actual node first.
+ 			 */
+ 			if (!node_exact)
+ 				listnode = early_pfn_to_nid(PHYS_PFN(__pa(m)));
+ 		}
+ 	}
+ 
+ 	if (m) {
+ 		/*
+ 		 * Use the beginning of the huge page to store the
+ 		 * huge_bootmem_page struct (until gather_bootmem
+ 		 * puts them into the mem_map).
+ 		 *
+ 		 * Put them into a private list first because mem_map
+ 		 * is not up yet.
+ 		 */
+ 		INIT_LIST_HEAD(&m->list);
+ 		list_add(&m->list, &huge_boot_pages[listnode]);
+ 		m->hstate = h;
+ 	}
+ 
+ 	return m;
++>>>>>>> liveupdate/next
  }
  
 -int alloc_bootmem_huge_page(struct hstate *h, int nid)
 +void *__init arch_alloc_bootmem_huge_page(struct hstate *h, int nid)
  	__attribute__ ((weak, alias("__alloc_bootmem_huge_page")));
 -int __alloc_bootmem_huge_page(struct hstate *h, int nid)
 +void *__init __alloc_bootmem_huge_page(struct hstate *h, int nid)
  {
 -	struct huge_bootmem_page *m = NULL; /* initialize for clang */
  	int nr_nodes, node = nid;
  
  	/* do node specific alloc */
diff --cc mm/mm_init.c
index 18befe5759310,dc20d6814e48b..0000000000000
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@@ -685,7 -681,9 +685,13 @@@ static __meminit void pageblock_migrate
  	const unsigned long end = pfn + nr_pages;
  
  	for (pfn = pageblock_align(pfn); pfn < end; pfn += pageblock_nr_pages) {
++<<<<<<< HEAD
 +		init_pageblock_migratetype(pfn_to_page(pfn), migratetype, false);
++=======
+ 		enum migratetype mt = kho_scratch_migratetype(pfn, migratetype);
+ 
+ 		init_pageblock_migratetype(pfn_to_page(pfn), mt, false);
++>>>>>>> liveupdate/next
  		if (!atomic && IS_ALIGNED(pfn, PAGES_PER_SECTION))
  			cond_resched();
  	}
@@@ -1978,7 -1982,7 +1983,11 @@@ static void __init deferred_free_pages(
  	if (!nr_pages)
  		return;
  
++<<<<<<< HEAD
 +	pageblock_migratetype_init_range(pfn, nr_pages, mt, true);
++=======
+ 	pageblock_migratetype_init_range(pfn, nr_pages, MIGRATE_MOVABLE, true);
++>>>>>>> liveupdate/next
  
  	page = pfn_to_page(pfn);
  
@@@ -2682,8 -2683,7 +2689,12 @@@ void __init __weak mem_init(void
  
  void __init mm_core_init_early(void)
  {
++<<<<<<< HEAD
 +	free_area_init();
 +
++=======
+ 	kho_memory_init_early();
++>>>>>>> liveupdate/next
  	hugetlb_cma_reserve();
  	hugetlb_bootmem_alloc();

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: linux-next: manual merge of the liveupdate tree with the mm-unstable tree
  2026-07-28 16:27 linux-next: manual merge of the liveupdate tree with the mm-unstable tree Mark Brown
@ 2026-07-28 17:38 ` Mike Rapoport
  2026-07-28 17:56   ` Mark Brown
  2026-07-28 20:43   ` Andrew Morton
  0 siblings, 2 replies; 4+ messages in thread
From: Mike Rapoport @ 2026-07-28 17:38 UTC (permalink / raw)
  To: Mark Brown
  Cc: Andrew Morton, Pasha Tatashin, Pratyush Yadav,
	Linux Kernel Mailing List, Linux Next Mailing List, Muchun Song,
	Muchun Song

On Tue, Jul 28, 2026 at 05:27:05PM +0100, Mark Brown wrote:
> Hi all,
> 
> Today's linux-next merge of the liveupdate tree got a conflict in:
> 
>   mm/hugetlb.c
>   mm/mm_init.c
> 
> between at least commit:
> 
>   7b558c2570017 ("mm/hugetlb: refactor early boot gigantic hugepage allocation")
> 
> from the mm-unstable tree and commit:
> 
>   7c967e2d549dc ("memblock: make HugeTLB bootmem allocation work with KHO")
>   f476132a8999e ("mm/mm_init: don't rely on memblock to get KHO scratch migratetype")
> 
> from the liveupdate tree.
> 
> I stared at the conflict for a bit but with my minimal familiarity with
> this code I have absolutely no confidence in my ability to do a working
> resolution for this in a timely fashion so instead I merged the version
> of liveupdate from next-20260727, I'll have another look tomorrow but
> would really appreciate it if someone could help out here.

I've got this for merging mm-unstable into liveupdate/next:

diff --cc mm/hugetlb.c
index ab4afc818e8cb,a77c3c1cb8943..0000000000000
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@@ -3027,51 -3076,23 +3076,16 @@@ out_end_reservation
  
  static __init void *alloc_bootmem(struct hstate *h, int nid, bool node_exact)
  {
- 	struct huge_bootmem_page *m;
- 	int listnode = nid;
- 
  	if (hugetlb_early_cma(h))
- 		m = hugetlb_cma_alloc_bootmem(h, &listnode, node_exact);
- 	else {
- 		m = memblock_alloc_hugetlb(huge_page_size(h), nid, node_exact);
- 		if (m) {
- 			m->flags = 0;
- 			m->cma = NULL;
+ 		return hugetlb_cma_alloc_bootmem(h, nid, node_exact);
  
- 			/*
- 			 * For pre-HVO to work correctly, pages need to be on
- 			 * the list for the node they were actually allocated
- 			 * from. That node may be different in the case of
- 			 * fallback by memblock_alloc_hugetlb_bootmem. So,
- 			 * extract the actual node first.
- 			 */
- 			if (!node_exact)
- 				listnode = early_pfn_to_nid(PHYS_PFN(__pa(m)));
- 		}
- 	}
- 
- 	if (m) {
- 		/*
- 		 * Use the beginning of the huge page to store the
- 		 * huge_bootmem_page struct (until gather_bootmem
- 		 * puts them into the mem_map).
- 		 *
- 		 * Put them into a private list first because mem_map
- 		 * is not up yet.
- 		 */
- 		INIT_LIST_HEAD(&m->list);
- 		list_add(&m->list, &huge_boot_pages[listnode]);
- 		m->hstate = h;
- 	}
 -	if (node_exact)
 -		return memblock_alloc_exact_nid_raw(huge_page_size(h),
 -				huge_page_size(h), 0,
 -				MEMBLOCK_ALLOC_ACCESSIBLE, nid);
--
- 	return m;
 -	return memblock_alloc_try_nid_raw(huge_page_size(h),
 -				huge_page_size(h), 0,
 -				MEMBLOCK_ALLOC_ACCESSIBLE, nid);
++	return memblock_alloc_hugetlb(huge_page_size(h), nid, node_exact);
  }
  
- int alloc_bootmem_huge_page(struct hstate *h, int nid)
+ void *__init arch_alloc_bootmem_huge_page(struct hstate *h, int nid)
  	__attribute__ ((weak, alias("__alloc_bootmem_huge_page")));
- int __alloc_bootmem_huge_page(struct hstate *h, int nid)
+ void *__init __alloc_bootmem_huge_page(struct hstate *h, int nid)
  {
- 	struct huge_bootmem_page *m = NULL; /* initialize for clang */
  	int nr_nodes, node = nid;
  
  	/* do node specific alloc */
diff --cc mm/mm_init.c
index dc20d6814e48b,711f821f7b3c7..0000000000000
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@@ -2683,7 -2683,8 +2682,9 @@@ void __init __weak mem_init(void
  
  void __init mm_core_init_early(void)
  {
 +	kho_memory_init_early();
+ 	free_area_init();
+ 
  	hugetlb_cma_reserve();
  	hugetlb_bootmem_alloc();



-- 
Sincerely yours,
Mike.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: linux-next: manual merge of the liveupdate tree with the mm-unstable tree
  2026-07-28 17:38 ` Mike Rapoport
@ 2026-07-28 17:56   ` Mark Brown
  2026-07-28 20:43   ` Andrew Morton
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2026-07-28 17:56 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: Andrew Morton, Pasha Tatashin, Pratyush Yadav,
	Linux Kernel Mailing List, Linux Next Mailing List, Muchun Song,
	Muchun Song

[-- Attachment #1: Type: text/plain, Size: 383 bytes --]

On Tue, Jul 28, 2026 at 08:38:54PM +0300, Mike Rapoport wrote:
> On Tue, Jul 28, 2026 at 05:27:05PM +0100, Mark Brown wrote:

> > of liveupdate from next-20260727, I'll have another look tomorrow but
> > would really appreciate it if someone could help out here.

> I've got this for merging mm-unstable into liveupdate/next:

Thanks Mike, all being well I'll go with that tomorrow.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: linux-next: manual merge of the liveupdate tree with the mm-unstable tree
  2026-07-28 17:38 ` Mike Rapoport
  2026-07-28 17:56   ` Mark Brown
@ 2026-07-28 20:43   ` Andrew Morton
  1 sibling, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2026-07-28 20:43 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: Mark Brown, Pasha Tatashin, Pratyush Yadav,
	Linux Kernel Mailing List, Linux Next Mailing List, Muchun Song,
	Muchun Song

On Tue, 28 Jul 2026 20:38:54 +0300 Mike Rapoport <rppt@kernel.org> wrote:

> I've got this for merging mm-unstable into liveupdate/next:
> 
> diff --cc mm/hugetlb.c
> index ab4afc818e8cb,a77c3c1cb8943..0000000000000
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c

Well that's a pain.  I'll get the series "mm: Refactor bootmem gigantic
hugepage allocation" into mm-stable in the next couple of days.  Can we
then make this issue go away?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-07-28 20:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-28 16:27 linux-next: manual merge of the liveupdate tree with the mm-unstable tree Mark Brown
2026-07-28 17:38 ` Mike Rapoport
2026-07-28 17:56   ` Mark Brown
2026-07-28 20:43   ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.