From: Andrew Morton Date: Fri, 28 Sep 2012 00:19:46 +0000 (+1000) Subject: mm-compaction-acquire-the-zone-lru_lock-as-late-as-possible-fix-fix X-Git-Tag: next-20121004~1^2~242 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=61d193f6fb3f7d79efad5ac7e942cb6f48ccde4f;p=karo-tx-linux.git mm-compaction-acquire-the-zone-lru_lock-as-late-as-possible-fix-fix Cc: Mel Gorman Cc: Minchan Kim Signed-off-by: Andrew Morton --- 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)