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: Mon, 12 May 2008 10:18:27 +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=7jQlHvHMFGW91el3y6cFu4sVsXexSrXt5C4jqAgQU+E=; b=KsTrIS4LEzhHrbszitWgeBJmPSEwTErDhPLdy2zsZINoYrl+wUfTHJgGOvliuh7Q8TBLclkze1gAfKa0+NyTOvom3NyaDA5VhapWIUj8Dg5IQjB+HPrrDdMS795ttEtDFpmRvmdkwQ0xyu98UZCbOIYKG+qSWJGhQgiH8YkUn4k=
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=UYmElo1XX9MN4dwLKiQQW5LG9/K5IDLEEGvL6L7iWwNefu46Dy/htsjP3wn/r1lUWfmWjf2KKRoBe8UnuYztiWX/SIjCOw0+VDnDFVbqvbHnMsTrcNGTpwDQUzm/pSfLU7UpwWGJC7fIY4Ddd2h/1EWSHhpVTXaHqYZ5W2qU6qM=
In-reply-to: <20080509095605.GB14450@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <50c9a2250805082354x1edc1ecar89dcc3378b3bbe75@mail.gmail.com> <20080509095605.GB14450@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org


On 5/9/08, Ralf Baechle <ralf@linux-mips.org> wrote:
On Fri, May 09, 2008 at 02:54:29PM +0800, zhuzhenhua wrote:

>            i have a sensor driver want to malloc 2.xM SDRAM to capture
> data(using DMA),  so i used  remap_pfn_range to malloc 3M.
> But in /proc/meminfo, it showes free memory reduce 4M. i also check the
> /proc/buddyinfo, it seemes too.
> (i am looking inside kernel code, but not get clear at now).
>
>  is remap_pfn_range should align to  2(n) * (page size) ?


This has nothing to do with remap_pfn_range but with the power of two
sized buckets used by the global free page pool.  Any allocation with
get_free_pages will be rounded up to the next power of two.  If that's a
real concern for you you could allocate a 4MB page then split the page
into a 2MB and two 1MB pages and free the 1MB page again.


  Ralf

thanks for your reply , i see in get_frree_pages and free_pages there is a get_order(size).
but i don't understand  " allocate a 4MB page then split the page
into a 2MB and two 1MB pages and free the 1MB page again."
is there any function to split it?

thanks for any hints

Best Regards


zzh



 


 


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