From: Andrew Morton Date: Tue, 7 Apr 2015 23:44:34 +0000 (+1000) Subject: mm-hugetlb-cleanup-using-pagehugeactive-flag-fix X-Git-Tag: KARO-TXA5-2015-06-26~18^2~274 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=aed159af547300ed7b05da90f307de42ed15000a;p=karo-tx-linux.git mm-hugetlb-cleanup-using-pagehugeactive-flag-fix s/PageHugeActive/page_huge_active/ Cc: Naoya Horiguchi Cc: Hugh Dickins Cc: Michal Hocko Cc: Mel Gorman Cc: Johannes Weiner Cc: David Rientjes Signed-off-by: Andrew Morton --- diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index e7f6178b8f49..205026175c42 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -44,8 +44,6 @@ extern int hugetlb_max_hstate __read_mostly; #define for_each_hstate(h) \ for ((h) = hstates; (h) < &hstates[hugetlb_max_hstate]; (h)++) -int PageHugeActive(struct page *page); - struct hugepage_subpool *hugepage_new_subpool(struct hstate *h, long max_hpages, long min_hpages); void hugepage_put_subpool(struct hugepage_subpool *spool); @@ -115,11 +113,6 @@ unsigned long hugetlb_change_protection(struct vm_area_struct *vma, #else /* !CONFIG_HUGETLB_PAGE */ -static inline int PageHugeActive(struct page *page) -{ - return 0; -} - static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma) { } diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index e5770201bba7..91b7f9b2b774 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -549,11 +549,18 @@ static inline void ClearPageCompound(struct page *page) #ifdef CONFIG_HUGETLB_PAGE int PageHuge(struct page *page); int PageHeadHuge(struct page *page); +bool page_huge_active(struct page *page); #else TESTPAGEFLAG_FALSE(Huge) TESTPAGEFLAG_FALSE(HeadHuge) + +static inline bool page_huge_active(struct page *page) +{ + return 0; +} #endif + #ifdef CONFIG_TRANSPARENT_HUGEPAGE /* * PageHuge() only returns true for hugetlbfs pages, but not for diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 1b1dc7494a3c..e8c92ae35b4b 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -3909,10 +3909,10 @@ int dequeue_hwpoisoned_huge_page(struct page *hpage) spin_lock(&hugetlb_lock); /* - * Just checking !PageHugeActive is not enough, because that could be + * Just checking !page_huge_active is not enough, because that could be * an isolated/hwpoisoned hugepage (which have >0 refcount). */ - if (!PageHugeActive(hpage) && !page_count(hpage)) { + if (!page_huge_active(hpage) && !page_count(hpage)) { /* * Hwpoisoned hugepage isn't linked to activelist or freelist, * but dangling hpage->lru can trigger list-debug warnings diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 113538a2e965..457bde530cbe 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1373,7 +1373,7 @@ static unsigned long scan_movable_pages(unsigned long start, unsigned long end) if (PageLRU(page)) return pfn; if (PageHuge(page)) { - if (PageHugeActive(page)) + if (page_huge_active(page)) return pfn; else pfn = round_up(pfn + 1,