Re: mmotm 2008-09-22-01-36 uploaded (memory_hotplug)

Previous thread: [PATCH 0/9][RFC] stackable dma_ops for x86 by Joerg Roedel on Monday, September 22, 2008 - 11:21 am. (44 messages)

Next thread: [PATCH] [WIRELESS CORE] a global static to local static improvement by Denis ChengRq on Monday, September 22, 2008 - 11:35 am. (1 message)
From: Randy Dunlap
Date: Monday, September 22, 2008 - 11:29 am

mm/built-in.o: In function `remove_memory':
(.text+0x497ed): multiple definition of `remove_memory'
arch/x86/mm/built-in.o:(.text+0x3d8): first defined here
make[1]: *** [vmlinux.o] Error 1


so it is defined in both mm/memory_hotplug.c and
arch/x86/mm/init_64.c when CONFIG_MEMORY_HOTREMOVE=y.

---
~Randy
--

From: Andrew Morton
Date: Monday, September 22, 2008 - 12:57 pm

On Mon, 22 Sep 2008 11:29:18 -0700

OK, thanks, it looks like people are changing things under our feet.

Badari, can you please check this fix against
mm-cleanup-to-make-remove_memory-arch-neutral.patch?



diff -puN arch/sh/mm/init.c~mm-cleanup-to-make-remove_memory-arch-neutral-fix-fix arch/sh/mm/init.c
--- a/arch/sh/mm/init.c~mm-cleanup-to-make-remove_memory-arch-neutral-fix-fix
+++ a/arch/sh/mm/init.c
@@ -293,20 +293,4 @@ int memory_add_physaddr_to_nid(u64 addr)
 EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
 #endif
 
-#ifdef CONFIG_MEMORY_HOTREMOVE
-int remove_memory(u64 start, u64 size)
-{
-	unsigned long start_pfn = start >> PAGE_SHIFT;
-	unsigned long end_pfn = start_pfn + (size >> PAGE_SHIFT);
-	int ret;
-
-	ret = offline_pages(start_pfn, end_pfn, 120 * HZ);
-	if (unlikely(ret))
-		printk("%s: Failed, offline_pages() == %d\n", __func__, ret);
-
-	return ret;
-}
-EXPORT_SYMBOL_GPL(remove_memory);
-#endif
-
 #endif /* CONFIG_MEMORY_HOTPLUG */
diff -puN arch/x86/mm/init_64.c~mm-cleanup-to-make-remove_memory-arch-neutral-fix-fix arch/x86/mm/init_64.c
--- a/arch/x86/mm/init_64.c~mm-cleanup-to-make-remove_memory-arch-neutral-fix-fix
+++ a/arch/x86/mm/init_64.c
@@ -796,24 +796,6 @@ int memory_add_physaddr_to_nid(u64 start
 EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
 #endif
 
-#ifdef CONFIG_MEMORY_HOTREMOVE
-int remove_memory(u64 start, u64 size)
-{
-	unsigned long start_pfn, end_pfn;
-	unsigned long timeout = 120 * HZ;
-	int ret;
-	start_pfn = start >> PAGE_SHIFT;
-	end_pfn = start_pfn + (size >> PAGE_SHIFT);
-	ret = offline_pages(start_pfn, end_pfn, timeout);
-	if (ret)
-		goto out;
-	/* Arch-specific calls go here */
-out:
-	return ret;
-}
-EXPORT_SYMBOL_GPL(remove_memory);
-#endif /* CONFIG_MEMORY_HOTREMOVE */
-
 #endif /* CONFIG_MEMORY_HOTPLUG */
 
 /*
_

--

From: Badari Pulavarty
Date: Tuesday, September 23, 2008 - 3:08 pm

When I made the patch, only ppc64, ia64 and s390 had
memory_remove() support in mainline. I sent a patch against
x86 to add hotplug memory remove support. I guess you
merged Gary's patch and sh-arch patch.

I noticed that you cleaned up all these and added to -mm.
Do you want me to merge all these into a single patch and 
resend it (against -mm) ? (It will look exactly the same
anyway).


Thanks,

--

From: Andrew Morton
Date: Tuesday, September 23, 2008 - 3:17 pm

On Tue, 23 Sep 2008 15:08:22 -0700


Does that mean you reviewed all the fixes I added?  We're sure that all
the per-arch implementations of remove_memory() can be replaced by the
generic one?

--

From: Badari Pulavarty
Date: Tuesday, September 23, 2008 - 4:14 pm

Yes. I just reviewed all these patches in mmtom 2008-09-23. 
They looked fine. There is no need for arch-specific ones.

Thanks,
Badari

--

Previous thread: [PATCH 0/9][RFC] stackable dma_ops for x86 by Joerg Roedel on Monday, September 22, 2008 - 11:21 am. (44 messages)

Next thread: [PATCH] [WIRELESS CORE] a global static to local static improvement by Denis ChengRq on Monday, September 22, 2008 - 11:35 am. (1 message)