Skip to content

Commit

Permalink
mm, madvise_inject_error: Disable MADV_SOFT_OFFLINE for ZONE_DEVICE p…
Browse files Browse the repository at this point in the history
…ages

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 <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
Acked-by: Naoya Horiguchi <[email protected]>
Signed-off-by: Dave Jiang <[email protected]>
  • Loading branch information
djbw authored and davejiang committed Jul 20, 2018
1 parent 73449da commit 86a6681
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mm/memory-failure.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 86a6681

Please sign in to comment.