summaryrefslogtreecommitdiffstats
path: root/mm/compaction.c
diff options
context:
space:
mode:
authorMel Gorman2014-01-24 00:53:38 +0100
committerLinus Torvalds2014-01-24 01:36:53 +0100
commit6c14466cc00ff13121ae782d33d9df0fde20b124 (patch)
tree65cf09a45f47de60638fdd1fe3140f9b8bdc27b9 /mm/compaction.c
parentmemcg: fix css reference leak and endless loop in mem_cgroup_iter (diff)
downloadkernel-qcow2-linux-6c14466cc00ff13121ae782d33d9df0fde20b124.tar.gz
kernel-qcow2-linux-6c14466cc00ff13121ae782d33d9df0fde20b124.tar.xz
kernel-qcow2-linux-6c14466cc00ff13121ae782d33d9df0fde20b124.zip
mm: improve documentation of page_order
Developers occasionally try and optimise PFN scanners by using page_order but miss that in general it requires zone->lock. This has happened twice for compaction.c and rejected both times. This patch clarifies the documentation of page_order and adds a note to compaction.c why page_order is not used. [akpm@linux-foundation.org: tweaks] [lauraa@codeaurora.org: Corrected a page_zone(page)->lock reference] Signed-off-by: Mel Gorman <mgorman@suse.de> Acked-by: Rafael Aquini <aquini@redhat.com> Acked-by: Minchan Kim <minchan@kernel.org> Cc: Laura Abbott <lauraa@codeaurora.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/compaction.c')
-rw-r--r--mm/compaction.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/compaction.c b/mm/compaction.c
index e0ab02d70f13..b48c5259ea33 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -523,7 +523,10 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc,
if (!isolation_suitable(cc, page))
goto next_pageblock;
- /* Skip if free */
+ /*
+ * Skip if free. page_order cannot be used without zone->lock
+ * as nothing prevents parallel allocations or buddy merging.
+ */
if (PageBuddy(page))
continue;