diff options
Diffstat (limited to 'include/linux/gfp.h')
-rw-r--r-- | include/linux/gfp.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index f8ffcd401c5f..7e93a9ae7064 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -104,6 +104,18 @@ struct vm_area_struct; | |||
104 | /* 4GB DMA on some platforms */ | 104 | /* 4GB DMA on some platforms */ |
105 | #define GFP_DMA32 __GFP_DMA32 | 105 | #define GFP_DMA32 __GFP_DMA32 |
106 | 106 | ||
107 | /* Convert GFP flags to their corresponding migrate type */ | ||
108 | static inline int allocflags_to_migratetype(gfp_t gfp_flags) | ||
109 | { | ||
110 | WARN_ON((gfp_flags & GFP_MOVABLE_MASK) == GFP_MOVABLE_MASK); | ||
111 | |||
112 | if (unlikely(page_group_by_mobility_disabled)) | ||
113 | return MIGRATE_UNMOVABLE; | ||
114 | |||
115 | /* Group based on mobility */ | ||
116 | return (((gfp_flags & __GFP_MOVABLE) != 0) << 1) | | ||
117 | ((gfp_flags & __GFP_RECLAIMABLE) != 0); | ||
118 | } | ||
107 | 119 | ||
108 | static inline enum zone_type gfp_zone(gfp_t flags) | 120 | static inline enum zone_type gfp_zone(gfp_t flags) |
109 | { | 121 | { |