aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGavin Shan <shangw@linux.vnet.ibm.com>2012-07-31 19:42:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-31 21:42:42 -0400
commitc59e26104e3e0e952cd7d63e79cd71ee5a9ec25a (patch)
tree14ab1cef0b19e576672bdfdea97bc947e6252a76
parent3c935d189be9bb877c5a1110ac5fbf9c8e310658 (diff)
mm/compaction: cleanup on compaction_deferred
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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/compaction.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/compaction.h b/include/linux/compaction.h
index 51a90b7f2d60..133ddcf83397 100644
--- a/include/linux/compaction.h
+++ b/include/linux/compaction.h
@@ -58,7 +58,7 @@ static inline bool compaction_deferred(struct zone *zone, int order)
58 if (++zone->compact_considered > defer_limit) 58 if (++zone->compact_considered > defer_limit)
59 zone->compact_considered = defer_limit; 59 zone->compact_considered = defer_limit;
60 60
61 return zone->compact_considered < (1UL << zone->compact_defer_shift); 61 return zone->compact_considered < defer_limit;
62} 62}
63 63
64#else 64#else
@@ -85,7 +85,7 @@ static inline void defer_compaction(struct zone *zone, int order)
85 85
86static inline bool compaction_deferred(struct zone *zone, int order) 86static inline bool compaction_deferred(struct zone *zone, int order)
87{ 87{
88 return 1; 88 return true;
89} 89}
90 90
91#endif /* CONFIG_COMPACTION */ 91#endif /* CONFIG_COMPACTION */