projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b5f1fc9
)
mm: memory-failure: avoid pfn_valid() twice in soft_offline_page()
author
Kefeng Wang
<wangkefeng.wang@huawei.com>
Fri, 21 Oct 2022 08:46:10 +0000
(16:46 +0800)
committer
Andrew Morton
<akpm@linux-foundation.org>
Wed, 9 Nov 2022 01:37:21 +0000
(17:37 -0800)
Simplify WARN_ON_ONCE(flags & MF_COUNT_INCREASED) under !pfn_valid().
Link:
https://lkml.kernel.org/r/20221021084611.53765-2-wangkefeng.wang@huawei.com
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory-failure.c
patch
|
blob
|
history
diff --git
a/mm/memory-failure.c
b/mm/memory-failure.c
index 8c6a19b9790f9de63da5947cf65658509a560bbd..b5e0dba021922f51177d2a835e45f878807bcdff 100644
(file)
--- a/
mm/memory-failure.c
+++ b/
mm/memory-failure.c
@@
-2551,10
+2551,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);