diff options
Diffstat (limited to 'include/linux/compaction.h')
-rw-r--r-- | include/linux/compaction.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/compaction.h b/include/linux/compaction.h index 0e38a1deeb23..6ecb6dc2f303 100644 --- a/include/linux/compaction.h +++ b/include/linux/compaction.h | |||
@@ -24,6 +24,7 @@ extern unsigned long try_to_compact_pages(struct zonelist *zonelist, | |||
24 | int order, gfp_t gfp_mask, nodemask_t *mask, | 24 | int order, gfp_t gfp_mask, nodemask_t *mask, |
25 | bool sync, bool *contended, struct page **page); | 25 | bool sync, bool *contended, struct page **page); |
26 | extern int compact_pgdat(pg_data_t *pgdat, int order); | 26 | extern int compact_pgdat(pg_data_t *pgdat, int order); |
27 | extern void reset_isolation_suitable(pg_data_t *pgdat); | ||
27 | extern unsigned long compaction_suitable(struct zone *zone, int order); | 28 | extern unsigned long compaction_suitable(struct zone *zone, int order); |
28 | 29 | ||
29 | /* Do not skip compaction more than 64 times */ | 30 | /* Do not skip compaction more than 64 times */ |
@@ -61,6 +62,16 @@ static inline bool compaction_deferred(struct zone *zone, int order) | |||
61 | return zone->compact_considered < defer_limit; | 62 | return zone->compact_considered < defer_limit; |
62 | } | 63 | } |
63 | 64 | ||
65 | /* Returns true if restarting compaction after many failures */ | ||
66 | static inline bool compaction_restarting(struct zone *zone, int order) | ||
67 | { | ||
68 | if (order < zone->compact_order_failed) | ||
69 | return false; | ||
70 | |||
71 | return zone->compact_defer_shift == COMPACT_MAX_DEFER_SHIFT && | ||
72 | zone->compact_considered >= 1UL << zone->compact_defer_shift; | ||
73 | } | ||
74 | |||
64 | #else | 75 | #else |
65 | static inline unsigned long try_to_compact_pages(struct zonelist *zonelist, | 76 | static inline unsigned long try_to_compact_pages(struct zonelist *zonelist, |
66 | int order, gfp_t gfp_mask, nodemask_t *nodemask, | 77 | int order, gfp_t gfp_mask, nodemask_t *nodemask, |
@@ -74,6 +85,10 @@ static inline int compact_pgdat(pg_data_t *pgdat, int order) | |||
74 | return COMPACT_CONTINUE; | 85 | return COMPACT_CONTINUE; |
75 | } | 86 | } |
76 | 87 | ||
88 | static inline void reset_isolation_suitable(pg_data_t *pgdat) | ||
89 | { | ||
90 | } | ||
91 | |||
77 | static inline unsigned long compaction_suitable(struct zone *zone, int order) | 92 | static inline unsigned long compaction_suitable(struct zone *zone, int order) |
78 | { | 93 | { |
79 | return COMPACT_SKIPPED; | 94 | return COMPACT_SKIPPED; |