page allocator: move check for disabled anti-fragmentation out of fastpath
authorMel Gorman <[email protected]>
Tue, 16 Jun 2009 22:31:58 +0000 (15:31 -0700)
committerLinus Torvalds <[email protected]>
Wed, 17 Jun 2009 02:47:33 +0000 (19:47 -0700)
On low-memory systems, anti-fragmentation gets disabled as there is
nothing it can do and it would just incur overhead shuffling pages between
lists constantly.  Currently the check is made in the free page fast path
for every page.  This patch moves it to a slow path.  On machines with low
memory, there will be small amount of additional overhead as pages get
shuffled between lists but it should quickly settle.

Signed-off-by: Mel Gorman <[email protected]>
Reviewed-by: Christoph Lameter <[email protected]>
Reviewed-by: KOSAKI Motohiro <[email protected]>
Cc: Pekka Enberg <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Nick Piggin <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: Lee Schermerhorn <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/mmzone.h
mm/page_alloc.c

index a47c879e1304cc19397543403aa068bd02433f29..0aa4445b0b8afbd16fac6a8c7f7521715602b099 100644 (file)
@@ -50,9 +50,6 @@ extern int page_group_by_mobility_disabled;
 
 static inline int get_pageblock_migratetype(struct page *page)
 {
-       if (unlikely(page_group_by_mobility_disabled))
-               return MIGRATE_UNMOVABLE;
-
        return get_pageblock_flags_group(page, PB_migrate, PB_migrate_end);
 }
 
index 512bf9a618c7ad884347fbad5ce81c6b289009c2..b09859629e93c24556246a6be27d1a9ea3b979ac 100644 (file)
@@ -168,6 +168,10 @@ int page_group_by_mobility_disabled __read_mostly;
 
 static void set_pageblock_migratetype(struct page *page, int migratetype)
 {
+
+       if (unlikely(page_group_by_mobility_disabled))
+               migratetype = MIGRATE_UNMOVABLE;
+
        set_pageblock_flags_group(page, (unsigned long)migratetype,
                                        PB_migrate, PB_migrate_end);
 }