summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2018-07-13 21:49:56 -0700
committerDave Jiang <dave.jiang@intel.com>2018-07-20 11:21:53 -0700
commit86a66810baa87e5d1c93a51f71d36c7f71fe3113 (patch)
tree7bf2be04372c4d89700da9adebc2a6e7f85fe5f2 /mm
parent73449daf8f0db2697fb9f3f60b3a6d5c76a3c5fc (diff)
downloadlinux-86a66810baa87e5d1c93a51f71d36c7f71fe3113.tar.gz
linux-86a66810baa87e5d1c93a51f71d36c7f71fe3113.tar.bz2
linux-86a66810baa87e5d1c93a51f71d36c7f71fe3113.zip
mm, madvise_inject_error: Disable MADV_SOFT_OFFLINE for ZONE_DEVICE pages
Given that dax / device-mapped pages are never subject to page allocations remove them from consideration by the soft-offline mechanism. Reported-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Acked-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Diffstat (limited to 'mm')
-rw-r--r--mm/memory-failure.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 9d142b9b86dc..988f977db3d2 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1751,6 +1751,14 @@ int soft_offline_page(struct page *page, int flags)
int ret;
unsigned long pfn = page_to_pfn(page);
+ if (is_zone_device_page(page)) {
+ pr_debug_ratelimited("soft_offline: %#lx page is device page\n",
+ pfn);
+ if (flags & MF_COUNT_INCREASED)
+ put_page(page);
+ return -EIO;
+ }
+
if (PageHWPoison(page)) {
pr_info("soft offline: %#lx page already poisoned\n", pfn);
if (flags & MF_COUNT_INCREASED)