aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/compaction.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/compaction.h')
-rw-r--r--include/linux/compaction.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/include/linux/compaction.h b/include/linux/compaction.h
index 5ac51552d908..dfa2ed4c0d26 100644
--- a/include/linux/compaction.h
+++ b/include/linux/compaction.h
@@ -11,6 +11,9 @@
11/* The full zone was compacted */ 11/* The full zone was compacted */
12#define COMPACT_COMPLETE 3 12#define COMPACT_COMPLETE 3
13 13
14#define COMPACT_MODE_DIRECT_RECLAIM 0
15#define COMPACT_MODE_KSWAPD 1
16
14#ifdef CONFIG_COMPACTION 17#ifdef CONFIG_COMPACTION
15extern int sysctl_compact_memory; 18extern int sysctl_compact_memory;
16extern int sysctl_compaction_handler(struct ctl_table *table, int write, 19extern int sysctl_compaction_handler(struct ctl_table *table, int write,
@@ -21,7 +24,12 @@ extern int sysctl_extfrag_handler(struct ctl_table *table, int write,
21 24
22extern int fragmentation_index(struct zone *zone, unsigned int order); 25extern int fragmentation_index(struct zone *zone, unsigned int order);
23extern unsigned long try_to_compact_pages(struct zonelist *zonelist, 26extern unsigned long try_to_compact_pages(struct zonelist *zonelist,
24 int order, gfp_t gfp_mask, nodemask_t *mask); 27 int order, gfp_t gfp_mask, nodemask_t *mask,
28 bool sync);
29extern unsigned long compaction_suitable(struct zone *zone, int order);
30extern unsigned long compact_zone_order(struct zone *zone, int order,
31 gfp_t gfp_mask, bool sync,
32 int compact_mode);
25 33
26/* Do not skip compaction more than 64 times */ 34/* Do not skip compaction more than 64 times */
27#define COMPACT_MAX_DEFER_SHIFT 6 35#define COMPACT_MAX_DEFER_SHIFT 6
@@ -54,7 +62,20 @@ static inline bool compaction_deferred(struct zone *zone)
54 62
55#else 63#else
56static inline unsigned long try_to_compact_pages(struct zonelist *zonelist, 64static inline unsigned long try_to_compact_pages(struct zonelist *zonelist,
57 int order, gfp_t gfp_mask, nodemask_t *nodemask) 65 int order, gfp_t gfp_mask, nodemask_t *nodemask,
66 bool sync)
67{
68 return COMPACT_CONTINUE;
69}
70
71static inline unsigned long compaction_suitable(struct zone *zone, int order)
72{
73 return COMPACT_SKIPPED;
74}
75
76static inline unsigned long compact_zone_order(struct zone *zone, int order,
77 gfp_t gfp_mask, bool sync,
78 int compact_mode)
58{ 79{
59 return COMPACT_CONTINUE; 80 return COMPACT_CONTINUE;
60} 81}