Re: [PATCH 12/12] vmstat: include compaction.h when CONFIG_COMPACTION

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andrew Morton
Date: Tuesday, October 5, 2010 - 2:27 pm

Some of these patches do make the code significantly more complex to
read and follow.  Boy, I hope it's all useful!

On Thu, 30 Sep 2010 12:50:21 +0900
Namhyung Kim <namhyung@gmail.com> wrote:


This isn't a good idea: there's a good chance that someone will later
add a #include <linux/compaction.h> at the top of the file to support
future changes.  So we end up including it twice.

So I assume the below will work OK??

--- a/mm/vmstat.c~vmstat-include-compactionh-when-config_compaction-fix
+++ a/mm/vmstat.c
@@ -18,6 +18,7 @@
 #include <linux/sched.h>
 #include <linux/math64.h>
 #include <linux/writeback.h>
+#include <linux/compaction.h>
 
 #ifdef CONFIG_VM_EVENT_COUNTERS
 DEFINE_PER_CPU(struct vm_event_state, vm_event_states) = {{0}};
@@ -395,7 +396,6 @@ void zone_statistics(struct zone *prefer
 #endif
 
 #ifdef CONFIG_COMPACTION
-#include <linux/compaction.h>
 
 struct contig_page_info {
 	unsigned long free_pages;
_

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/12] mm: fix sparse warnings, Namhyung Kim, (Wed Sep 29, 8:50 pm)
[PATCH 05/12] mm: wrap follow_pte() using __cond_lock(), Namhyung Kim, (Wed Sep 29, 8:50 pm)
[PATCH 08/12] rmap: make anon_vma_[chain_]free() static, Namhyung Kim, (Wed Sep 29, 8:50 pm)
[PATCH 11/12] mm: declare some external symbols, Namhyung Kim, (Wed Sep 29, 8:50 pm)
Re: [PATCH 12/12] vmstat: include compaction.h when CONFIG ..., Andrew Morton, (Tue Oct 5, 2:27 pm)