diff options
author | Andrea Arcangeli <aarcange@redhat.com> | 2011-01-13 18:47:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 20:32:46 -0500 |
commit | 5a03b051ed87e72b959f32a86054e1142ac4cf55 (patch) | |
tree | 31f0e8efb86d48b0292f8a7ea4bd9cf7c930a0ab /include/linux/compaction.h | |
parent | 878aee7d6b5504e01b9caffce080e792b6b8d090 (diff) |
thp: use compaction in kswapd for GFP_ATOMIC order > 0
This takes advantage of memory compaction to properly generate pages of
order > 0 if regular page reclaim fails and priority level becomes more
severe and we don't reach the proper watermarks.
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/compaction.h')
-rw-r--r-- | include/linux/compaction.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/linux/compaction.h b/include/linux/compaction.h index 72cba4034785..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 |
15 | extern int sysctl_compact_memory; | 18 | extern int sysctl_compact_memory; |
16 | extern int sysctl_compaction_handler(struct ctl_table *table, int write, | 19 | extern int sysctl_compaction_handler(struct ctl_table *table, int write, |
@@ -25,7 +28,8 @@ extern unsigned long try_to_compact_pages(struct zonelist *zonelist, | |||
25 | bool sync); | 28 | bool sync); |
26 | extern unsigned long compaction_suitable(struct zone *zone, int order); | 29 | extern unsigned long compaction_suitable(struct zone *zone, int order); |
27 | extern unsigned long compact_zone_order(struct zone *zone, int order, | 30 | extern unsigned long compact_zone_order(struct zone *zone, int order, |
28 | gfp_t gfp_mask, bool sync); | 31 | gfp_t gfp_mask, bool sync, |
32 | int compact_mode); | ||
29 | 33 | ||
30 | /* Do not skip compaction more than 64 times */ | 34 | /* Do not skip compaction more than 64 times */ |
31 | #define COMPACT_MAX_DEFER_SHIFT 6 | 35 | #define COMPACT_MAX_DEFER_SHIFT 6 |
@@ -70,9 +74,10 @@ static inline unsigned long compaction_suitable(struct zone *zone, int order) | |||
70 | } | 74 | } |
71 | 75 | ||
72 | static inline unsigned long compact_zone_order(struct zone *zone, int order, | 76 | static inline unsigned long compact_zone_order(struct zone *zone, int order, |
73 | gfp_t gfp_mask, bool sync) | 77 | gfp_t gfp_mask, bool sync, |
78 | int compact_mode) | ||
74 | { | 79 | { |
75 | return 0; | 80 | return COMPACT_CONTINUE; |
76 | } | 81 | } |
77 | 82 | ||
78 | static inline void defer_compaction(struct zone *zone) | 83 | static inline void defer_compaction(struct zone *zone) |