Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: zhuzhenhua <zzh.hust@gmail.com>
Cc: linux-mips <linux-mips@linux-mips.org>
Subject: Re: is remap_pfn_range should align to 2(n) * (page size) ?
Date: Fri, 9 May 2008 10:56:05 +0100	[thread overview]
Message-ID: <20080509095605.GB14450@linux-mips.org> (raw)
In-Reply-To: <50c9a2250805082354x1edc1ecar89dcc3378b3bbe75@mail.gmail.com>

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

  reply	other threads:[~2008-05-09  9:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-09  6:54 is remap_pfn_range should align to 2(n) * (page size) ? zhuzhenhua
2008-05-09  9:56 ` Ralf Baechle [this message]
2008-05-12  2:18   ` zhuzhenhua
2008-05-12 11:22     ` Ralf Baechle
2008-05-13 11:44       ` zhuzhenhua
2008-05-13 17:23         ` Ralf Baechle
2008-05-14  1:19           ` zhuzhenhua
2008-05-14  7:33             ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080509095605.GB14450@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=linux-mips@linux-mips.org \
    --cc=zzh.hust@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox