linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Andi Kleen <andi@firstfloor.org>, Tony Luck <tony.luck@intel.com>,
	Wu Fengguang <fengguang.wu@intel.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] HWPOISON: fix wrong num_poisoned_pages in handling memory error on thp
Date: Thu, 31 Jan 2013 11:34:16 -0800	[thread overview]
Message-ID: <20130131113416.963b5f07.akpm@linux-foundation.org> (raw)
In-Reply-To: <1359645958-9127-1-git-send-email-n-horiguchi@ah.jp.nec.com>

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);
>  
>  	/*

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2013-01-31 19:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-31 15:25 [PATCH] HWPOISON: fix wrong num_poisoned_pages in handling memory error on thp Naoya Horiguchi
2013-01-31 19:34 ` Andrew Morton [this message]
2013-01-31 23:35   ` Naoya Horiguchi
2013-02-01 15:52     ` [PATCH v2] " Naoya Horiguchi

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=20130131113416.963b5f07.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=fengguang.wu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=tony.luck@intel.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;
as well as URLs for NNTP newsgroup(s).