[Top] [All Lists]

Re: is remap_pfn_range should align to 2(n) * (page size) ?

To: zhuzhenhua <>
Subject: Re: is remap_pfn_range should align to 2(n) * (page size) ?
From: Ralf Baechle <>
Date: Tue, 13 May 2008 18:23:01 +0100
Cc: linux-mips <>
In-reply-to: <>
Original-recipient: rfc822;
References: <> <> <> <> <>
User-agent: Mutt/1.5.17 (2007-11-01)
On Tue, May 13, 2008 at 07:44:06PM +0800, zhuzhenhua wrote:

> thanks for your advice, i found in newest kernel version, in some arch , the
> dma_alloc_coherent will call split_page.
> because my kernel version is 2.6.14, so i first patch a split_page patch as
> follow:
> but it seemes that there is still no split_page in
> dma_alloc_coherent/dma_alloc_noncoherent
> so i copy from other arch code to arch/mips/mm/dma-noncoherent.c (attach at
> the end of mail)
> and now my driver just use dma_alloc_coherent malloc 3M directly, and it
> seemes ok.
> i just wonder why mips arch dma_alloc_coherent/dma_alloc_nocoherent do not
> call split_page while other arch calling.

I have not identified the waste of memory as a big problem for typical
MIPS systems yet.

The 3MB requirement of your device is sort of odd because it's not a power
of two.  Have you considered splitting the allocation into a 2MB and a 1MB
allocation or would that be undersirable?


<Prev in Thread] Current Thread [Next in Thread>