linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: don't use ZONE_DMA unless CONFIG_ZONE_DMA is set in setup.c
@ 2007-03-06 23:52 Andres Salomon
  2007-03-07  1:52 ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: Andres Salomon @ 2007-03-06 23:52 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm, linux-kernel

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

If CONFIG_ZONE_DMA is ever undefined, ZONE_DMA will also not be defined,
and setup.c won't compile.  This wraps it with an #ifdef.

Signed-off-by: Andres Salomon <dilinger@debian.org>

[-- Attachment #2: zones.patch --]
[-- Type: text/x-patch, Size: 539 bytes --]

diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 0b476e1..b69626e 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -371,8 +371,10 @@ void __init zone_sizes_init(void)
 {
 	unsigned long max_zone_pfns[MAX_NR_ZONES];
 	memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
+#ifdef CONFIG_ZONE_DMA
 	max_zone_pfns[ZONE_DMA] =
 		virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
+#endif
 	max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
 #ifdef CONFIG_HIGHMEM
 	max_zone_pfns[ZONE_HIGHMEM] = highend_pfn;

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

* Re: [PATCH] mm: don't use ZONE_DMA unless CONFIG_ZONE_DMA is set in setup.c
  2007-03-06 23:52 [PATCH] mm: don't use ZONE_DMA unless CONFIG_ZONE_DMA is set in setup.c Andres Salomon
@ 2007-03-07  1:52 ` Andrew Morton
  2007-03-07  4:02   ` Dave Jones
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2007-03-07  1:52 UTC (permalink / raw)
  To: Andres Salomon; +Cc: linux-mm, linux-kernel

On Tue, 06 Mar 2007 18:52:59 -0500
Andres Salomon <dilinger@debian.org> wrote:

> If CONFIG_ZONE_DMA is ever undefined, ZONE_DMA will also not be defined,
> and setup.c won't compile.  This wraps it with an #ifdef.
> 

I guess if anyone tries to disable ZONE_DMA on i386 they'll pretty quickly
discover that.  But I don't think we need to "fix" it yet?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mm: don't use ZONE_DMA unless CONFIG_ZONE_DMA is set in setup.c
  2007-03-07  1:52 ` Andrew Morton
@ 2007-03-07  4:02   ` Dave Jones
  2007-03-07  4:42     ` Andres Salomon
  0 siblings, 1 reply; 6+ messages in thread
From: Dave Jones @ 2007-03-07  4:02 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Andres Salomon, linux-mm, linux-kernel

On Tue, Mar 06, 2007 at 05:52:46PM -0800, Andrew Morton wrote:
 > On Tue, 06 Mar 2007 18:52:59 -0500
 > Andres Salomon <dilinger@debian.org> wrote:
 > 
 > > If CONFIG_ZONE_DMA is ever undefined, ZONE_DMA will also not be defined,
 > > and setup.c won't compile.  This wraps it with an #ifdef.
 > > 
 > 
 > I guess if anyone tries to disable ZONE_DMA on i386 they'll pretty quickly
 > discover that.  But I don't think we need to "fix" it yet?

CONFIG_ZONE_DMA isn't even optional on i386, so I'm curious how
you could hit this compile failure.

	Dave

-- 
http://www.codemonkey.org.uk

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mm: don't use ZONE_DMA unless CONFIG_ZONE_DMA is set in setup.c
  2007-03-07  4:02   ` Dave Jones
@ 2007-03-07  4:42     ` Andres Salomon
  2007-03-07 20:25       ` Christoph Lameter
  0 siblings, 1 reply; 6+ messages in thread
From: Andres Salomon @ 2007-03-07  4:42 UTC (permalink / raw)
  To: Dave Jones, Andrew Morton, Andres Salomon, linux-mm, linux-kernel

Dave Jones wrote:
> On Tue, Mar 06, 2007 at 05:52:46PM -0800, Andrew Morton wrote:
>  > On Tue, 06 Mar 2007 18:52:59 -0500
>  > Andres Salomon <dilinger@debian.org> wrote:
>  > 
>  > > If CONFIG_ZONE_DMA is ever undefined, ZONE_DMA will also not be defined,
>  > > and setup.c won't compile.  This wraps it with an #ifdef.
>  > > 
>  > 
>  > I guess if anyone tries to disable ZONE_DMA on i386 they'll pretty quickly
>  > discover that.  But I don't think we need to "fix" it yet?

Oh, it's certainly not urgent.  I sent it simply for correctness reasons.

It would've been nice to see the ZONE_DMA removal patches just #define
ZONE_DMA regardless, and include less #ifdefs scattered about; but at
this point, I'd just as soon prefer to see a proper way to allocate
things based on address constraints (as discussed in
http://www.gelato.unsw.edu.au/archives/linux-ia64/0609/19036.html).


> 
> CONFIG_ZONE_DMA isn't even optional on i386, so I'm curious how
> you could hit this compile failure.
> 

Why, with custom code of course ;)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mm: don't use ZONE_DMA unless CONFIG_ZONE_DMA is set in setup.c
  2007-03-07  4:42     ` Andres Salomon
@ 2007-03-07 20:25       ` Christoph Lameter
  2007-03-07 20:38         ` Andres Salomon
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Lameter @ 2007-03-07 20:25 UTC (permalink / raw)
  To: Andres Salomon; +Cc: Dave Jones, Andrew Morton, linux-mm, linux-kernel

On Tue, 6 Mar 2007, Andres Salomon wrote:

> It would've been nice to see the ZONE_DMA removal patches just #define
> ZONE_DMA regardless, and include less #ifdefs scattered about; but at
> this point, I'd just as soon prefer to see a proper way to allocate
> things based on address constraints (as discussed in
> http://www.gelato.unsw.edu.au/archives/linux-ia64/0609/19036.html).

Would you be willing to work on that? I can sent you a bunch of unfinished 
patches if you have the time.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mm: don't use ZONE_DMA unless CONFIG_ZONE_DMA is set in setup.c
  2007-03-07 20:25       ` Christoph Lameter
@ 2007-03-07 20:38         ` Andres Salomon
  0 siblings, 0 replies; 6+ messages in thread
From: Andres Salomon @ 2007-03-07 20:38 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: Dave Jones, Andrew Morton, linux-mm, linux-kernel

Christoph Lameter wrote:
> On Tue, 6 Mar 2007, Andres Salomon wrote:
> 
>> It would've been nice to see the ZONE_DMA removal patches just #define
>> ZONE_DMA regardless, and include less #ifdefs scattered about; but at
>> this point, I'd just as soon prefer to see a proper way to allocate
>> things based on address constraints (as discussed in
>> http://www.gelato.unsw.edu.au/archives/linux-ia64/0609/19036.html).
> 
> Would you be willing to work on that? I can sent you a bunch of unfinished 
> patches if you have the time.

Sure, I'd be willing to work on it.  Whether or not I have the time is
questionable, but it wouldn't hurt to send them..

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2007-03-07 20:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-06 23:52 [PATCH] mm: don't use ZONE_DMA unless CONFIG_ZONE_DMA is set in setup.c Andres Salomon
2007-03-07  1:52 ` Andrew Morton
2007-03-07  4:02   ` Dave Jones
2007-03-07  4:42     ` Andres Salomon
2007-03-07 20:25       ` Christoph Lameter
2007-03-07 20:38         ` Andres Salomon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox