linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fengguang Wu <fengguang.wu@intel.com>
To: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Andi Kleen <andi.kleen@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Tony Luck <tony.luck@intel.com>, Rik van Riel <riel@redhat.com>,
	"Jun'ichi Nomura" <j-nomura@ce.jp.nec.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] HWPOISON: fix action_result() to print out dirty/clean
Date: Thu, 23 Aug 2012 17:33:30 +0800	[thread overview]
Message-ID: <20120823093330.GC12745@localhost> (raw)
In-Reply-To: <1345648655-4497-2-git-send-email-n-horiguchi@ah.jp.nec.com>

On Wed, Aug 22, 2012 at 11:17:33AM -0400, Naoya Horiguchi wrote:
> action_result() fails to print out "dirty" even if an error occurred on a
> dirty pagecache, because when we check PageDirty in action_result() it was
> cleared after page isolation even if it's dirty before error handling. This
> can break some applications that monitor this message, so should be fixed.
> 
> There are several callers of action_result() except page_action(), but
> either of them are not for LRU pages but for free pages or kernel pages,
> so we don't have to consider dirty or not for them.
> 
> Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> Reviewed-by: Andi Kleen <ak@linux.intel.com>
> ---
>  mm/memory-failure.c | 22 +++++++++-------------
>  1 file changed, 9 insertions(+), 13 deletions(-)
> 
> diff --git v3.6-rc1.orig/mm/memory-failure.c v3.6-rc1/mm/memory-failure.c
> index a6e2141..79dfb2f 100644
> --- v3.6-rc1.orig/mm/memory-failure.c
> +++ v3.6-rc1/mm/memory-failure.c
> @@ -779,16 +779,16 @@ static struct page_state {
>  	{ compound,	compound,	"huge",		me_huge_page },
>  #endif
>  
> -	{ sc|dirty,	sc|dirty,	"swapcache",	me_swapcache_dirty },
> -	{ sc|dirty,	sc,		"swapcache",	me_swapcache_clean },
> +	{ sc|dirty,	sc|dirty,	"dirty swapcache",	me_swapcache_dirty },
> +	{ sc|dirty,	sc,		"clean swapcache",	me_swapcache_clean },
>  
> -	{ unevict|dirty, unevict|dirty,	"unevictable LRU", me_pagecache_dirty},
> -	{ unevict,	unevict,	"unevictable LRU", me_pagecache_clean},
> +	{ unevict|dirty, unevict|dirty,	"dirty unevictable LRU", me_pagecache_dirty },
> +	{ unevict,	unevict,	"clean unevictable LRU", me_pagecache_clean },
>  
> -	{ mlock|dirty,	mlock|dirty,	"mlocked LRU",	me_pagecache_dirty },
> -	{ mlock,	mlock,		"mlocked LRU",	me_pagecache_clean },
> +	{ mlock|dirty,	mlock|dirty,	"dirty mlocked LRU",	me_pagecache_dirty },
> +	{ mlock,	mlock,		"clean mlocked LRU",	me_pagecache_clean },
>  
> -	{ lru|dirty,	lru|dirty,	"LRU",		me_pagecache_dirty },
> +	{ lru|dirty,	lru|dirty,	"dirty LRU",	me_pagecache_dirty },
>  	{ lru|dirty,	lru,		"clean LRU",	me_pagecache_clean },

According to the set_page_dirty() comment, the dirty bit might be set
outside the page lock (however I don't know any concrete examples).
That means the word "clean" is not 100% right.  That's probably why we
only report "dirty LRU" and didn't say "clean LRU".

Thanks,
Fengguang

>  	/*
> @@ -812,12 +812,8 @@ static struct page_state {
>  
>  static void action_result(unsigned long pfn, char *msg, int result)
>  {
> -	struct page *page = pfn_to_page(pfn);
> -
> -	printk(KERN_ERR "MCE %#lx: %s%s page recovery: %s\n",
> -		pfn,
> -		PageDirty(page) ? "dirty " : "",
> -		msg, action_name[result]);
> +	pr_err("MCE %#lx: %s page recovery: %s\n",
> +		pfn, msg, action_name[result]);
>  }
>  
>  static int page_action(struct page_state *ps, struct page *p,
> -- 
> 1.7.11.4

  reply	other threads:[~2012-08-23  9:33 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-22 15:17 [PATCH 0/3 v2] HWPOISON: improve dirty pagecache error reporting Naoya Horiguchi
2012-08-22 15:17 ` [PATCH 1/3] HWPOISON: fix action_result() to print out dirty/clean Naoya Horiguchi
2012-08-23  9:33   ` Fengguang Wu [this message]
2012-08-23 20:31     ` Naoya Horiguchi
2012-08-22 15:17 ` [PATCH 2/3] HWPOISON: report sticky EIO for poisoned file Naoya Horiguchi
2012-08-23  9:22   ` Fengguang Wu
2012-08-23 20:31     ` Naoya Horiguchi
2012-08-22 15:17 ` [PATCH 3/3] HWPOISON: prevent inode cache removal to keep AS_HWPOISON sticky Naoya Horiguchi
2012-08-23  9:11   ` Fengguang Wu
2012-08-23 20:31     ` Naoya Horiguchi
2012-08-24 21:52       ` Naoya Horiguchi
2012-08-24  1:31   ` Dave Chinner
2012-08-24  2:39     ` Naoya Horiguchi
2012-08-24  4:39       ` Dave Chinner
2012-08-24 17:24         ` Naoya Horiguchi
2012-08-26 22:26           ` Dave Chinner
2012-08-27 22:05             ` Naoya Horiguchi
2012-08-29  2:59               ` Dave Chinner
2012-08-29  5:32                 ` Jun'ichi Nomura
2012-09-03  0:39                   ` Dave Chinner
2012-08-22 20:22 ` [PATCH 0/3 v2] HWPOISON: improve dirty pagecache error reporting Andi Kleen
2012-08-22 21:14   ` Naoya Horiguchi
  -- strict thread matches above, loose matches on Subject: below --
2012-08-10 21:41 [PATCH 0/3 v1] HWPOISON: improve dirty pagecache error handling Naoya Horiguchi
2012-08-10 21:41 ` [PATCH 1/3] HWPOISON: fix action_result() to print out dirty/clean Naoya Horiguchi
2012-08-10 23:08   ` Andi Kleen

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=20120823093330.GC12745@localhost \
    --to=fengguang.wu@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi.kleen@intel.com \
    --cc=j-nomura@ce.jp.nec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=riel@redhat.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).