[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221021084611.53765-2-wangkefeng.wang@huawei.com>
Date: Fri, 21 Oct 2022 16:46:10 +0800
From: Kefeng Wang <wangkefeng.wang@...wei.com>
To: Naoya Horiguchi <naoya.horiguchi@....com>,
Andrew Morton <akpm@...ux-foundation.org>
CC: Miaohe Lin <linmiaohe@...wei.com>, <linux-mm@...ck.org>,
<linux-kernel@...r.kernel.org>,
Kefeng Wang <wangkefeng.wang@...wei.com>
Subject: [PATCH 2/3] mm: memory-failure: avoid pfn_valid() twice in soft_offline_page()
Simplify WARN_ON_ONCE(flags & MF_COUNT_INCREASED) under !pfn_valid().
Signed-off-by: Kefeng Wang <wangkefeng.wang@...wei.com>
---
mm/memory-failure.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index b94152abb1c9..ca0199d0f79d 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -2554,10 +2554,10 @@ int soft_offline_page(unsigned long pfn, int flags)
bool try_again = true;
struct page *page;
- WARN_ON_ONCE(!pfn_valid(pfn) && (flags & MF_COUNT_INCREASED));
-
- if (!pfn_valid(pfn))
+ if (!pfn_valid(pfn)) {
+ WARN_ON_ONCE(flags & MF_COUNT_INCREASED);
return -ENXIO;
+ }
/* Only online pages can be soft-offlined (esp., not ZONE_DEVICE). */
page = pfn_to_online_page(pfn);
--
2.35.3
Powered by blists - more mailing lists