From 61d193f6fb3f7d79efad5ac7e942cb6f48ccde4f Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Fri, 28 Sep 2012 10:19:46 +1000 Subject: [PATCH] mm-compaction-acquire-the-zone-lru_lock-as-late-as-possible-fix-fix Cc: Mel Gorman Cc: Minchan Kim Signed-off-by: Andrew Morton --- mm/compaction.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index 7d96f8b45aa8..832c4183dccc 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -414,9 +414,10 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc, * splitting and collapsing (collapsing has already happened * if PageLRU is set) but the lock is not necessarily taken * here and it is wasteful to take it just to check transhuge. - * Check transhuge without lock and skip if it's either a - * transhuge or hugetlbfs page because calling compound_order() - * requires lru_lock to exclude isolation and splitting. + * Check TransHuge without lock and skip the whole pageblock if + * it's either a transhuge or hugetlbfs page, as calling + * compound_order() without preventing THP from splitting the + * page underneath us may return surprising results. */ if (PageTransHuge(page)) { if (!locked) -- 2.39.2