From: Dave Hansen <dave@linux.vnet.ibm.com>
To: Badari Pulavarty <pbadari@us.ibm.com>
Cc: akpm@linux-foundation.org, Mel Gorman <mel@csn.ul.ie>,
"kamezawa.hiroyu" <kamezawa.hiroyu@jp.fujitsu.com>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Add sysfs removable attribute for hotplug memory remove
Date: Fri, 02 May 2008 10:27:21 -0700 [thread overview]
Message-ID: <1209749241.7763.44.camel@nimitz.home.sr71.net> (raw)
In-Reply-To: <1209747376.16169.27.camel@badari-desktop>
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
next prev parent reply other threads:[~2008-05-02 17:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-02 16:56 Badari Pulavarty
2008-05-02 17:27 ` Dave Hansen [this message]
2008-05-02 18:56 ` Greg KH
2008-06-26 23:28 Badari Pulavarty
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1209749241.7763.44.camel@nimitz.home.sr71.net \
--to=dave@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mel@csn.ul.ie \
--cc=pbadari@us.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®