summaryrefslogtreecommitdiffstats
path: root/mm/memory-failure.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2018-07-14 06:49:56 +0200
committerDave Jiang <dave.jiang@intel.com>2018-07-20 20:21:53 +0200
commit86a66810baa87e5d1c93a51f71d36c7f71fe3113 (patch)
tree7bf2be04372c4d89700da9adebc2a6e7f85fe5f2 /mm/memory-failure.c
parentfilesystem-dax: Set page->index (diff)
downloadlinux-86a66810baa87e5d1c93a51f71d36c7f71fe3113.tar.xz
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/memory-failure.c')
-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)