public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Timur Tabi <timur@freescale.com>
To: lkml <linux-kernel@vger.kernel.org>
Subject: Calling free_pages on part of the memory returned by get_free_pages?
Date: Mon, 21 Apr 2008 16:12:14 -0500	[thread overview]
Message-ID: <480D032E.20204@freescale.com> (raw)

According to LDD3, if I call get_free_pages() to allocate X bytes, I have to
free all of those pages with free_pages().  The VM internals are a little bit
over my head, but I looked at the code and I didn't see why that is a requirement.

For example, let's say I want to allocated 6MB of physically-contiguous memory.
 If I call x = get_free_pages(11) to get 8MB.  What happens if I then do
"free_pages(x + 6 * 1024 * 1024, 9)"?

I remember doing this on the 2.4 kernel, and it never gave me any problems.

-- 
Timur Tabi
Linux kernel developer at Freescale

             reply	other threads:[~2008-04-21 21:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-21 21:12 Timur Tabi [this message]
2008-04-24 19:27 ` Calling free_pages on part of the memory returned by get_free_pages? Andi Kleen
2008-04-24 19:32   ` Timur Tabi
2008-05-09 22:33   ` 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=480D032E.20204@freescale.com \
    --to=timur@freescale.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