diff options
author | Mel Gorman <mel@csn.ul.ie> | 2007-10-16 04:25:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:42:59 -0400 |
commit | b2a0ac8875a0a3b9f0739b60526f8c5977d2200f (patch) | |
tree | 31826716b3209751a5468b840ff14190b4a5a8a2 /include | |
parent | 835c134ec4dd755e5c4470af566db226d1e96742 (diff) |
Split the free lists for movable and unmovable allocations
This patch adds the core of the fragmentation reduction strategy. It works by
grouping pages together based on their ability to migrate or be reclaimed.
Basically, it works by breaking the list in zone->free_area list into
MIGRATE_TYPES number of lists.
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mmzone.h | 10 | ||||
-rw-r--r-- | include/linux/pageblock-flags.h | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 322e8048463e..57700038e669 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -33,8 +33,16 @@ | |||
33 | */ | 33 | */ |
34 | #define PAGE_ALLOC_COSTLY_ORDER 3 | 34 | #define PAGE_ALLOC_COSTLY_ORDER 3 |
35 | 35 | ||
36 | #define MIGRATE_UNMOVABLE 0 | ||
37 | #define MIGRATE_MOVABLE 1 | ||
38 | #define MIGRATE_TYPES 2 | ||
39 | |||
40 | #define for_each_migratetype_order(order, type) \ | ||
41 | for (order = 0; order < MAX_ORDER; order++) \ | ||
42 | for (type = 0; type < MIGRATE_TYPES; type++) | ||
43 | |||
36 | struct free_area { | 44 | struct free_area { |
37 | struct list_head free_list; | 45 | struct list_head free_list[MIGRATE_TYPES]; |
38 | unsigned long nr_free; | 46 | unsigned long nr_free; |
39 | }; | 47 | }; |
40 | 48 | ||
diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h index 96b623f9b4db..3619d52a425c 100644 --- a/include/linux/pageblock-flags.h +++ b/include/linux/pageblock-flags.h | |||
@@ -31,6 +31,7 @@ | |||
31 | 31 | ||
32 | /* Bit indices that affect a whole block of pages */ | 32 | /* Bit indices that affect a whole block of pages */ |
33 | enum pageblock_bits { | 33 | enum pageblock_bits { |
34 | PB_range(PB_migrate, 1), /* 1 bit required for migrate types */ | ||
34 | NR_PAGEBLOCK_BITS | 35 | NR_PAGEBLOCK_BITS |
35 | }; | 36 | }; |
36 | 37 | ||