public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: david.hagood@gmail.com
To: linux-kernel@vger.kernel.org
Subject: Allocating memory aligned on 1M boundary?
Date: Wed, 25 Aug 2010 13:35:23 -0500	[thread overview]
Message-ID: <d58b966615c0a9978ec314ff1e5c53a7.squirrel@localhost> (raw)

Is there a way to allocate a block of memory that is
a) contiguous in physical layout
b) large (ca. 1M or so)
c) aligned on a large boundary (e.g. 1M boundary) in physical address

I have a hardware device (specifically, the PCIe controller of a Freescale
8641D PPC microprocessor) that requires a large amount of RAM to operate,
and requires that RAM to be aligned on the size of the element (that is,
if you use a 1M buffer, then the starting address of that RAM must be
0x???00000 so that the address translation unit can map from the PCIe
address to the local address).

Hugepages might work, but I see no guarantee that the alignment would be met.

Yes, I could allocate 2x the desired size, then use that part of what I
allocate that is correctly aligned, but then I am guaranteed to waste half
of what I allocate.

I'd rather NOT use the boottime allocation tricks if possible.

Scatter/Gather is not supported by the hardware, so that is out.

Any good suggestions?



             reply	other threads:[~2010-08-25 18:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-25 18:35 david.hagood [this message]
2010-08-25 19:34 ` Allocating memory aligned on 1M boundary? Timur Tabi

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=d58b966615c0a9978ec314ff1e5c53a7.squirrel@localhost \
    --to=david.hagood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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