mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] pmem: use TestClearPageHWPoison() directly
@ 2022-11-25 11:53 Kefeng Wang
  2022-11-26  0:41 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Kefeng Wang @ 2022-11-25 11:53 UTC (permalink / raw)
  To: Dan Williams, Vishal Verma, Dave Jiang, Ira Weiny, Andrew Morton,
	linux-kernel
  Cc: Kefeng Wang

Add TESTSCFLAG_FALSE(HWPoison, hwpoison) for HWPoison in
page flags, then drop privite test_and_clear_pmem_poison().

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 drivers/nvdimm/pmem.c      |  2 +-
 drivers/nvdimm/pmem.h      | 12 ------------
 include/linux/page-flags.h |  1 +
 3 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
index 3c63dc2cdc81..1fa6b3980221 100644
--- a/drivers/nvdimm/pmem.c
+++ b/drivers/nvdimm/pmem.c
@@ -80,7 +80,7 @@ static void pmem_mkpage_present(struct pmem_device *pmem, phys_addr_t offset,
 		 * here since we're in the driver I/O path and
 		 * outstanding I/O requests pin the dev_pagemap.
 		 */
-		if (test_and_clear_pmem_poison(page))
+		if (TestClearPageHWPoison(page))
 			clear_mce_nospec(pfn);
 	}
 }
diff --git a/drivers/nvdimm/pmem.h b/drivers/nvdimm/pmem.h
index 392b0b38acb9..6f5c2f35b93a 100644
--- a/drivers/nvdimm/pmem.h
+++ b/drivers/nvdimm/pmem.h
@@ -1,7 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 #ifndef __NVDIMM_PMEM_H__
 #define __NVDIMM_PMEM_H__
-#include <linux/page-flags.h>
 #include <linux/badblocks.h>
 #include <linux/memremap.h>
 #include <linux/types.h>
@@ -33,15 +32,4 @@ long __pmem_direct_access(struct pmem_device *pmem, pgoff_t pgoff,
 		long nr_pages, enum dax_access_mode mode, void **kaddr,
 		pfn_t *pfn);
 
-#ifdef CONFIG_MEMORY_FAILURE
-static inline bool test_and_clear_pmem_poison(struct page *page)
-{
-	return TestClearPageHWPoison(page);
-}
-#else
-static inline bool test_and_clear_pmem_poison(struct page *page)
-{
-	return false;
-}
-#endif
 #endif /* __NVDIMM_PMEM_H__ */
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index e42c55a7e012..5e877b6c7b90 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -582,6 +582,7 @@ extern bool take_page_off_buddy(struct page *page);
 extern bool put_page_back_buddy(struct page *page);
 #else
 PAGEFLAG_FALSE(HWPoison, hwpoison)
+TESTSCFLAG_FALSE(HWPoison, hwpoison)
 #define __PG_HWPOISON 0
 #endif
 
-- 
2.35.3


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

* Re: [PATCH] pmem: use TestClearPageHWPoison() directly
  2022-11-25 11:53 [PATCH] pmem: use TestClearPageHWPoison() directly Kefeng Wang
@ 2022-11-26  0:41 ` Andrew Morton
  2022-11-26  1:38   ` Kefeng Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2022-11-26  0:41 UTC (permalink / raw)
  To: Kefeng Wang
  Cc: Dan Williams, Vishal Verma, Dave Jiang, Ira Weiny, linux-kernel

On Fri, 25 Nov 2022 19:53:08 +0800 Kefeng Wang <wangkefeng.wang@huawei.com> wrote:

> Add TESTSCFLAG_FALSE(HWPoison, hwpoison) for HWPoison in
> page flags, then drop privite test_and_clear_pmem_poison().

Why?

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

* Re: [PATCH] pmem: use TestClearPageHWPoison() directly
  2022-11-26  0:41 ` Andrew Morton
@ 2022-11-26  1:38   ` Kefeng Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Kefeng Wang @ 2022-11-26  1:38 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Dan Williams, Vishal Verma, Dave Jiang, Ira Weiny, linux-kernel


On 2022/11/26 8:41, Andrew Morton wrote:
> On Fri, 25 Nov 2022 19:53:08 +0800 Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>
>> Add TESTSCFLAG_FALSE(HWPoison, hwpoison) for HWPoison in
>> page flags, then drop privite test_and_clear_pmem_poison().
> Why?
Just a cleanup,the TestClearPageHWPoison is used in pmem.c, but
it has own stub when MEMORY_FAILURE not enabled, so add TESTSCFLAG_FALSE()
for HWpoison in case similar scenario, if there are some rules about
it,please ignore it.
> .

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

end of thread, other threads:[~2022-11-26  1:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-25 11:53 [PATCH] pmem: use TestClearPageHWPoison() directly Kefeng Wang
2022-11-26  0:41 ` Andrew Morton
2022-11-26  1:38   ` Kefeng Wang

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

all inboxes | Powered by JetHome®