[PATCH] powerpc/mm: add ZONE_NORMAL zone for 64 bit kernel
Bhushan Bharat-R65777
R65777 at freescale.com
Tue Jul 24 18:01:24 EST 2012
> -----Original Message-----
> From: Linuxppc-dev [mailto:linuxppc-dev-
> bounces+bharat.bhushan=freescale.com at lists.ozlabs.org] On Behalf Of Benjamin
> Herrenschmidt
> Sent: Tuesday, July 24, 2012 10:16 AM
> To: Tabi Timur-B04825
> Cc: Wood Scott-B07421; Hu Mingkai-B21284; linuxppc-dev at lists.ozlabs.org; Xie
> Shaohui-B21989; Chen Yuanquan-B41889
> Subject: Re: [PATCH] powerpc/mm: add ZONE_NORMAL zone for 64 bit kernel
>
> On Tue, 2012-07-24 at 04:04 +0000, Tabi Timur-B04825 wrote:
> > Benjamin Herrenschmidt wrote:
> > > Sure but I don't want to create the zones in the first place (and
> > > thus introduce the added pressure on the memory management) on
> > > machines that don't need it.
> >
> > One thing that does confuse me -- by default, we don't create a
> > ZONE_NORMAL. We only create a ZONE_DMA. Why is that? Shouldn't it
> > be the other way around?
>
> Because ZONE_NORMAL allocations can be serviced from the ZONE_DMA while the
> other way isn't possible.
Say, if we have defined only one zone (ZONE_DMA) to which we give all memory ( > 4G).
Device set the DMA_MASK to 4G or less.
dma_alloc_coherent() will set GFP_DMA flag, But that is of no use, because the memory allocator have only one zone which have all memory (which assumes all dma-able). And can return memory at address at > 4G. which will crash !!
I think we have to have at least one zone which gives memory to be dma-able for all devices (memory limit should be set by platform, because different platform have different devices with different limits.). And another ( 1 or more) will cover rest of memory.
Thanks
-Bharat
>
> Especially in the old days, there were quite a few cases of drivers and/or
> subsystems who were a bit heavy handed at using ZONE_DMA, so not having one
> would essentially make them not work at all.
>
> Cheers,
> Ben.
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
More information about the Linuxppc-dev
mailing list