From: Gavin Shan Date: Tue, 31 Jul 2012 23:42:49 +0000 (-0700) Subject: mm/compaction: cleanup on compaction_deferred X-Git-Tag: v3.6~269^2~83 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c59e26104e3e0e952cd7d63e79cd71ee5a9ec25a;p=platform%2Fkernel%2Flinux-amlogic.git 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 Acked-by: Minchan Kim Acked-by: Johannes Weiner Acked-by: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/compaction.h b/include/linux/compaction.h index 51a90b7..133ddcf 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) 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 */