]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm: use IS_ENABLED(CONFIG_COMPACTION) instead of COMPACTION_BUILD
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Fri, 9 Nov 2012 03:03:57 +0000 (14:03 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 13 Nov 2012 05:15:19 +0000 (16:15 +1100)
We don't need custom COMPACTION_BUILD anymore, since we have handy
IS_ENABLED().

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/kernel.h
mm/vmscan.c

index d8d1ac6b19518b7935fd26eaff18cae7bbbd7ef0..1e98564c2a27d5b8cb090801adfbfb5c404a9b6e 100644 (file)
@@ -684,13 +684,6 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
 /* Trap pasters of __FUNCTION__ at compile-time */
 #define __FUNCTION__ (__func__)
 
-/* This helps us avoid #ifdef CONFIG_COMPACTION */
-#ifdef CONFIG_COMPACTION
-#define COMPACTION_BUILD 1
-#else
-#define COMPACTION_BUILD 0
-#endif
-
 /* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */
 #ifdef CONFIG_FTRACE_MCOUNT_RECORD
 # define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD
index f6c4de4d71d60e22f4d530b2a2b8f91bee02c1e4..bc2af7fff2b95bf2360f9bcdd9128c42c7f85b1f 100644 (file)
@@ -1752,7 +1752,7 @@ out:
 /* Use reclaim/compaction for costly allocs or under memory pressure */
 static bool in_reclaim_compaction(struct scan_control *sc)
 {
-       if (COMPACTION_BUILD && sc->order &&
+       if (IS_ENABLED(CONFIG_COMPACTION) && sc->order &&
                        (sc->order > PAGE_ALLOC_COSTLY_ORDER ||
                         sc->priority < DEF_PRIORITY - 2))
                return true;
@@ -2036,7 +2036,7 @@ static bool shrink_zones(struct zonelist *zonelist, struct scan_control *sc)
                        if (zone->all_unreclaimable &&
                                        sc->priority != DEF_PRIORITY)
                                continue;       /* Let kswapd poll it */
-                       if (COMPACTION_BUILD) {
+                       if (IS_ENABLED(CONFIG_COMPACTION)) {
                                /*
                                 * If we already have plenty of memory free for
                                 * compaction in this zone, don't free any more.
@@ -2687,7 +2687,7 @@ loop_again:
                         * Do not reclaim more than needed for compaction.
                         */
                        testorder = order;
-                       if (COMPACTION_BUILD && order &&
+                       if (IS_ENABLED(CONFIG_COMPACTION) && order &&
                                        compaction_suitable(zone, order) !=
                                                COMPACT_SKIPPED)
                                testorder = 0;
@@ -2833,7 +2833,7 @@ out:
                                continue;
 
                        /* Would compaction fail due to lack of free memory? */
-                       if (COMPACTION_BUILD &&
+                       if (IS_ENABLED(CONFIG_COMPACTION) &&
                            compaction_suitable(zone, order) == COMPACT_SKIPPED)
                                goto loop_again;