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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 5/9/08, Ralf Baechle <ralf@xxxxxxxxxxxxxx> 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



 


 



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux