[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4CB45672.7020206@linux.intel.com>
Date: Tue, 12 Oct 2010 14:37:06 +0200
From: Andi Kleen <ak@...ux.intel.com>
To: Wu Fengguang <fengguang.wu@...el.com>
CC: Andi Kleen <andi@...stfloor.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] HWPOISON: Implement hwpoison-on-free for soft offlining
On 10/12/2010 2:26 PM, Wu Fengguang wrote:
>
>>
>> +#if defined(CONFIG_MEMORY_FAILURE)&& BITS_PER_LONG == 64
> We have the simpler CONFIG_HWPOISON_ON_FREE :)
>
Leftover from when I didn't have that. Fixed.
>> +PAGEFLAG(HWPoisonOnFree, hwpoison_on_free)
>> +TESTSCFLAG(HWPoisonOnFree, hwpoison_on_free)
>> +#define __PG_HWPOISON_ON_FREE (1UL<< PG_hwpoison_on_free)
>> +#else
>> +PAGEFLAG_FALSE(HWPoisonOnFree)
> Could define SETPAGEFLAG_NOOP(HWPoisonOnFree) too, for eliminating an
> #ifdef in the .c file.
Ok.
>
>> }
>> +
>> + if (PageHWPoisonOnFree(page)) {
>> + pr_info("soft_offline: %#lx: Delaying poision of unknown page %lx to free\n",
>> + pfn, page->flags);
>> + return -EIO; /* or 0? */
> -EIO looks safer because HWPoisonOnFree does not guarantee success.
>
Ok.
>
>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>> index a8cfa9c..519c24c 100644
>> --- a/mm/page_alloc.c
>> +++ b/mm/page_alloc.c
>> @@ -564,6 +564,8 @@ static inline int free_pages_check(struct page *page)
>> (page->mapping != NULL) |
>> (atomic_read(&page->_count) != 0) |
>> (page->flags& PAGE_FLAGS_CHECK_AT_FREE))) {
>> + if (PageHWPoisonOnFree(page))
>> + hwpoison_page_on_free(page);
> hwpoison_page_on_free() seems to be undefined when
> CONFIG_HWPOISON_ON_FREE is not defined.
Yes, but I rely on the compiler never generating the call in this case
because
the test is zero.
It would fail on a unoptimized build, but the kernel doesn't support
that anyways.
Thanks for the review.
-Andi
--
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