Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356547
b: refs/heads/master
c: fa8dd8a
h: refs/heads/master
i:
  356545: 780ffff
  356543: 8863ea7
v: v3
  • Loading branch information
Xishi Qiu authored and Linus Torvalds committed Feb 24, 2013
1 parent 22a8efd commit 3031e1a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0ebff32c3637e0ed551c017eb9599ac108ab36aa
refs/heads/master: fa8dd8a92dccc1b29cefd7f51334285d6ed35281
34 changes: 20 additions & 14 deletions trunk/mm/memory-failure.c
Original file line number Diff line number Diff line change
Expand Up @@ -1421,12 +1421,13 @@ static int soft_offline_huge_page(struct page *page, int flags)

if (PageHWPoison(hpage)) {
pr_info("soft offline: %#lx hugepage already poisoned\n", pfn);
return -EBUSY;
ret = -EBUSY;
goto out;
}

ret = get_any_page(page, pfn, flags);
if (ret < 0)
return ret;
goto out;
if (ret == 0)
goto done;

Expand All @@ -1437,14 +1438,14 @@ static int soft_offline_huge_page(struct page *page, int flags)
if (ret) {
pr_info("soft offline: %#lx: migration failed %d, type %lx\n",
pfn, ret, page->flags);
return ret;
goto out;
}
done:
/* keep elevated page count for bad page */
atomic_long_add(1 << compound_trans_order(hpage), &mce_bad_pages);
set_page_hwpoison_huge_page(hpage);
dequeue_hwpoisoned_huge_page(hpage);

out:
return ret;
}

Expand Down Expand Up @@ -1476,24 +1477,28 @@ int soft_offline_page(struct page *page, int flags)
unsigned long pfn = page_to_pfn(page);
struct page *hpage = compound_trans_head(page);

if (PageHuge(page))
return soft_offline_huge_page(page, flags);
if (PageHuge(page)) {
ret = soft_offline_huge_page(page, flags);
goto out;
}
if (PageTransHuge(hpage)) {
if (PageAnon(hpage) && unlikely(split_huge_page(hpage))) {
pr_info("soft offline: %#lx: failed to split THP\n",
pfn);
return -EBUSY;
ret = -EBUSY;
goto out;
}
}

if (PageHWPoison(page)) {
pr_info("soft offline: %#lx page already poisoned\n", pfn);
return -EBUSY;
ret = -EBUSY;
goto out;
}

ret = get_any_page(page, pfn, flags);
if (ret < 0)
return ret;
goto out;
if (ret == 0)
goto done;

Expand All @@ -1512,14 +1517,15 @@ int soft_offline_page(struct page *page, int flags)
*/
ret = get_any_page(page, pfn, 0);
if (ret < 0)
return ret;
goto out;
if (ret == 0)
goto done;
}
if (!PageLRU(page)) {
pr_info("soft_offline: %#lx: unknown non LRU page type %lx\n",
pfn, page->flags);
return -EIO;
ret = -EIO;
goto out;
}

/*
Expand Down Expand Up @@ -1575,12 +1581,12 @@ int soft_offline_page(struct page *page, int flags)
pfn, ret, page_count(page), page->flags);
}
if (ret)
return ret;
goto out;

done:
/* keep elevated page count for bad page */
atomic_long_add(1, &mce_bad_pages);
atomic_long_inc(&mce_bad_pages);
SetPageHWPoison(page);

out:
return ret;
}

0 comments on commit 3031e1a

Please sign in to comment.