[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181113001907.GD5945@hori1.linux.bs1.fc.nec.co.jp>
Date: Tue, 13 Nov 2018 00:19:08 +0000
From: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
To: Anshuman Khandual <anshuman.khandual@....com>
CC: "linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Michal Hocko <mhocko@...nel.org>,
"Andrew Morton" <akpm@...ux-foundation.org>,
Mike Kravetz <mike.kravetz@...cle.com>,
"xishi.qiuxishi@...baba-inc.com" <xishi.qiuxishi@...baba-inc.com>,
"Laurent Dufour" <ldufour@...ux.vnet.ibm.com>
Subject: Re: [RFC][PATCH v1 11/11] mm: hwpoison: introduce
clear_hwpoison_free_buddy_page()
On Fri, Nov 09, 2018 at 05:03:06PM +0530, Anshuman Khandual wrote:
>
>
> On 11/09/2018 12:17 PM, Naoya Horiguchi wrote:
> > The new function is a reverse operation of set_hwpoison_free_buddy_page()
> > to adjust unpoison_memory() to the new semantics.
> >
> > Signed-off-by: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
>
> snip
>
> > +
> > +/*
> > + * Reverse operation of set_hwpoison_free_buddy_page(), which is expected
> > + * to work only on error pages isolated from buddy allocator.
> > + */
> > +bool clear_hwpoison_free_buddy_page(struct page *page)
> > +{
> > + struct zone *zone = page_zone(page);
> > + bool unpoisoned = false;
> > +
> > + spin_lock(&zone->lock);
> > + if (TestClearPageHWPoison(page)) {
> > + unsigned long pfn = page_to_pfn(page);
> > + int migratetype = get_pfnblock_migratetype(page, pfn);
> > +
> > + __free_one_page(page, pfn, zone, 0, migratetype);
> > + unpoisoned = true;
> > + }
> > + spin_unlock(&zone->lock);
> > + return unpoisoned;
> > +}
> > #endif
> >
>
> Though there are multiple page state checks in unpoison_memory() leading
> upto clearing HWPoison flag, the page must not be in buddy already if
> __free_one_page() would be called on it.
Yes, you're right.
clear_hwpoison_free_buddy_page() is intended to cancel the isolation by
set_hwpoison_free_buddy_page() which removes the target page from buddy allocator,
so the page clear_hwpoison_free_buddy_page() tries to handle is not a buddy page
actually (not linked to any freelist).
Thanks,
Naoya Horiguchi
Powered by blists - more mailing lists