From: Joonsoo Kim <iamjoonsoo....@lge.com>

Implementation of PageHighMem() will be changed in following patches.
Before that, use open-code to avoid the side effect of implementation
change on PageHighMem().

Acked-by: Roman Gushchin <g...@fb.com>
Signed-off-by: Joonsoo Kim <iamjoonsoo....@lge.com>
---
 include/linux/migrate.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 3e546cb..a9cfd8e 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -37,6 +37,7 @@ static inline struct page *new_page_nodemask(struct page 
*page,
        gfp_t gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL;
        unsigned int order = 0;
        struct page *new_page = NULL;
+       int zidx;
 
        if (PageHuge(page))
                return 
alloc_huge_page_nodemask(page_hstate(compound_head(page)),
@@ -47,7 +48,8 @@ static inline struct page *new_page_nodemask(struct page 
*page,
                order = HPAGE_PMD_ORDER;
        }
 
-       if (PageHighMem(page) || (zone_idx(page_zone(page)) == ZONE_MOVABLE))
+       zidx = zone_idx(page_zone(page));
+       if (is_highmem_idx(zidx) || zidx == ZONE_MOVABLE)
                gfp_mask |= __GFP_HIGHMEM;
 
        new_page = __alloc_pages_nodemask(gfp_mask, order,
-- 
2.7.4

Reply via email to