diff options
author | Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> | 2010-05-27 20:29:20 -0400 |
---|---|---|
committer | Andi Kleen <ak@linux.intel.com> | 2010-08-11 03:22:46 -0400 |
commit | 93f70f900da36fbc19c13c2aa04b2e468c8d00fb (patch) | |
tree | 7868f891bca0ed18c9806771a68feac0b4010517 /mm/hugetlb.c | |
parent | c9fbdd5f131440981b124883656ea21fb12cde4a (diff) |
HWPOISON, hugetlb: isolate corrupted hugepage
If error hugepage is not in-use, we can fully recovery from error
by dequeuing it from freelist, so return RECOVERY.
Otherwise whether or not we can recovery depends on user processes,
so return DELAYED.
Dependency:
"HWPOISON, hugetlb: enable error handling path for hugepage"
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r-- | mm/hugetlb.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index aa3c51739378..8c163f64cf10 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -2825,3 +2825,19 @@ void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed) | |||
2825 | hugetlb_put_quota(inode->i_mapping, (chg - freed)); | 2825 | hugetlb_put_quota(inode->i_mapping, (chg - freed)); |
2826 | hugetlb_acct_memory(h, -(chg - freed)); | 2826 | hugetlb_acct_memory(h, -(chg - freed)); |
2827 | } | 2827 | } |
2828 | |||
2829 | /* | ||
2830 | * This function is called from memory failure code. | ||
2831 | * Assume the caller holds page lock of the head page. | ||
2832 | */ | ||
2833 | void __isolate_hwpoisoned_huge_page(struct page *hpage) | ||
2834 | { | ||
2835 | struct hstate *h = page_hstate(hpage); | ||
2836 | int nid = page_to_nid(hpage); | ||
2837 | |||
2838 | spin_lock(&hugetlb_lock); | ||
2839 | list_del(&hpage->lru); | ||
2840 | h->free_huge_pages--; | ||
2841 | h->free_huge_pages_node[nid]--; | ||
2842 | spin_unlock(&hugetlb_lock); | ||
2843 | } | ||