linux-mips
[Top] [All Lists]

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

To: "Ralf Baechle" <ralf@linux-mips.org>
Subject: Re: is remap_pfn_range should align to 2(n) * (page size) ?
From: zhuzhenhua <zzh.hust@gmail.com>
Date: Wed, 14 May 2008 09:19:10 +0800
Cc: linux-mips <linux-mips@linux-mips.org>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=3cgZK5KxHHqy95NxMzOKg/woigjMu24mY1zUrbRjuT8=; b=kANWUiKJA/WAhjEQZGdgPiqJaqch7ja0K2kQI70WmFC0E252gT2jx7Io/ZRawCCqGpRovTMai5wTCwE9lE1X1AZxW5M19dGfWm4WkMscUxTeIWyNd4ZIldmoYpDZrNyjWDu55q20Wx9J8h44ZzpOX/WbemgdRasEXOpkFkw/GOM=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=P5wzS/Ra2bmwi11uKvyIx2xv/Pnto5QEfF3brf7FXKAG4GLHE9fQz7sbTKlYblfc1NqiniPmAWlFU///MXeBtM8StBfkorA0DvSnvtJxB4EnSloiqbzrbBIlEAi+m89xmX+dDkXGe4ASrzFZsLUp7xl7Gz68euQLT4O6oR6lqr8=
In-reply-to: <20080513172300.GA9788@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <50c9a2250805082354x1edc1ecar89dcc3378b3bbe75@mail.gmail.com> <20080509095605.GB14450@linux-mips.org> <50c9a2250805111918r16913139obfc2982220636b3@mail.gmail.com> <20080512112233.GA8843@linux-mips.org> <50c9a2250805130444u4218654bw66f6158ba10b2b92@mail.gmail.com> <20080513172300.GA9788@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org


On Wed, May 14, 2008 at 1:23 AM, Ralf Baechle <ralf@linux-mips.org> wrote:
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:
> http://www.kernel.org/pub/linux/kernel/people/npiggin/patches/lockless/2.6.16-rc5/broken-out/mm-split-highorder.patch
>
> 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?

 Ralf

Thanks for your reply.
Our board is for embedded system , It only have 32M sdram and we don't want to
 waste 1M sdram.  My sensor driver need about 2.5xM memory to capture a picture
 by DMA (our DMA controller do not support scatter/gather).

I also can use bootargs "mem=29M" to keep 3M sdram.  but it's not flexible as
passing a param to driver module(calling dma_alloc_coherent). maybe my situation
is not common for MIPS arch. so that's is no split_page in dma_alloc_coherent.
and now after patch,it seemes ok for me.

Best Regards

zzh


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