]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm/compaction: cleanup on compaction_deferred
authorGavin Shan <shangw@linux.vnet.ibm.com>
Sat, 21 Jul 2012 00:54:08 +0000 (10:54 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Jul 2012 03:02:28 +0000 (13:02 +1000)
When CONFIG_COMPACTION is enabled, compaction_deferred() tries to
recalculate the deferred limit again, which isn't necessary.

When CONFIG_COMPACTION is disabled, compaction_deferred() should return
"true" or "false" since it has "bool" for its return value.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/compaction.h

index 51a90b7f2d606a3dcb9bb582cd209add0c429351..133ddcf83397036a5c20ed6431db3b789eeab37a 100644 (file)
@@ -58,7 +58,7 @@ static inline bool compaction_deferred(struct zone *zone, int order)
        if (++zone->compact_considered > defer_limit)
                zone->compact_considered = defer_limit;
 
-       return zone->compact_considered < (1UL << zone->compact_defer_shift);
+       return zone->compact_considered < defer_limit;
 }
 
 #else
@@ -85,7 +85,7 @@ static inline void defer_compaction(struct zone *zone, int order)
 
 static inline bool compaction_deferred(struct zone *zone, int order)
 {
-       return 1;
+       return true;
 }
 
 #endif /* CONFIG_COMPACTION */