lkml.org 
[lkml]   [2011]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/2] make new alloc_pages_exact()
From
Date
On Fri, 2011-04-08 at 14:28 +0200, Michal Nazarewicz wrote:
> On Thu, 07 Apr 2011 19:21:05 +0200, Dave Hansen <dave@linux.vnet.ibm.com>
> > + struct page *alloc_end = page + (1 << order);
> > + struct page *used = page + PAGE_ALIGN(size)/PAGE_SIZE;
> > - split_page(virt_to_page((void *)addr), order);
> > + split_page(page, order);
> > while (used < alloc_end) {
> > - free_page(used);
> > - used += PAGE_SIZE;
> > + __free_page(used);
> > + used++;
> > }
>
> Have you thought about moving this loop to a separate function, ie.
> _free_page_range(start, end)? I'm asking because this loop appears
> in two places and my CMA would also benefit from such a function.

It's actually perilously close to free_pages_exact(). I'll try to make
it usable for this case as well.

-- Dave



\
 
 \ /
  Last update: 2011-04-09 00:09    [from the cache]
©2003-2011 Jasper Spaans