lkml.org 
[lkml]   [2013]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] HWPOISON: fix wrong num_poisoned_pages in handling memory error on thp
On Thu, 31 Jan 2013 10:25:58 -0500
Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> wrote:

> num_poisoned_pages counts up the number of pages isolated by memory errors.
> But for thp, only one subpage is isolated because memory error handler
> splits it, so it's wrong to add (1 << compound_trans_order).
>
> ...
>
> --- mmotm-2013-01-23-17-04.orig/mm/memory-failure.c
> +++ mmotm-2013-01-23-17-04/mm/memory-failure.c
> @@ -1039,7 +1039,14 @@ int memory_failure(unsigned long pfn, int trapno, int flags)
> return 0;
> }
>
> - nr_pages = 1 << compound_trans_order(hpage);
> + /*
> + * If a thp is hit by a memory failure, it's supposed to be split.
> + * So we should add only one to num_poisoned_pages for that case.
> + */
> + if (PageHuge(p))

/*
* PageHuge() only returns true for hugetlbfs pages, but not for normal or
* transparent huge pages. See the PageTransHuge() documentation for more
* details.
*/
int PageHuge(struct page *page)
{


> + nr_pages = 1 << compound_trans_order(hpage);
> + else /* normal page or thp */
> + nr_pages = 1;
> atomic_long_add(nr_pages, &num_poisoned_pages);
>
> /*



\
 
 \ /
  Last update: 2013-01-31 21:22    [W:0.094 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site