mm-compaction-create-compact_gap-wrapper-fix
authorVlastimil Babka <vbabka@suse.cz>
Sat, 10 Sep 2016 10:34:05 +0000 (20:34 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Sat, 10 Sep 2016 10:34:05 +0000 (20:34 +1000)
Clarify the comment of compact_gap() wrt COMPACT_CLUSTER_MAX, per Joonsoo.

Link: http://lkml.kernel.org/r/7b6aed1f-fdf8-2063-9ff4-bbe4de712d37@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: David Rientjes <rientjes@google.com>
Cc: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/compaction.h

index e7f0d34a90fe1a0afbffc261f416b6f90a1a0caf..585d55cb0dc02078791830ec2d181a819fb29d29 100644 (file)
@@ -67,9 +67,16 @@ static inline unsigned long compact_gap(unsigned int order)
 {
        /*
         * Although all the isolations for migration are temporary, compaction
-        * may have up to 1 << order pages on its list and then try to split
-        * an (order - 1) free page. At that point, a gap of 1 << order might
-        * not be enough, so it's safer to require twice that amount.
+        * free scanner may have up to 1 << order pages on its list and then
+        * try to split an (order - 1) free page. At that point, a gap of
+        * 1 << order might not be enough, so it's safer to require twice that
+        * amount. Note that the number of pages on the list is also
+        * effectively limited by COMPACT_CLUSTER_MAX, as that's the maximum
+        * that the migrate scanner can have isolated on migrate list, and free
+        * scanner is only invoked when the number of isolated free pages is
+        * lower than that. But it's not worth to complicate the formula here
+        * as a bigger gap for higher orders than strictly necessary can also
+        * improve chances of compaction success.
         */
        return 2UL << order;
 }
This page took 0.026244 seconds and 5 git commands to generate.