lkml.org 
[lkml]   [2011]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    SubjectRe: [PATCH 3/3] reuse __free_pages_exact() in __alloc_pages_exact()
    Date
    From
    On Tue, 12 Apr 2011 00:03:48 +0200, Dave Hansen <dave@linux.vnet.ibm.com>  
    wrote:
    > diff -puN mm/page_alloc.c~reuse-free-exact mm/page_alloc.c
    > --- linux-2.6.git/mm/page_alloc.c~reuse-free-exact 2011-04-11
    > 15:01:17.701822598 -0700
    > +++ linux-2.6.git-dave/mm/page_alloc.c 2011-04-11 15:01:17.713822594
    > -0700
    > @@ -2338,14 +2338,11 @@ struct page *__alloc_pages_exact(gfp_t g
    > page = alloc_pages(gfp_mask, order);
    > if (page) {
    > - struct page *alloc_end = page + (1 << order);
    > - struct page *used = page + nr_pages;
    > + struct page *unused_start = page + nr_pages;
    > + int nr_unused = (1 << order) - nr_pages;

    How about unsigned long?

    > split_page(page, order);
    > - while (used < alloc_end) {
    > - __free_page(used);
    > - used++;
    > - }
    > + __free_pages_exact(unused_start, nr_unused);
    > }
    > return page;

    --
    Best regards, _ _
    .o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o
    ..o | Computer Science, Michal "mina86" Nazarewicz (o o)
    ooo +-----<email/xmpp: mnazarewicz@google.com>-----ooO--(_)--Ooo--


    \
     
     \ /
      Last update: 2011-04-12 12:33    [W:8.506 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site