[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100906091633.GA23089@tiehlicka.suse.cz>
Date: Mon, 6 Sep 2010 11:16:33 +0200
From: Michal Hocko <mhocko@...e.cz>
To: Wu Fengguang <fengguang.wu@...el.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
Hiroyuki Kamezawa <kamezawa.hiroyuki@...il.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
Andrew Morton <akpm@...ux-foundation.org>,
"Kleen, Andi" <andi.kleen@...el.com>,
Haicheng Li <haicheng.li@...ux.intel.com>,
Christoph Lameter <cl@...ux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Mel Gorman <mel@...ux.vnet.ibm.com>
Subject: Re: [PATCH 2/2] Make is_mem_section_removable more conformable
with offlining code v3
On Sat 04-09-10 10:55:16, Wu Fengguang wrote:
> On Fri, Sep 03, 2010 at 07:42:13PM +0800, Michal Hocko wrote:
>
> > +/*
> > + * A free or LRU pages block are removable
> > + * Do not use MIGRATE_MOVABLE because it can be insufficient and
> > + * other MIGRATE types are tricky.
> > + * Do not hold zone->lock as this is used from user space by the
> > + * sysfs interface.
> > + */
> > +bool is_page_removable(struct page *page)
> > +{
> > + int page_block = 1 << pageblock_order;
> > +
> > + /* All pages from the MOVABLE zone are movable */
> > + if (zone_idx(page_zone(page)) == ZONE_MOVABLE)
> > + return true;
> > +
> > + while (page_block > 0) {
> > + int order = 0;
> > +
> > + if (pfn_valid_within(page_to_pfn(page))) {
> > + if (!page_count(page) && PageBuddy(page)) {
>
> PageBuddy() is true only for the head page and false for all tail
> pages. So when is_page_removable() is given a random 4k page
> (get_any_page() will exactly do that), the above test is not enough.
OK, I haven't noticed that set_migratetype_isolate (which calls
is_page_removable in my patch - bellow) is called from that context.
is_mem_section_removable goes by pageblocks so we are always checking
the head.
Anyway, I can see why you are counting unmovable pages in your patch
now. You need it for notifier logic, so my approach is not usable.
Thanks!
--
Michal Hocko
L3 team
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9
Czech Republic
--
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