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: linux-kernel@vger.kernel.org, Andi Kleen <andi@firstfloor.org>,
	Wanpeng Li <liwanp@linux.vnet.ibm.com>,
	gong.chen@linux.intel.com, linux-mm@kvack.org,
	Naoya Horiguchi <nao.horiguchi@gmail.com>
Subject: Re: [PATCH] mm/memory-failure.c: move refcount only in !MF_COUNT_INCREASED
Date: Fri, 7 Feb 2014 13:43:29 -0800	[thread overview]
Message-ID: <20140207134329.a305b169351a2538ab03785f@linux-foundation.org> (raw)
In-Reply-To: <52f54d29.89cfe00a.4277.4d3dSMTPIN_ADDED_BROKEN@mx.google.com>

On Fri, 07 Feb 2014 16:16:04 -0500 Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> wrote:

> # Resending due to sending failure. Sorry if you received twice.
> ---
> mce-test detected a test failure when injecting error to a thp tail page.
> This is because we take page refcount of the tail page in madvise_hwpoison()
> while the fix in commit a3e0f9e47d5e ("mm/memory-failure.c: transfer page
> count from head page to tail page after split thp") assumes that we always
> take refcount on the head page.
> 
> When a real memory error happens we take refcount on the head page where
> memory_failure() is called without MF_COUNT_INCREASED set, so it seems to me
> that testing memory error on thp tail page using madvise makes little sense.
> 
> This patch cancels moving refcount in !MF_COUNT_INCREASED for valid testing.
> 
> ...
>
> --- v3.14-rc1.orig/mm/memory-failure.c
> +++ v3.14-rc1/mm/memory-failure.c
> @@ -1042,8 +1042,10 @@ static int hwpoison_user_mappings(struct page *p, unsigned long pfn,
>  			 * to it. Similarly, page lock is shifted.
>  			 */
>  			if (hpage != p) {
> -				put_page(hpage);
> -				get_page(p);
> +				if (!(flags && MF_COUNT_INCREASED)) {

s/&&/&/

Please carefully retest this, make sure that both cases are covered?

> +					put_page(hpage);
> +					get_page(p);
> +				}
>  				lock_page(p);
>  				unlock_page(hpage);
>  				*hpagep = p;


--
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:[~2014-02-07 21:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <52f54d29.89cfe00a.4277.4d3dSMTPIN_ADDED_BROKEN@mx.google.com>
2014-02-07 21:43 ` Andrew Morton [this message]
2014-02-07 22:00   ` Naoya Horiguchi
2014-02-07 21:16 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=20140207134329.a305b169351a2538ab03785f@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=gong.chen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=liwanp@linux.vnet.ibm.com \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=nao.horiguchi@gmail.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