@@ -31,34 +31,6 @@ enum migrate_reason {
31
31
/* In mm/debug.c; also keep sync with include/trace/events/migrate.h */
32
32
extern const char * migrate_reason_names [MR_TYPES ];
33
33
34
- static inline struct page * new_page_nodemask (struct page * page ,
35
- int preferred_nid , nodemask_t * nodemask )
36
- {
37
- gfp_t gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL ;
38
- unsigned int order = 0 ;
39
- struct page * new_page = NULL ;
40
-
41
- if (PageHuge (page ))
42
- return alloc_huge_page_nodemask (page_hstate (compound_head (page )),
43
- preferred_nid , nodemask );
44
-
45
- if (PageTransHuge (page )) {
46
- gfp_mask |= GFP_TRANSHUGE ;
47
- order = HPAGE_PMD_ORDER ;
48
- }
49
-
50
- if (PageHighMem (page ) || (zone_idx (page_zone (page )) == ZONE_MOVABLE ))
51
- gfp_mask |= __GFP_HIGHMEM ;
52
-
53
- new_page = __alloc_pages_nodemask (gfp_mask , order ,
54
- preferred_nid , nodemask );
55
-
56
- if (new_page && PageTransHuge (new_page ))
57
- prep_transhuge_page (new_page );
58
-
59
- return new_page ;
60
- }
61
-
62
34
#ifdef CONFIG_MIGRATION
63
35
64
36
extern void putback_movable_pages (struct list_head * l );
@@ -67,6 +39,8 @@ extern int migrate_page(struct address_space *mapping,
67
39
enum migrate_mode mode );
68
40
extern int migrate_pages (struct list_head * l , new_page_t new , free_page_t free ,
69
41
unsigned long private , enum migrate_mode mode , int reason );
42
+ extern struct page * new_page_nodemask (struct page * page ,
43
+ int preferred_nid , nodemask_t * nodemask );
70
44
extern int isolate_movable_page (struct page * page , isolate_mode_t mode );
71
45
extern void putback_movable_page (struct page * page );
72
46
@@ -85,6 +59,9 @@ static inline int migrate_pages(struct list_head *l, new_page_t new,
85
59
free_page_t free , unsigned long private , enum migrate_mode mode ,
86
60
int reason )
87
61
{ return - ENOSYS ; }
62
+ static inline struct page * new_page_nodemask (struct page * page ,
63
+ int preferred_nid , nodemask_t * nodemask )
64
+ { return NULL ; }
88
65
static inline int isolate_movable_page (struct page * page , isolate_mode_t mode )
89
66
{ return - EBUSY ; }
90
67
0 commit comments