[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1209749241.7763.44.camel@nimitz.home.sr71.net>
Date: Fri, 02 May 2008 10:27:21 -0700
From: Dave Hansen <dave@...ux.vnet.ibm.com>
To: Badari Pulavarty <pbadari@...ibm.com>
Cc: akpm@...ux-foundation.org, Mel Gorman <mel@....ul.ie>,
"kamezawa.hiroyu" <kamezawa.hiroyu@...fujitsu.com>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Add sysfs removable attribute for hotplug memory remove
On Fri, 2008-05-02 at 09:56 -0700, Badari Pulavarty wrote:
>
> +/* Return the start of the next active pageblock after a given page */
> +static struct page *next_active_pageblock(struct page *page)
> +{
> + /* Ensure the starting page is pageblock-aligned */
> + BUG_ON(page_to_pfn(page) & (pageblock_nr_pages - 1));
> +
> + /* Move forward by at least 1 * pageblock_nr_pages */
> + int pageblocks_stride = 1;
> +
> + /* If the entire pageblock is free, move to the end of free page */
> + if (pageblock_free(page))
> + pageblocks_stride += page_order(page) - pageblock_order;
> +
> + return page + (pageblocks_stride * pageblock_nr_pages);
> +}
Do you really want that variable declared in the middle of the function?
Otherwise looks fine to me. I'm a bit worried about the whole "scan
every page in the section" thing. That could get expensive if people
ever decided to poll this file. Maybe we should tell our potential
users about that.
-- Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists