lkml.org 
[lkml]   [2011]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/3] make new alloc_pages_exact()
From
Date
On Tue, 2011-04-12 at 12:28 +0200, Michal Nazarewicz wrote:
> > Dave Hansen <dave@linux.vnet.ibm.com> wrote:
> >> +void __free_pages_exact(struct page *page, size_t nr_pages)
> >> +{
> >> + struct page *end = page + nr_pages;
> >> +
> >> + while (page < end) {
> >> + __free_page(page);
> >> + page++;
> >> + }
> >> +}
> >> +EXPORT_SYMBOL(__free_pages_exact);
>
> On Tue, 12 Apr 2011 00:22:23 +0200, Andrew Morton wrote:
> > Really, this function duplicates release_pages().
>
> It requires an array of pointers to pages which is not great though if one
> just wants to free a contiguous sequence of pages.

Actually, the various mem_map[]s _are_ arrays, at least up to
MAX_ORDER_NR_PAGES at a time. We can use that property here.

-- Dave



\
 
 \ /
  Last update: 2011-04-12 17:07    [from the cache]
©2003-2011 Jasper Spaans