diff options
Diffstat (limited to 'include/linux/compaction.h')
-rw-r--r-- | include/linux/compaction.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/compaction.h b/include/linux/compaction.h index 091d72e70d8a..7e1c76e3cd68 100644 --- a/include/linux/compaction.h +++ b/include/linux/compaction.h | |||
@@ -62,6 +62,22 @@ static inline bool compaction_deferred(struct zone *zone, int order) | |||
62 | return zone->compact_considered < defer_limit; | 62 | return zone->compact_considered < defer_limit; |
63 | } | 63 | } |
64 | 64 | ||
65 | /* | ||
66 | * Update defer tracking counters after successful compaction of given order, | ||
67 | * which means an allocation either succeeded (alloc_success == true) or is | ||
68 | * expected to succeed. | ||
69 | */ | ||
70 | static inline void compaction_defer_reset(struct zone *zone, int order, | ||
71 | bool alloc_success) | ||
72 | { | ||
73 | if (alloc_success) { | ||
74 | zone->compact_considered = 0; | ||
75 | zone->compact_defer_shift = 0; | ||
76 | } | ||
77 | if (order >= zone->compact_order_failed) | ||
78 | zone->compact_order_failed = order + 1; | ||
79 | } | ||
80 | |||
65 | /* Returns true if restarting compaction after many failures */ | 81 | /* Returns true if restarting compaction after many failures */ |
66 | static inline bool compaction_restarting(struct zone *zone, int order) | 82 | static inline bool compaction_restarting(struct zone *zone, int order) |
67 | { | 83 | { |