public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] memory_failure: remove redundant check for the PG_HWPoison flag of 'hpage'
@ 2015-07-29  7:52 Wang Xiaoqiang
  2015-07-29  9:17 ` Naoya Horiguchi
  0 siblings, 1 reply; 4+ messages in thread
From: Wang Xiaoqiang @ 2015-07-29  7:52 UTC (permalink / raw)
  To: n-horiguchi, n-horiguchi, n-horiguchi, n-horiguchi, n-horiguchi,
	n-horiguchi, linux-kernel
  Cc: n-horiguchi, n-horiguchi

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-07-31  8:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-29  7:52 [PATCH] memory_failure: remove redundant check for the PG_HWPoison flag of 'hpage' Wang Xiaoqiang
2015-07-29  9:17 ` Naoya Horiguchi
2015-07-30  2:52   ` Wang Xiaoqiang
2015-07-31  8:12     ` Naoya Horiguchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox