public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, apw@shadowen.org
Subject: Re: 2.6.24-rc2-mm1 (memory hotplug x86_64/vmemmap  fix)
Date: Thu, 15 Nov 2007 11:09:07 +0530	[thread overview]
Message-ID: <20071115053907.GA11097@linux.vnet.ibm.com> (raw)
In-Reply-To: <20071115132919.f2bf4946.kamezawa.hiroyu@jp.fujitsu.com>

On Thu, Nov 15, 2007 at 01:29:19PM +0900, KAMEZAWA Hiroyuki wrote:
> Fixes for memory hotplug compile and .section handling.
> 
> This patch fixes following bugs
> ==
> WARNING: vmlinux.o(.text+0x1d07c): Section mismatch: reference to .init.text:f
> ind_e820_area (between 'init_memory_mapping' and 'arch_add_memory')
> WARNING: vmlinux.o(.text+0x946b5): Section mismatch: reference to .init.text:
> __alloc_bootmem_node (between 'vmemmap_alloc_block' and 'vmemmap_pgd_populate')
> 
> ERROR: "memory_add_physaddr_to_nid" [drivers/acpi/acpi_memhotplug.ko] undefined!
> make[1]: *** [__modpost
> ==
> 
> This patch does
>  1. export memory_add_physaddr_to_nid().
>  2. changes __init to __init_refok find_early_table_space() (x86/mm/init_64.c)
>  3. changes __init_refok to __meminit in mm/sparse.c (This is bug.)
>  4. add wrapper function to call bootmem allocator without warning.
> 
>  After seeing "3", I thought simple __init_refok is dangerous and decided to
>  add wrapper function to call bootmem, is this style acceptable ?

Hi KAMEZAWA,

Thanks for the patch, it resolves memory_add_physaddr_to_nid() build
error for me.

 Tested-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
 Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

 arch/x86/mm/init_64.c |    2 +-
 arch/x86/mm/srat_64.c |    1 +
 mm/sparse-vmemmap.c   |   13 ++++++++++++-
 mm/sparse.c           |   12 ++++++++++--
 4 files changed, 24 insertions(+), 4 deletions(-)

===================================================================
--- linux-2.6.24-rc2-mm1.orig/arch/x86/mm/srat_64.c
+++ linux-2.6.24-rc2-mm1/arch/x86/mm/srat_64.c
@@ -562,3 +562,4 @@ int memory_add_physaddr_to_nid(u64 start
 	return ret;
 }
 
+EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
Index: linux-2.6.24-rc2-mm1/arch/x86/mm/init_64.c
===================================================================
--- linux-2.6.24-rc2-mm1.orig/arch/x86/mm/init_64.c
+++ linux-2.6.24-rc2-mm1/arch/x86/mm/init_64.c
@@ -319,7 +319,7 @@ static void __meminit phys_pud_init(pud_
 	__flush_tlb();
 } 
 
-static void __init find_early_table_space(unsigned long end)
+static void __init_refok find_early_table_space(unsigned long end)
 {
 	unsigned long puds, pmds, tables, start;
 
Index: linux-2.6.24-rc2-mm1/mm/sparse.c
===================================================================
--- linux-2.6.24-rc2-mm1.orig/mm/sparse.c
+++ linux-2.6.24-rc2-mm1/mm/sparse.c
@@ -55,7 +55,15 @@ static inline void set_section_nid(unsig
 #endif
 
 #ifdef CONFIG_SPARSEMEM_EXTREME
-static struct mem_section noinline __init_refok *sparse_index_alloc(int nid)
+/*
+ * for avoiding section mismatch.
+ */
+static void __init_refok *__call_bootmem_alloc(int nid, int array_size)
+{
+	return alloc_bootmem_node(NODE_DATA(nid), array_size);
+}
+
+static struct mem_section noinline __meminit *sparse_index_alloc(int nid)
 {
 	struct mem_section *section = NULL;
 	unsigned long array_size = SECTIONS_PER_ROOT *
@@ -64,7 +72,7 @@ static struct mem_section noinline __ini
 	if (slab_is_available())
 		section = kmalloc_node(array_size, GFP_KERNEL, nid);
 	else
-		section = alloc_bootmem_node(NODE_DATA(nid), array_size);
+		section = __call_bootmem_alloc(nid, array_size);
 
 	if (section)
 		memset(section, 0, array_size);
Index: linux-2.6.24-rc2-mm1/mm/sparse-vmemmap.c
===================================================================
--- linux-2.6.24-rc2-mm1.orig/mm/sparse-vmemmap.c
+++ linux-2.6.24-rc2-mm1/mm/sparse-vmemmap.c
@@ -30,6 +30,17 @@
 #include <asm/pgtable.h>
 
 /*
+ * wrapper for calling bootmem alloc from __meminit code.
+ */
+void __init_refok *__call_alloc_bootmem(int node,
+			int size, int align, int goal)
+{
+	return __alloc_bootmem_node(NODE_DATA(node), size, align, goal);
+}
+
+
+
+/*
  * Allocate a block of memory to be used to back the virtual memory map
  * or to back the page tables that are used to create the mapping.
  * Uses the main allocators if they are available, else bootmem.
@@ -44,7 +55,7 @@ void * __meminit vmemmap_alloc_block(uns
 			return page_address(page);
 		return NULL;
 	} else
-		return __alloc_bootmem_node(NODE_DATA(node), size, size,
+		return __call_alloc_bootmem(node, size, size,
 				__pa(MAX_DMA_ADDRESS));
 }
 


  reply	other threads:[~2007-11-15  5:39 UTC|newest]

Thread overview: 148+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-14  1:59 2.6.24-rc2-mm1 Andrew Morton
2007-11-14  3:12 ` 2.6.24-rc2-mm1 Gabriel C
2007-11-14  3:49   ` 2.6.24-rc2-mm1 Greg KH
2007-11-14  4:39     ` 2.6.24-rc2-mm1 Matthew Dharm
2007-11-14  5:33       ` 2.6.24-rc2-mm1 Gabriel C
2007-11-14  8:23         ` 2.6.24-rc2-mm1 Matthew Dharm
2007-11-14  9:23           ` 2.6.24-rc2-mm1 Gabriel C
2007-11-15 17:15             ` 2.6.24-rc2-mm1 Matthew Dharm
2007-11-15 18:14               ` 2.6.24-rc2-mm1 Boaz Harrosh
2007-11-15 21:42                 ` 2.6.24-rc2-mm1 Gabriel C
2007-11-14  4:18   ` 2.6.24-rc2-mm1 Gabriel C
2007-11-14 20:29     ` 2.6.24-rc2-mm1 mark gross
2007-11-14 20:40       ` 2.6.24-rc2-mm1 Andrew Morton
2007-11-15 17:22         ` 2.6.24-rc2-mm1 mark gross
2007-11-15 20:05           ` 2.6.24-rc2-mm1 Andrew Morton
2007-11-15 17:23         ` 2.6.24-rc2-mm1 mark gross
2007-11-15 19:19         ` 2.6.24-rc2-mm1 mark gross
2007-11-15 21:40           ` 2.6.24-rc2-mm1 Gabriel C
2007-11-15 22:56           ` 2.6.24-rc2-mm1 mark gross
2007-11-15 23:01           ` [PATCH] pm-qos-remove-locks-around-blocking-notifier.patch ... was 2.6.24-rc2-mm1 mark gross
2007-11-14  3:40 ` [PATCH] Fix build failure when CONFIG_INFINIBAND_IPOIB_CM is not defined Tony Breeds
2007-11-15 14:49   ` Mel Gorman
2007-11-14  3:41 ` 2.6.24-rc2-mm1 Gabriel C
2007-11-14  4:55   ` 2.6.24-rc2-mm1 Andrew Morton
2007-11-14  5:10     ` 2.6.24-rc2-mm1 Ulrich Drepper
2007-11-14  5:27     ` 2.6.24-rc2-mm1 Gabriel C
2007-11-14  5:45     ` 2.6.24-rc2-mm1 Zan Lynx
2007-11-14  6:18 ` 2.6.24-rc2-mm1 Dave Young
2007-11-14  6:38   ` 2.6.24-rc2-mm1 Andrew Morton
2007-11-14  6:47     ` 2.6.24-rc2-mm1 Dave Young
2007-11-14  8:41       ` 2.6.24-rc2-mm1 Andrew Morton
2007-11-14  9:32         ` 2.6.24-rc2-mm1 Andrew Morton
2007-11-14  9:36         ` 2.6.24-rc2-mm1 Dave Young
2007-11-14 16:59           ` 2.6.24-rc2-mm1 Greg KH
2007-11-14 18:38             ` 2.6.24-rc2-mm1 Kay Sievers
2007-11-14 19:19               ` 2.6.24-rc2-mm1 Jiri Kosina
2007-11-14 21:27                 ` 2.6.24-rc2-mm1 Kay Sievers
2007-11-15  1:01                   ` 2.6.24-rc2-mm1 Dave Young
2007-11-15  2:38                     ` 2.6.24-rc2-mm1 Kay Sievers
2007-11-15  3:11                       ` 2.6.24-rc2-mm1 Dave Young
2007-11-15  8:14                       ` 2.6.24-rc2-mm1 Dave Young
2007-11-15  8:51                         ` 2.6.24-rc2-mm1 Kay Sievers
2007-11-15 17:06                         ` 2.6.24-rc2-mm1 Greg KH
2007-11-15 17:16                           ` 2.6.24-rc2-mm1 Kay Sievers
2007-11-15 18:59                             ` 2.6.24-rc2-mm1 Greg KH
2007-11-14  6:32 ` [PATCH] [2.6.24-rc2-mm1] Fix dependencies for FSL_DMA Olof Johansson
2007-11-14  8:56 ` 2.6.24-rc2-mm1 -- mkfs failing on variety of fs types Andy Whitcroft
2007-11-14 10:28   ` Andrew Morton
2007-11-14 10:46     ` Dmitry Monakhov
2007-11-14 14:40 ` 2.6.24-rc2-mm1 Jiri Kosina
2007-11-14 14:59   ` 2.6.24-rc2-mm1 Matthias Urlichs
2007-11-14 15:04     ` 2.6.24-rc2-mm1 Jiri Kosina
2007-11-14 15:43       ` 2.6.24-rc2-mm1 Matthias Urlichs
2007-11-14 15:49         ` 2.6.24-rc2-mm1 Jiri Kosina
2007-11-14 16:29 ` 2.6.24-rc2-mm1 Jiri Kosina
2007-11-14 16:39   ` 2.6.24-rc2-mm1 Andrew Morton
2007-11-14 16:40     ` 2.6.24-rc2-mm1 Jiri Kosina
2007-11-14 17:02       ` 2.6.24-rc2-mm1 Jiri Kosina
2007-11-14 17:38         ` 2.6.24-rc2-mm1 Jiri Kosina
2007-11-14 18:19         ` 2.6.24-rc2-mm1 Greg KH
2007-11-15 19:23           ` 2.6.24-rc2-mm1 Greg KH
2007-11-15 21:41             ` 2.6.24-rc2-mm1 Jiri Kosina
2007-11-15 21:53               ` 2.6.24-rc2-mm1 Andrew Morton
2007-11-15 22:04                 ` 2.6.24-rc2-mm1 Jiri Kosina
2007-11-16  0:39             ` 2.6.24-rc2-mm1 Dave Young
2007-11-16  0:49               ` 2.6.24-rc2-mm1 Greg KH
2007-11-16  0:55                 ` 2.6.24-rc2-mm1 Dave Young
2007-11-14 19:16 ` 2.6.24-rc2-mm1 Torsten Kaiser
2007-11-14 20:29   ` 2.6.24-rc2-mm1 Andrew Morton
2007-11-14 20:55     ` 2.6.24-rc2-mm1 Torsten Kaiser
2007-11-14 22:48     ` 2.6.24-rc2-mm1 Torsten Kaiser
2007-11-15 17:36       ` 2.6.24-rc2-mm1 Jan Blunck
2007-11-15 18:36         ` 2.6.24-rc2-mm1 Torsten Kaiser
2007-11-15 21:24         ` 2.6.24-rc2-mm1 Torsten Kaiser
2007-11-15 21:34           ` 2.6.24-rc2-mm1 Andrew Morton
2007-11-16  5:29             ` 2.6.24-rc2-mm1 Torsten Kaiser
2007-11-16 14:03           ` 2.6.24-rc2-mm1 Jan Blunck
2007-11-16 20:11             ` 2.6.24-rc2-mm1 Torsten Kaiser
2007-11-14 20:24 ` broken suspend [Was: 2.6.24-rc2-mm1] Jiri Slaby
2007-11-14 20:36   ` Andrew Morton
2007-11-14 21:48   ` Rafael J. Wysocki
2007-11-15 23:59     ` Jiri Slaby
2007-11-16  0:38       ` Greg KH
2007-11-16 16:10         ` Alan Stern
2007-11-17 15:08           ` Jiri Slaby
2007-11-17 15:12             ` Jiri Slaby
2007-11-17 16:13             ` Alan Stern
2007-11-17 20:37             ` Rafael J. Wysocki
2007-11-17 21:58               ` Alan Stern
2007-11-18 12:42                 ` Jiri Slaby
2007-11-18 13:06                   ` Jiri Slaby
2007-11-18 13:42                     ` Rafael J. Wysocki
2007-11-18 13:53                       ` Jiri Slaby
2007-11-18 15:03                         ` Rafael J. Wysocki
2007-11-18 14:49                           ` Jiri Slaby
2007-11-18 15:23                             ` Rafał J. Wysocki
2007-11-18 15:15                               ` Jiri Slaby
2007-11-18 17:07                                 ` Alan Stern
2007-11-18 19:09                                   ` Jiri Slaby
2007-11-18 22:27                                     ` Jiri Slaby
2007-11-19  3:04                                       ` Alan Stern
2007-11-19 20:01                                         ` Rudolf Marek
2007-11-19 20:27                                           ` Alan Stern
2007-11-20 13:15                                             ` [lm-sensors] " Mark M. Hoffman
2007-11-21  0:00                                               ` Rafael J. Wysocki
2007-11-21 15:54                                                 ` Alan Stern
2007-11-21 19:19                                                   ` Rafael J. Wysocki
2007-11-26  8:57                                                 ` Jiri Slaby
2007-11-19 21:53                                           ` Rafael J. Wysocki
2007-11-18 22:27                                     ` Rafael J. Wysocki
2007-11-18 22:12                                       ` Jiri Slaby
2007-11-18 22:42                                         ` Rafael J. Wysocki
2007-11-15  4:29 ` 2.6.24-rc2-mm1 (memory hotplug x86_64/vmemmap fix) KAMEZAWA Hiroyuki
2007-11-15  5:39   ` Kamalesh Babulal [this message]
2007-11-15  8:56   ` Andrew Morton
2007-11-15  9:18     ` KAMEZAWA Hiroyuki
2007-11-15 10:30       ` [PATCH][2.6.24-rc2-mm1] memory hotplug x86_64 fix [0/3] KAMEZAWA Hiroyuki
2007-11-15 10:33         ` [PATCH][2.6.24-rc2-mm1] memory hotplug x86_64 fix [1/3] memory_add_physaddr_to_nid export for acpi memhotplug.ko KAMEZAWA Hiroyuki
2007-11-15 10:35         ` [PATCH][2.6.24-rc2-mm1] memory hotplug x86_64 fix [2/3] fix section mismatch in vmammap_allock_block KAMEZAWA Hiroyuki
2007-11-16  0:53           ` Andrew Morton
2007-11-16  4:45             ` KAMEZAWA Hiroyuki
2007-11-15 10:36         ` [PATCH][2.6.24-rc2-mm1] memory hotplug x86_64 fix [3/3] fix section mismatch in init_memory_mapping KAMEZAWA Hiroyuki
2007-11-16  0:59           ` Andrew Morton
2007-11-16  5:09             ` KAMEZAWA Hiroyuki
2007-11-15  9:39   ` 2.6.24-rc2-mm1 (memory hotplug x86_64/vmemmap fix) Andy Whitcroft
2007-11-15 10:05     ` KAMEZAWA Hiroyuki
2007-11-15 10:02 ` 2.6.24-rc2-mm1 -- strange apparent network failures Andy Whitcroft
2007-11-16  0:28   ` Kevin Winchester
2007-11-16  0:44     ` Andrew Morton
2007-11-16  1:01       ` Kevin Winchester
2007-11-16  1:09         ` Andrew Morton
2007-11-17  5:16       ` Andrew Morgan
2007-11-17 12:48         ` Kevin Winchester
2007-11-17 23:52           ` Andrew Morgan
2007-11-18  0:50             ` Kevin Winchester
2007-11-18  1:17               ` Kevin Winchester
2007-11-18  1:57               ` Andrew Morgan
2007-11-18  1:23             ` Kevin Winchester
2007-11-17 13:57         ` Andy Whitcroft
2007-11-16  1:21     ` Tom
2007-11-15 10:50 ` 2.6.24-rc2-mm1 -- QLogics ISP1020 gone missing Andy Whitcroft
2007-11-15 19:25 ` 2.6.24-rc2-mm1 Greg KH
2007-11-15 20:47   ` 2.6.24-rc2-mm1 Andrew Morton
2007-11-16  0:01     ` 2.6.24-rc2-mm1 Greg KH
2007-11-15 22:25 ` 2.6.24-rc2-mm1: undefined reference to `local_apic_timer_c2_ok' Mariusz Kozlowski
2007-11-15 22:49   ` Len Brown
2007-11-15 23:35     ` Mariusz Kozlowski
2007-11-15 22:34 ` [PATCH] parisc: balance parenthesis in pte_free_kernel() Mariusz Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071115053907.GA11097@linux.vnet.ibm.com \
    --to=kamalesh@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@shadowen.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox