From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Mundt Date: Mon, 18 Sep 2006 23:25:09 +0000 Subject: Re: [PATCH 2/6] Introduce CONFIG_ZONE_DMA Message-Id: <20060918232509.GA8032@localhost.usen.ad.jp> List-Id: References: <20060918183614.19679.50359.sendpatchset@schroedinger.engr.sgi.com> <20060918183655.19679.51633.sendpatchset@schroedinger.engr.sgi.com> <20060911222729.4849.69497.sendpatchset@schroedinger.engr.sgi.com> <20060911222739.4849.79915.sendpatchset@schroedinger.engr.sgi.com> <20060918135559.GB15096@infradead.org> <20060918152243.GA4320@localhost.na.rta> <20060918224548.GA6284@localhost.usen.ad.jp> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Christoph Lameter Cc: Christoph Hellwig , linux-mm@kvack.org, Nick Piggin , linux-ia64@vger.kernel.org, Marcelo Tosatti , Arjan van de Ven , Martin Bligh , KAMEZAWA Hiroyuki , Andi Kleen , linux-arch@vger.kernel.org, James Bottomley , Russell King On Mon, Sep 18, 2006 at 03:58:52PM -0700, Christoph Lameter wrote: > On Tue, 19 Sep 2006, Paul Mundt wrote: > > You've missed the other ZONE_DMA references, if you scroll a bit further > > down that's where we fill in ZONE_DMA, this is simply the default zone > > layout that we rely on for nommu. > > Are you sure that sh does not need ZONE_DMA? There is code in there > to check for the DMA boundary. The following patch disables that > code if CONFIG_ZONE_DMA is not set. > Yes, MAX_DMA_ADDRESS (in include/asm-sh/dma.h) is from when we needed it for alloc_bootmem(), we have no interest in it, but we can't kill off the definition either since some drivers seem to rely on it.. It was also left around in case some CPU variants with an arbitrary limitation in their respective DMACs popped up. All lowmem fits < MAX_DMA_ADDRESS and so gets stuffed in ZONE_DMA, as per: if (low < max_dma) { zones_size[ZONE_DMA] = low - start_pfn; zones_size[ZONE_NORMAL] = 0; So we may as well just do away with it entirely, via something like this: Signed-off-by: Paul Mundt diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index 8ea27ca..40494f9 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c @@ -156,7 +156,6 @@ void __init paging_init(void) * Setup some defaults for the zone sizes.. these should be safe * regardless of distcontiguous memory or MMU settings. */ - zones_size[ZONE_DMA] = 0 >> PAGE_SHIFT; zones_size[ZONE_NORMAL] = __MEMORY_SIZE >> PAGE_SHIFT; #ifdef CONFIG_HIGHMEM zones_size[ZONE_HIGHMEM] = 0 >> PAGE_SHIFT; @@ -168,7 +167,7 @@ #ifdef CONFIG_MMU * the zone sizes accordingly, in addition to turning it on. */ { - unsigned long max_dma, low, start_pfn; + unsigned long low, start_pfn; pgd_t *pg_dir; int i; @@ -183,16 +182,10 @@ #ifdef CONFIG_MMU /* Fixup the zone sizes */ start_pfn = START_PFN; - max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; low = MAX_LOW_PFN; - if (low < max_dma) { - zones_size[ZONE_DMA] = low - start_pfn; - zones_size[ZONE_NORMAL] = 0; - } else { - zones_size[ZONE_DMA] = max_dma - start_pfn; - zones_size[ZONE_NORMAL] = low - max_dma; - } + /* No DMA limitation, shove all of lowmem in ZONE_NORMAL. */ + zones_size[ZONE_NORMAL] = low - start_pfn; } #elif defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4)