public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Parav Pandit <paravpandit@yahoo.com>,
	Linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: virtually and physically (page) aligned allocation
Date: Wed, 25 Feb 2009 00:48:08 +0100	[thread overview]
Message-ID: <200902250048.09160.arnd@arndb.de> (raw)
In-Reply-To: <49A39489.3090202@zytor.com>

On Tuesday 24 February 2009, H. Peter Anvin wrote:
> Parav Pandit wrote:
> > In other way,
> > If user space application allocates memory which is aligned to page
> > boundary for say 4 pages using posix_memalign(), will is ensure that
> > it corresponds to exactly 4 physical pages in kernel which can be pinned down?  
> > 
> 
> You can use hugetlbfs to allocate a 2 MB page, otherwise no.

Well, posix_memalign should be able to give you alignment of up to page size
in real addresses (which I think is what Parav was asking for), but can not
guarantee larger than page size real alignment.

If an address is page aligned in user space, it is also guaranteed to be
page aligned in real storage. Alignment larger than page size can not be
forced or detected in user space except when using hugetlbfs.

	Arnd <><

      reply	other threads:[~2009-02-24 23:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-24  4:55 virtually and physically (page) aligned allocation Parav Pandit
2009-02-24  6:32 ` H. Peter Anvin
2009-02-24 23:48   ` Arnd Bergmann [this message]

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=200902250048.09160.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paravpandit@yahoo.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