Messages in this thread | | | Date | Thu, 24 Apr 2008 14:32:03 -0500 | From | Timur Tabi <> | Subject | Re: Calling free_pages on part of the memory returned by get_free_pages? |
| |
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
| |