* [PATCH] mm: use IS_ENABLED(CONFIG_COMPACTION) instead of COMPACTION_BUILD
@ 2012-10-15 12:05 Kirill A. Shutemov
2012-10-15 15:49 ` Minchan Kim
2012-10-17 21:07 ` David Rientjes
0 siblings, 2 replies; 3+ messages in thread
From: Kirill A. Shutemov @ 2012-10-15 12:05 UTC (permalink / raw)
To: Andrew Morton, Mel Gorman, linux-mm; +Cc: Kirill A. Shutemov
From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
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>
---
include/linux/kernel.h | 7 -------
mm/vmscan.c | 8 ++++----
2 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 6bc5fa8..d85c530 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -687,13 +687,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
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 2624edc..d4257f6 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -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;
@@ -2030,7 +2030,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.
@@ -2681,7 +2681,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;
@@ -2827,7 +2827,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;
--
1.7.7.6
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] mm: use IS_ENABLED(CONFIG_COMPACTION) instead of COMPACTION_BUILD
2012-10-15 12:05 [PATCH] mm: use IS_ENABLED(CONFIG_COMPACTION) instead of COMPACTION_BUILD Kirill A. Shutemov
@ 2012-10-15 15:49 ` Minchan Kim
2012-10-17 21:07 ` David Rientjes
1 sibling, 0 replies; 3+ messages in thread
From: Minchan Kim @ 2012-10-15 15:49 UTC (permalink / raw)
To: Kirill A. Shutemov; +Cc: Andrew Morton, Mel Gorman, linux-mm
On Mon, Oct 15, 2012 at 03:05:35PM +0300, Kirill A. Shutemov wrote:
> From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
>
> 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>
--
Kind Regards,
Minchan Kim
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm: use IS_ENABLED(CONFIG_COMPACTION) instead of COMPACTION_BUILD
2012-10-15 12:05 [PATCH] mm: use IS_ENABLED(CONFIG_COMPACTION) instead of COMPACTION_BUILD Kirill A. Shutemov
2012-10-15 15:49 ` Minchan Kim
@ 2012-10-17 21:07 ` David Rientjes
1 sibling, 0 replies; 3+ messages in thread
From: David Rientjes @ 2012-10-17 21:07 UTC (permalink / raw)
To: Kirill A. Shutemov; +Cc: Andrew Morton, Mel Gorman, linux-mm
On Mon, 15 Oct 2012, Kirill A. Shutemov wrote:
> From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
>
> 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: David Rientjes <rientjes@google.com>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-10-17 21:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-15 12:05 [PATCH] mm: use IS_ENABLED(CONFIG_COMPACTION) instead of COMPACTION_BUILD Kirill A. Shutemov
2012-10-15 15:49 ` Minchan Kim
2012-10-17 21:07 ` David Rientjes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox