linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Chen Yucong <slaoub@gmail.com>
To: n-horiguchi@ah.jp.nec.com
Cc: ak@linux.intel.com, fengguang.wu@intel.com, linux-mm@kvack.org,
	Chen Yucong <slaoub@gmail.com>
Subject: [PATCH] HWPOISON: Fix the handling path of the victimized page frame that belong to non-LUR
Date: Tue,  3 Jun 2014 15:29:42 +0800	[thread overview]
Message-ID: <1401780582-9477-1-git-send-email-slaoub@gmail.com> (raw)

Until now, the kernel has the same policy to handle victimized page frames that
belong to kernel-space(reserved/slab-subsystem) or non-LRU(unknown page state).
In other word, the result of handling either of these victimized page frames is
(IGNORED | FAILED), and the return value of memory_failure() is -EBUSY.

This patch is to avoid that memory_failure() returns very soon due to the "true"
value of (!PageLRU(p)), and it also ensures that action_result() can report more
precise information("reserved kernel",  "kernel slab", and "unknown page state")
instead of "non LRU", especially for memory errors which are detected by memory-scrubbing.

Signed-off-by: Chen Yucong <slaoub@gmail.com>
---
 mm/memory-failure.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index e3154d9..39daadc 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -862,7 +862,7 @@ static int hwpoison_user_mappings(struct page *p, unsigned long pfn,
 	struct page *hpage = *hpagep;
 	struct page *ppage;
 
-	if (PageReserved(p) || PageSlab(p))
+	if (PageReserved(p) || PageSlab(p) || !PageLRU(p))
 		return SWAP_SUCCESS;
 
 	/*
@@ -1126,9 +1126,6 @@ int memory_failure(unsigned long pfn, int trapno, int flags)
 					action_result(pfn, "free buddy, 2nd try", DELAYED);
 				return 0;
 			}
-			action_result(pfn, "non LRU", IGNORED);
-			put_page(p);
-			return -EBUSY;
 		}
 	}
 
-- 
1.7.10.4

--
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-06-03  7:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-03  7:29 Chen Yucong [this message]
2014-06-03 21:27 ` 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=1401780582-9477-1-git-send-email-slaoub@gmail.com \
    --to=slaoub@gmail.com \
    --cc=ak@linux.intel.com \
    --cc=fengguang.wu@intel.com \
    --cc=linux-mm@kvack.org \
    --cc=n-horiguchi@ah.jp.nec.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