From: Jin Dongming <jin.dongming@np.css.fujitsu.com>
To: Andi Kleen <andi@firstfloor.org>, Andrea Arcangeli <aarcange@redhat.com>
Cc: AKPM <akpm@linux-foundation.org>,
"Hidetoshi Seto" <seto.hidetoshi@jp.fujitsu.com>,
"Huang Ying" <ying.huang@intel.com>,
LKLM <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/3] Fix unsuitable behavior for poisoned tail pages of THP.
Date: Tue, 25 Jan 2011 14:46:32 +0900 [thread overview]
Message-ID: <4D3E63B8.4040701@np.css.fujitsu.com> (raw)
When a tail page of THP is poisoned, memory-failure will do
nothing except setting poison flag, while the expected behavior is
that the process, who is using the poisoned tail page, should be
killed.
The above problem is caused by lru checking of the poisoned tail page
of THP. Because PG_lru flag is only set on the head page of
THP, the check always consider the poisoned tail page as NON
lru page.
So avoid checking NON lru for THP, as like as hugetlb.
Signed-off-by: Jin Dongming <jin.dongming@np.css.fujitsu.com>
Reviewed-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
---
mm/memory-failure.c | 27 +++++++++++++++------------
1 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 5396603..44a1bdf 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1046,19 +1046,22 @@ int __memory_failure(unsigned long pfn, int trapno, int flags)
* The check (unnecessarily) ignores LRU pages being isolated and
* walked by the page reclaim code, however that's not a big loss.
*/
- if (!PageLRU(p) && !PageHuge(p))
- shake_page(p, 0);
- if (!PageLRU(p) && !PageHuge(p)) {
- /*
- * shake_page could have turned it free.
- */
- if (is_free_buddy_page(p)) {
- action_result(pfn, "free buddy, 2nd try", DELAYED);
- return 0;
+ if (!PageCompound(p)) {
+ if (!PageLRU(p))
+ shake_page(p, 0);
+ if (!PageLRU(p)) {
+ /*
+ * shake_page could have turned it free.
+ */
+ if (is_free_buddy_page(p)) {
+ action_result(pfn, "free buddy, 2nd try",
+ DELAYED);
+ return 0;
+ }
+ action_result(pfn, "non LRU", IGNORED);
+ put_page(p);
+ return -EBUSY;
}
- action_result(pfn, "non LRU", IGNORED);
- put_page(p);
- return -EBUSY;
}
/*
--
1.7.2.2
next reply other threads:[~2011-01-25 5:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-25 5:46 Jin Dongming [this message]
2011-01-25 22:46 ` [PATCH 3/3] Fix unsuitable behavior for poisoned tail pages of THP Andrea Arcangeli
2011-01-27 0:13 ` Jin Dongming
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=4D3E63B8.4040701@np.css.fujitsu.com \
--to=jin.dongming@np.css.fujitsu.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.org \
--cc=seto.hidetoshi@jp.fujitsu.com \
--cc=ying.huang@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