mm/compaction: more trace to understand when/why compaction start/finish
[cascardo/linux.git] / include / linux / compaction.h
index 3238ffa..501d751 100644 (file)
 #define COMPACT_PARTIAL                3
 /* The full zone was compacted */
 #define COMPACT_COMPLETE       4
+/* For more detailed tracepoint output */
+#define COMPACT_NO_SUITABLE_PAGE       5
+#define COMPACT_NOT_SUITABLE_ZONE      6
+/* When adding new state, please change compaction_status_string, too */
 
 /* Used to signal whether compaction detected need_sched() or lock contention */
 /* No contention detected */
@@ -21,6 +25,8 @@
 /* Zone lock or lru_lock was contended in async compaction */
 #define COMPACT_CONTENDED_LOCK 2
 
+struct alloc_context; /* in mm/internal.h */
+
 #ifdef CONFIG_COMPACTION
 extern int sysctl_compact_memory;
 extern int sysctl_compaction_handler(struct ctl_table *table, int write,
@@ -30,10 +36,9 @@ extern int sysctl_extfrag_handler(struct ctl_table *table, int write,
                        void __user *buffer, size_t *length, loff_t *ppos);
 
 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,
-                       enum migrate_mode mode, int *contended,
-                       int alloc_flags, int classzone_idx);
+extern unsigned long try_to_compact_pages(gfp_t gfp_mask, unsigned int order,
+                       int alloc_flags, const struct alloc_context *ac,
+                       enum migrate_mode mode, int *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,
@@ -101,10 +106,10 @@ 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,
-                       enum migrate_mode mode, int *contended,
-                       int alloc_flags, int classzone_idx)
+static inline unsigned long try_to_compact_pages(gfp_t gfp_mask,
+                       unsigned int order, int alloc_flags,
+                       const struct alloc_context *ac,
+                       enum migrate_mode mode, int *contended)
 {
        return COMPACT_CONTINUE;
 }