All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] use no-panic variant of alloc_bootmem() in alloc_large_system_hash()
@ 2008-08-04 13:35 Jan Beulich
  2008-08-13  8:17 ` [PATCH] Propagate new nonpanic bootmem macros to CONFIG_HAVE_ARCH_BOOTMEM_NODE Johannes Weiner
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Beulich @ 2008-08-04 13:35 UTC (permalink / raw)
  To: linux-kernel; +Cc: dhowells

.. since a failed allocation is being (initially) handled gracefully,
and panic()-ed upon failure explicitly in the function if retries with
smaller sizes failed.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: David Howells <dhowells@redhat.com>

---
 include/linux/bootmem.h |    4 ++++
 mm/page_alloc.c         |    2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

--- linux-2.6.27-rc1/include/linux/bootmem.h	2008-07-31 17:08:35.000000000 +0200
+++ 2.6.27-rc1-alloc-large-system-hash/include/linux/bootmem.h	2008-07-31 17:56:18.000000000 +0200
@@ -97,10 +97,14 @@ extern void *__alloc_bootmem_low_node(pg
 #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
 #define alloc_bootmem(x) \
 	__alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
+#define alloc_bootmem_nopanic(x) \
+	__alloc_bootmem_nopanic(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
 #define alloc_bootmem_low(x) \
 	__alloc_bootmem_low(x, SMP_CACHE_BYTES, 0)
 #define alloc_bootmem_pages(x) \
 	__alloc_bootmem(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
+#define alloc_bootmem_pages_nopanic(x) \
+	__alloc_bootmem_nopanic(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
 #define alloc_bootmem_low_pages(x) \
 	__alloc_bootmem_low(x, PAGE_SIZE, 0)
 #define alloc_bootmem_node(pgdat, x) \
--- linux-2.6.27-rc1/mm/page_alloc.c	2008-07-31 17:08:36.000000000 +0200
+++ 2.6.27-rc1-alloc-large-system-hash/mm/page_alloc.c	2008-07-31 17:56:37.000000000 +0200
@@ -4454,7 +4454,7 @@ void *__init alloc_large_system_hash(con
 	do {
 		size = bucketsize << log2qty;
 		if (flags & HASH_EARLY)
-			table = alloc_bootmem(size);
+			table = alloc_bootmem_nopanic(size);
 		else if (hashdist)
 			table = __vmalloc(size, GFP_ATOMIC, PAGE_KERNEL);
 		else {




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

* [PATCH] Propagate new nonpanic bootmem macros to CONFIG_HAVE_ARCH_BOOTMEM_NODE
  2008-08-04 13:35 [PATCH] use no-panic variant of alloc_bootmem() in alloc_large_system_hash() Jan Beulich
@ 2008-08-13  8:17 ` Johannes Weiner
  2008-08-13  8:30   ` Jan Beulich
  2008-08-13  8:48   ` Ingo Molnar
  0 siblings, 2 replies; 7+ messages in thread
From: Johannes Weiner @ 2008-08-13  8:17 UTC (permalink / raw)
  To: Jan Beulich; +Cc: linux-kernel, dhowells, Linus Torvalds, Ingo Molnar

Commit 74768ed833344b "page allocator: use no-panic variant of
alloc_bootmem() in alloc_large_system_hash()" introduced two new
_nopanic macros which are undefined for CONFIG_HAVE_ARCH_BOOTMEM_NODE.

Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
---

These macros are a mess... :(

diff --git a/include/asm-x86/mmzone_32.h b/include/asm-x86/mmzone_32.h
index b2298a2..5862e64 100644
--- a/include/asm-x86/mmzone_32.h
+++ b/include/asm-x86/mmzone_32.h
@@ -97,10 +97,16 @@ static inline int pfn_valid(int pfn)
 	reserve_bootmem_node(NODE_DATA(0), (addr), (size), (flags))
 #define alloc_bootmem(x) \
 	__alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
+#define alloc_bootmem_nopanic(x) \
+	__alloc_bootmem_node_nopanic(NODE_DATA(0), (x), SMP_CACHE_BYTES, \
+				__pa(MAX_DMA_ADDRESS))
 #define alloc_bootmem_low(x) \
 	__alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, 0)
 #define alloc_bootmem_pages(x) \
 	__alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
+#define alloc_bootmem_pages_nopanic(x) \
+	__alloc_bootmem_node_nopanic(NODE_DATA(0), (x), PAGE_SIZE, \
+				__pa(MAX_DMA_ADDRESS))
 #define alloc_bootmem_low_pages(x) \
 	__alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0)
 #define alloc_bootmem_node(pgdat, x)					\

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

* Re: [PATCH] Propagate new nonpanic bootmem macros to CONFIG_HAVE_ARCH_BOOTMEM_NODE
  2008-08-13  8:17 ` [PATCH] Propagate new nonpanic bootmem macros to CONFIG_HAVE_ARCH_BOOTMEM_NODE Johannes Weiner
@ 2008-08-13  8:30   ` Jan Beulich
  2008-08-13  8:55     ` Ingo Molnar
  2008-08-13  8:48   ` Ingo Molnar
  1 sibling, 1 reply; 7+ messages in thread
From: Jan Beulich @ 2008-08-13  8:30 UTC (permalink / raw)
  To: Johannes Weiner; +Cc: Ingo Molnar, Linus Torvalds, dhowells, linux-kernel

Sorry for not noticing this:
Acked-by: Jan Beulich <jbeulich@novell.com>

>>> Johannes Weiner <hannes@saeurebad.de> 13.08.08 10:17 >>>
Commit 74768ed833344b "page allocator: use no-panic variant of
alloc_bootmem() in alloc_large_system_hash()" introduced two new
_nopanic macros which are undefined for CONFIG_HAVE_ARCH_BOOTMEM_NODE.

Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
---

These macros are a mess... :(

diff --git a/include/asm-x86/mmzone_32.h b/include/asm-x86/mmzone_32.h
index b2298a2..5862e64 100644
--- a/include/asm-x86/mmzone_32.h
+++ b/include/asm-x86/mmzone_32.h
@@ -97,10 +97,16 @@ static inline int pfn_valid(int pfn)
 	reserve_bootmem_node(NODE_DATA(0), (addr), (size), (flags))
 #define alloc_bootmem(x) \
 	__alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
+#define alloc_bootmem_nopanic(x) \
+	__alloc_bootmem_node_nopanic(NODE_DATA(0), (x), SMP_CACHE_BYTES, \
+				__pa(MAX_DMA_ADDRESS))
 #define alloc_bootmem_low(x) \
 	__alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, 0)
 #define alloc_bootmem_pages(x) \
 	__alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
+#define alloc_bootmem_pages_nopanic(x) \
+	__alloc_bootmem_node_nopanic(NODE_DATA(0), (x), PAGE_SIZE, \
+				__pa(MAX_DMA_ADDRESS))
 #define alloc_bootmem_low_pages(x) \
 	__alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0)
 #define alloc_bootmem_node(pgdat, x)					\


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

* Re: [PATCH] Propagate new nonpanic bootmem macros to CONFIG_HAVE_ARCH_BOOTMEM_NODE
  2008-08-13  8:17 ` [PATCH] Propagate new nonpanic bootmem macros to CONFIG_HAVE_ARCH_BOOTMEM_NODE Johannes Weiner
  2008-08-13  8:30   ` Jan Beulich
@ 2008-08-13  8:48   ` Ingo Molnar
  1 sibling, 0 replies; 7+ messages in thread
From: Ingo Molnar @ 2008-08-13  8:48 UTC (permalink / raw)
  To: Johannes Weiner; +Cc: Jan Beulich, linux-kernel, dhowells, Linus Torvalds


* Johannes Weiner <hannes@saeurebad.de> wrote:

> Commit 74768ed833344b "page allocator: use no-panic variant of 
> alloc_bootmem() in alloc_large_system_hash()" introduced two new 
> _nopanic macros which are undefined for CONFIG_HAVE_ARCH_BOOTMEM_NODE.

the above bootmem commit from yesterday broke the -rc3 32-bit NUMA 
build:

 mm/page_alloc.c: In function ‘alloc_large_system_hash':
 mm/page_alloc.c:4440: error: implicit declaration of function ‘alloc_bootmem_nopanic'
 mm/page_alloc.c:4440: warning: assignment makes pointer from integer without a cast

i have queued your fix up in tip/x86/urgent, thanks Johannes.

	Ingo

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

* Re: [PATCH] Propagate new nonpanic bootmem macros to CONFIG_HAVE_ARCH_BOOTMEM_NODE
  2008-08-13  8:30   ` Jan Beulich
@ 2008-08-13  8:55     ` Ingo Molnar
  2008-08-13  9:07       ` Johannes Weiner
  0 siblings, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2008-08-13  8:55 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Johannes Weiner, Linus Torvalds, dhowells, linux-kernel


* Jan Beulich <jbeulich@novell.com> wrote:

> Sorry for not noticing this:
> Acked-by: Jan Beulich <jbeulich@novell.com>
> 
> >>> Johannes Weiner <hannes@saeurebad.de> 13.08.08 10:17 >>>
> Commit 74768ed833344b "page allocator: use no-panic variant of
> alloc_bootmem() in alloc_large_system_hash()" introduced two new
> _nopanic macros which are undefined for CONFIG_HAVE_ARCH_BOOTMEM_NODE.
> 
> Signed-off-by: Johannes Weiner <hannes@saeurebad.de>

btw., i dont think the fix is complete, a quick grep shows:

  arch/avr32/Kconfig:config HAVE_ARCH_BOOTMEM_NODE

	Ingo

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

* Re: [PATCH] Propagate new nonpanic bootmem macros to CONFIG_HAVE_ARCH_BOOTMEM_NODE
  2008-08-13  8:55     ` Ingo Molnar
@ 2008-08-13  9:07       ` Johannes Weiner
  2008-08-13  9:17         ` Ingo Molnar
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Weiner @ 2008-08-13  9:07 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Jan Beulich, Linus Torvalds, dhowells, linux-kernel

Hi Ingo,

Ingo Molnar <mingo@elte.hu> writes:

> * Jan Beulich <jbeulich@novell.com> wrote:
>
>> Sorry for not noticing this:
>> Acked-by: Jan Beulich <jbeulich@novell.com>
>> 
>> >>> Johannes Weiner <hannes@saeurebad.de> 13.08.08 10:17 >>>
>> Commit 74768ed833344b "page allocator: use no-panic variant of
>> alloc_bootmem() in alloc_large_system_hash()" introduced two new
>> _nopanic macros which are undefined for CONFIG_HAVE_ARCH_BOOTMEM_NODE.
>> 
>> Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
>
> btw., i dont think the fix is complete, a quick grep shows:
>
>   arch/avr32/Kconfig:config HAVE_ARCH_BOOTMEM_NODE

Uhm, I think a fix for that would be removing the knob from the avr32
Kconfig.  It defaults to n and I couldn't find a place where this gets
enabled.

Furthermore, there doesn't seem to be any arch-specific code associated
with it (grep -R ARCH_BOOTMEM_NODE arch/avr32).

	Hannes

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

* Re: [PATCH] Propagate new nonpanic bootmem macros to CONFIG_HAVE_ARCH_BOOTMEM_NODE
  2008-08-13  9:07       ` Johannes Weiner
@ 2008-08-13  9:17         ` Ingo Molnar
  0 siblings, 0 replies; 7+ messages in thread
From: Ingo Molnar @ 2008-08-13  9:17 UTC (permalink / raw)
  To: Johannes Weiner; +Cc: Jan Beulich, Linus Torvalds, dhowells, linux-kernel


* Johannes Weiner <hannes@saeurebad.de> wrote:

> Hi Ingo,
> 
> Ingo Molnar <mingo@elte.hu> writes:
> 
> > * Jan Beulich <jbeulich@novell.com> wrote:
> >
> >> Sorry for not noticing this:
> >> Acked-by: Jan Beulich <jbeulich@novell.com>
> >> 
> >> >>> Johannes Weiner <hannes@saeurebad.de> 13.08.08 10:17 >>>
> >> Commit 74768ed833344b "page allocator: use no-panic variant of
> >> alloc_bootmem() in alloc_large_system_hash()" introduced two new
> >> _nopanic macros which are undefined for CONFIG_HAVE_ARCH_BOOTMEM_NODE.
> >> 
> >> Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
> >
> > btw., i dont think the fix is complete, a quick grep shows:
> >
> >   arch/avr32/Kconfig:config HAVE_ARCH_BOOTMEM_NODE
> 
> Uhm, I think a fix for that would be removing the knob from the avr32 
> Kconfig.  It defaults to n and I couldn't find a place where this gets 
> enabled.
> 
> Furthermore, there doesn't seem to be any arch-specific code 
> associated with it (grep -R ARCH_BOOTMEM_NODE arch/avr32).

ok, indeed. I dont think it should be removed: it makes sense for an 
architecture to list all Kconfig knobs that _might_ matter - even if 
they are disabled for an architecture.

That makes it easier to know whether a Kconfig knob that is disables is 
disabled because the arch wants it disabled, because the arch wants it 
enabled, or because it's a knew knob the arch does not know about yet. 
So it's 3 states really.

	Ingo


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

end of thread, other threads:[~2008-08-13  9:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-04 13:35 [PATCH] use no-panic variant of alloc_bootmem() in alloc_large_system_hash() Jan Beulich
2008-08-13  8:17 ` [PATCH] Propagate new nonpanic bootmem macros to CONFIG_HAVE_ARCH_BOOTMEM_NODE Johannes Weiner
2008-08-13  8:30   ` Jan Beulich
2008-08-13  8:55     ` Ingo Molnar
2008-08-13  9:07       ` Johannes Weiner
2008-08-13  9:17         ` Ingo Molnar
2008-08-13  8:48   ` Ingo Molnar

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.