From: Wang Xiaoqiang <wangxq10@lzu.edu.cn>
To: n-horiguchi@ah.jp.nec.com, n-horiguchi@ah.jp.nec.com,
n-horiguchi@ah.jp.nec.com, n-horiguchi@ah.jp.nec.com,
n-horiguchi@ah.jp.nec.com, n-horiguchi@ah.jp.nec.com,
linux-kernel@vger.kernel.org
Cc: n-horiguchi@ah.jp.nec.com, n-horiguchi@ah.jp.nec.com
Subject: [PATCH] memory_failure: remove redundant check for the PG_HWPoison flag of 'hpage'
Date: Wed, 29 Jul 2015 15:52:46 +0800 [thread overview]
Message-ID: <20150729155246.2fed1b96@hp> (raw)
Hi,
I find a little problem in the memory_failure function in
mm/memory-failure.c . Please check it.
memory_failure: remove redundant check for the PG_HWPoison flag of
`hpage'.
Since we have check the PG_HWPoison flag by `PageHWPoison' before,
so the later check by `TestSetPageHWPoison' must return true, there
is no need to check again!
Signed-off-by: Wang Xiaoqiang <wangxq10@lzu.edu.cn>
---
mm/memory-failure.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 1cf7f29..7794fd8 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1115,7 +1115,7 @@ int memory_failure(unsigned long pfn, int trapno, int flags)
lock_page(hpage);
if (PageHWPoison(hpage)) {
if ((hwpoison_filter(p) && TestClearPageHWPoison(p))
- || (p != hpage && TestSetPageHWPoison(hpage))) {
+ || p != hpage) {
atomic_long_sub(nr_pages, &num_poisoned_pages);
unlock_page(hpage);
return 0;
--
1.7.10.4
--
thx!
Wang Xiaoqiang
next reply other threads:[~2015-07-29 7:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-29 7:52 Wang Xiaoqiang [this message]
2015-07-29 9:17 ` [PATCH] memory_failure: remove redundant check for the PG_HWPoison flag of 'hpage' Naoya Horiguchi
2015-07-29 9:17 ` Naoya Horiguchi
2015-07-30 2:52 ` Wang Xiaoqiang
2015-07-31 8:12 ` Naoya Horiguchi
2015-07-31 8:12 ` 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=20150729155246.2fed1b96@hp \
--to=wangxq10@lzu.edu.cn \
--cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.