Upon investigation, it was found that the recommended value for
min_free_kbytes was not reducing the number of fragmentation-related
events that were occuring in the page allocator enough.

This patch increases min_free_kbytes such that at least two pageblocks
are free for MIGRATE_RESERVE and 3 pageblocks free per migratetype that
is commonly used in the page allocator. This significantly reduces the
number of fragmentation-related events that occur.

However, it should be noted that to really get the fragmentation events
down, the upstream kernel needs to have the patch "page-allocator: Limit
the number of MIGRATE_RESERVE pageblocks per zone" applied. It has been
sent for consideration in -mm.

Signed-off-by: Mel Gorman <m...@csn.ul.ie>
--- 
 hugeadm.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/hugeadm.c b/hugeadm.c
index 6ebe153..a793267 100644
--- a/hugeadm.c
+++ b/hugeadm.c
@@ -636,7 +636,16 @@ long recommended_minfreekbytes(void)
        }
        fclose(f);
 
-       recommended_min = pageblock_kbytes * nr_zones;
+       /* Make sure at least 2 pageblocks are free for MIGRATE_RESERVE */
+       recommended_min = pageblock_kbytes * nr_zones * 2;
+
+       /*
+        * Make sure that on average at least two pageblocks are almost free
+        * of another type, one for a migratetype to fall back to and a
+        * second to avoid subsequent fallbacks of other types There are 3
+        * MIGRATE_TYPES we care about.
+        */
+       recommended_min += pageblock_kbytes * nr_zones * 3 * 3;
        return recommended_min;
 }
 

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Libhugetlbfs-devel mailing list
Libhugetlbfs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel

Reply via email to