This is a note to let you know that I've just added the patch titled mm/compaction: change the timing to check to drop the spinlock to the 3.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: mm-compaction-change-the-timing-to-check-to-drop-the-spinlock.patch and it can be found in the queue-3.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From be1aa03b973c7dcdc576f3503f7a60429825c35d Mon Sep 17 00:00:00 2001 From: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> Date: Mon, 7 Apr 2014 15:37:05 -0700 Subject: mm/compaction: change the timing to check to drop the spinlock From: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> commit be1aa03b973c7dcdc576f3503f7a60429825c35d upstream. It is odd to drop the spinlock when we scan (SWAP_CLUSTER_MAX - 1) th pfn page. This may results in below situation while isolating migratepage. 1. try isolate 0x0 ~ 0x200 pfn pages. 2. When low_pfn is 0x1ff, ((low_pfn+1) % SWAP_CLUSTER_MAX) == 0, so drop the spinlock. 3. Then, to complete isolating, retry to aquire the lock. I think that it is better to use SWAP_CLUSTER_MAX th pfn for checking the criteria about dropping the lock. This has no harm 0x0 pfn, because, at this time, locked variable would be false. Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> Acked-by: Vlastimil Babka <vbabka@xxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxx> Cc: Rik van Riel <riel@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: Mel Gorman <mgorman@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- mm/compaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/compaction.c +++ b/mm/compaction.c @@ -487,7 +487,7 @@ isolate_migratepages_range(struct zone * cond_resched(); for (; low_pfn < end_pfn; low_pfn++) { /* give a chance to irqs before checking need_resched() */ - if (locked && !((low_pfn+1) % SWAP_CLUSTER_MAX)) { + if (locked && !(low_pfn % SWAP_CLUSTER_MAX)) { if (should_release_lock(&zone->lru_lock)) { spin_unlock_irqrestore(&zone->lru_lock, flags); locked = false; Patches currently in stable-queue which might be from iamjoonsoo.kim@xxxxxxx are queue-3.14/mm-compaction-avoid-isolating-pinned-pages.patch queue-3.14/mm-compaction-do-not-call-suitable_migration_target-on-every-page.patch queue-3.14/mm-compaction-determine-isolation-mode-only-once.patch queue-3.14/mm-compaction-check-pageblock-suitability-once-per-pageblock.patch queue-3.14/mm-compaction-clean-up-code-on-success-of-ballon-isolation.patch queue-3.14/mm-compaction-disallow-high-order-page-for-migration-target.patch queue-3.14/mm-compaction-change-the-timing-to-check-to-drop-the-spinlock.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html