diff options
Diffstat (limited to 'include/linux/compaction.h')
| -rw-r--r-- | include/linux/compaction.h | 20 | 
1 files changed, 18 insertions, 2 deletions
diff --git a/include/linux/compaction.h b/include/linux/compaction.h index 091d72e70d8..01e3132820d 100644 --- a/include/linux/compaction.h +++ b/include/linux/compaction.h @@ -22,7 +22,7 @@ extern int sysctl_extfrag_handler(struct ctl_table *table, int write,  extern int fragmentation_index(struct zone *zone, unsigned int order);  extern unsigned long try_to_compact_pages(struct zonelist *zonelist,  			int order, gfp_t gfp_mask, nodemask_t *mask, -			bool sync, bool *contended); +			enum migrate_mode mode, bool *contended);  extern void compact_pgdat(pg_data_t *pgdat, int order);  extern void reset_isolation_suitable(pg_data_t *pgdat);  extern unsigned long compaction_suitable(struct zone *zone, int order); @@ -62,6 +62,22 @@ static inline bool compaction_deferred(struct zone *zone, int order)  	return zone->compact_considered < defer_limit;  } +/* + * Update defer tracking counters after successful compaction of given order, + * which means an allocation either succeeded (alloc_success == true) or is + * expected to succeed. + */ +static inline void compaction_defer_reset(struct zone *zone, int order, +		bool alloc_success) +{ +	if (alloc_success) { +		zone->compact_considered = 0; +		zone->compact_defer_shift = 0; +	} +	if (order >= zone->compact_order_failed) +		zone->compact_order_failed = order + 1; +} +  /* Returns true if restarting compaction after many failures */  static inline bool compaction_restarting(struct zone *zone, int order)  { @@ -75,7 +91,7 @@ static inline bool compaction_restarting(struct zone *zone, int order)  #else  static inline unsigned long try_to_compact_pages(struct zonelist *zonelist,  			int order, gfp_t gfp_mask, nodemask_t *nodemask, -			bool sync, bool *contended) +			enum migrate_mode mode, bool *contended)  {  	return COMPACT_CONTINUE;  }  | 
