aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory-failure.c
diff options
context:
space:
mode:
authorWanpeng Li <liwanp@linux.vnet.ibm.com>2013-09-11 17:22:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-11 18:58:08 -0400
commitf9121153fdfbfaa930bf65077a5597e20d3ac608 (patch)
treea72e82c0c3394cf84b3ff8698134ff124a61b491 /mm/memory-failure.c
parent841fcc583f81c632d20a27e17beccb20320530a1 (diff)
mm/hwpoison: don't need to hold compound lock for hugetlbfs page
compound lock is introduced by commit e9da73d67("thp: compound_lock."), it is used to serialize put_page against __split_huge_page_refcount(). In addition, transparent hugepages will be splitted in hwpoison handler and just one subpage will be poisoned. There is unnecessary to hold compound lock for hugetlbfs page. This patch replace compound_trans_order by compond_order in the place where the page is hugetlbfs page. Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Tony Luck <tony.luck@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memory-failure.c')
-rw-r--r--mm/memory-failure.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index ec9ad5270d32..7b5d32507c35 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -206,7 +206,7 @@ static int kill_proc(struct task_struct *t, unsigned long addr, int trapno,
206#ifdef __ARCH_SI_TRAPNO 206#ifdef __ARCH_SI_TRAPNO
207 si.si_trapno = trapno; 207 si.si_trapno = trapno;
208#endif 208#endif
209 si.si_addr_lsb = compound_trans_order(compound_head(page)) + PAGE_SHIFT; 209 si.si_addr_lsb = compound_order(compound_head(page)) + PAGE_SHIFT;
210 210
211 if ((flags & MF_ACTION_REQUIRED) && t == current) { 211 if ((flags & MF_ACTION_REQUIRED) && t == current) {
212 si.si_code = BUS_MCEERR_AR; 212 si.si_code = BUS_MCEERR_AR;
@@ -983,7 +983,7 @@ static int hwpoison_user_mappings(struct page *p, unsigned long pfn,
983static void set_page_hwpoison_huge_page(struct page *hpage) 983static void set_page_hwpoison_huge_page(struct page *hpage)
984{ 984{
985 int i; 985 int i;
986 int nr_pages = 1 << compound_trans_order(hpage); 986 int nr_pages = 1 << compound_order(hpage);
987 for (i = 0; i < nr_pages; i++) 987 for (i = 0; i < nr_pages; i++)
988 SetPageHWPoison(hpage + i); 988 SetPageHWPoison(hpage + i);
989} 989}
@@ -991,7 +991,7 @@ static void set_page_hwpoison_huge_page(struct page *hpage)
991static void clear_page_hwpoison_huge_page(struct page *hpage) 991static void clear_page_hwpoison_huge_page(struct page *hpage)
992{ 992{
993 int i; 993 int i;
994 int nr_pages = 1 << compound_trans_order(hpage); 994 int nr_pages = 1 << compound_order(hpage);
995 for (i = 0; i < nr_pages; i++) 995 for (i = 0; i < nr_pages; i++)
996 ClearPageHWPoison(hpage + i); 996 ClearPageHWPoison(hpage + i);
997} 997}
@@ -1342,7 +1342,7 @@ int unpoison_memory(unsigned long pfn)
1342 return 0; 1342 return 0;
1343 } 1343 }
1344 1344
1345 nr_pages = 1 << compound_trans_order(page); 1345 nr_pages = 1 << compound_order(page);
1346 1346
1347 if (!get_page_unless_zero(page)) { 1347 if (!get_page_unless_zero(page)) {
1348 /* 1348 /*
@@ -1506,7 +1506,7 @@ static int soft_offline_huge_page(struct page *page, int flags)
1506 } else { 1506 } else {
1507 set_page_hwpoison_huge_page(hpage); 1507 set_page_hwpoison_huge_page(hpage);
1508 dequeue_hwpoisoned_huge_page(hpage); 1508 dequeue_hwpoisoned_huge_page(hpage);
1509 atomic_long_add(1 << compound_trans_order(hpage), 1509 atomic_long_add(1 << compound_order(hpage),
1510 &num_poisoned_pages); 1510 &num_poisoned_pages);
1511 } 1511 }
1512 return ret; 1512 return ret;
@@ -1566,7 +1566,7 @@ int soft_offline_page(struct page *page, int flags)
1566 if (PageHuge(page)) { 1566 if (PageHuge(page)) {
1567 set_page_hwpoison_huge_page(hpage); 1567 set_page_hwpoison_huge_page(hpage);
1568 dequeue_hwpoisoned_huge_page(hpage); 1568 dequeue_hwpoisoned_huge_page(hpage);
1569 atomic_long_add(1 << compound_trans_order(hpage), 1569 atomic_long_add(1 << compound_order(hpage),
1570 &num_poisoned_pages); 1570 &num_poisoned_pages);
1571 } else { 1571 } else {
1572 SetPageHWPoison(page); 1572 SetPageHWPoison(page);