From: Timur Tabi <timur@freescale.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: Re: Calling free_pages on part of the memory returned by get_free_pages?
Date: Thu, 24 Apr 2008 14:32:03 -0500 [thread overview]
Message-ID: <4810E033.4090903@freescale.com> (raw)
In-Reply-To: <87r6cvxdd4.fsf@basil.nowhere.org>
Andi Kleen wrote:
> It is ok, as long as you don't use compound pages (__GFP_COMP) and call
> split_page() to fix up the reference counts.
Thanks. I've never even heard of compound pages, so that's not a problem. I'll
look up split_page().
> Also you do this to save memory right?
Yes, I expect to allocate a 5MB chunk of memory, which means I'll be wasting 3MB
of physically-contiguous memory on an embedded system.
> The large system hash code does it too
Ah, I see that in alloc_large_system_hash(). Thanks
> If it's reasonably common we should re-add alloc/get_pages_exact() helper to
> make this pattern clear and easier to use.
I'd be in favor of that! I was planning on doing something like that anyway.
--
Timur Tabi
Linux kernel developer at Freescale
next prev parent reply other threads:[~2008-04-24 19:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-21 21:12 Calling free_pages on part of the memory returned by get_free_pages? Timur Tabi
2008-04-24 19:27 ` Andi Kleen
2008-04-24 19:32 ` Timur Tabi [this message]
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=4810E033.4090903@freescale.com \
--to=timur@freescale.com \
--cc=andi@firstfloor.org \
--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