All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>, Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [patch] bootmem: use MAX_DMA_ADDRESS instead of LOW32LIMIT
Date: Fri, 28 Jul 2006 21:41:04 +0200	[thread overview]
Message-ID: <20060728194104.GA11622@osiris.ibm.com> (raw)
In-Reply-To: <1154098725.3211.5.camel@localhost>

On Fri, Jul 28, 2006 at 04:58:45PM +0200, Martin Schwidefsky wrote:
> On Fri, 2006-07-28 at 15:13 +0200, Ingo Molnar wrote:
> > > -#define LOW32LIMIT 0xffffffff
> > 
> > >  		if ((ptr = __alloc_bootmem_core(bdata, size,
> > > -						 align, goal, LOW32LIMIT)))
> > > +						 align, goal, MAX_DMA_ADDRESS)))
> > 
> > but this limits things to 16MB on i686. Are you sure this wont break 
> > anything?
> 
> That is something we should not do. MAX_DMA_ADDRESS is not the correct
> value, it says something about the DMA limitations. LOW32LIMIT says
> something about the cpu addressing limitations which is a completly
> different thing. I think it would be best to introduce an architecture
> overridable define like LOW_ADDRESS_LIMIT. The default is 4GB-1, for
> s390 it is 2GB-1. The current name is misleading LOW32LIMIT indicates
> that the address for alloc_bootmem_low objects has 32 bits, which isn't
> true for s390.

Hm... how about this one then:

From: Heiko Carstens <heiko.carstens@de.ibm.com>

Introduce ARCH_LOW_ADDRESS_LIMIT which can be set per architecture to
override the 4GB default limit used by the bootmem allocater within
__alloc_bootmem_low() and __alloc_bootmem_low_node().
E.g. s390 needs a 2GB limit instead of 4GB.

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---

 include/asm-s390/processor.h |    2 ++
 mm/bootmem.c                 |   11 ++++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h
index 5b71d37..a21d2c5 100644
--- a/include/asm-s390/processor.h
+++ b/include/asm-s390/processor.h
@@ -337,6 +337,8 @@ struct notifier_block;
 int register_idle_notifier(struct notifier_block *nb);
 int unregister_idle_notifier(struct notifier_block *nb);
 
+#define ARCH_LOW_ADDRESS_LIMIT	0x7fffffffUL
+
 #endif
 
 #endif                                 /* __ASM_S390_PROCESSOR_H           */
diff --git a/mm/bootmem.c b/mm/bootmem.c
index 50353e0..bf99002 100644
--- a/mm/bootmem.c
+++ b/mm/bootmem.c
@@ -19,6 +19,7 @@
 #include <linux/module.h>
 #include <asm/dma.h>
 #include <asm/io.h>
+#include <asm/processor.h>
 #include "internal.h"
 
 /*
@@ -436,7 +437,9 @@ void * __init __alloc_bootmem_node(pg_da
 	return __alloc_bootmem(size, align, goal);
 }
 
-#define LOW32LIMIT 0xffffffff
+#ifndef ARCH_LOW_ADDRESS_LIMIT
+#define ARCH_LOW_ADDRESS_LIMIT	0xffffffffUL
+#endif
 
 void * __init __alloc_bootmem_low(unsigned long size, unsigned long align, unsigned long goal)
 {
@@ -445,7 +448,8 @@ void * __init __alloc_bootmem_low(unsign
 
 	list_for_each_entry(bdata, &bdata_list, list)
 		if ((ptr = __alloc_bootmem_core(bdata, size,
-						 align, goal, LOW32LIMIT)))
+						align, goal,
+						ARCH_LOW_ADDRESS_LIMIT)))
 			return(ptr);
 
 	/*
@@ -459,5 +463,6 @@ void * __init __alloc_bootmem_low(unsign
 void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, unsigned long size,
 				       unsigned long align, unsigned long goal)
 {
-	return __alloc_bootmem_core(pgdat->bdata, size, align, goal, LOW32LIMIT);
+	return __alloc_bootmem_core(pgdat->bdata, size, align, goal,
+				    ARCH_LOW_ADDRESS_LIMIT);
 }

  reply	other threads:[~2006-07-28 19:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-28 13:08 [patch] bootmem: use MAX_DMA_ADDRESS instead of LOW32LIMIT Heiko Carstens
2006-07-28 13:13 ` Ingo Molnar
2006-07-28 14:58   ` Martin Schwidefsky
2006-07-28 19:41     ` Heiko Carstens [this message]
2006-07-29  3:55       ` Ingo Molnar
2006-08-07  5:27         ` Randy.Dunlap

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=20060728194104.GA11622@osiris.ibm.com \
    --to=heiko.carstens@de.ibm.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=schwidefsky@de.ibm.com \
    /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 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.