The patch titled Subject: mm: compaction: check lock contention first before taking lock has been removed from the -mm tree. Its filename was mm-compaction-check-lock-contention-first-before-taking-lock.patch This patch was dropped because an updated version will be merged ------------------------------------------------------ From: Shaohua Li <shli@xxxxxxxxxx> Subject: mm: compaction: check lock contention first before taking lock isolate_migratepages_range will take zone->lru_lock first and check if the lock is contented, if yes, it will release the lock. This isn't efficient. If the lock is truly contented, a lock/unlock pair will increase the lock contention. We'd better check if the lock is contended first. compact_trylock_irqsave perfectly meets the requirement. Signed-off-by: Shaohua Li <shli@xxxxxxxxxxxx> Acked-by: Mel Gorman <mgorman@xxxxxxx> Acked-by: Minchan Kim <minchan@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/compaction.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff -puN mm/compaction.c~mm-compaction-check-lock-contention-first-before-taking-lock mm/compaction.c --- a/mm/compaction.c~mm-compaction-check-lock-contention-first-before-taking-lock +++ a/mm/compaction.c @@ -349,8 +349,9 @@ isolate_migratepages_range(struct zone * /* Time to isolate some pages for migration */ cond_resched(); - spin_lock_irqsave(&zone->lru_lock, flags); - locked = true; + locked = compact_trylock_irqsave(&zone->lru_lock, &flags, cc); + if (!locked) + return 0; for (; low_pfn < end_pfn; low_pfn++) { struct page *page; _ Patches currently in -mm which might be from shli@xxxxxxxxxx are origin.patch linux-next.patch readahead-fault-retry-breaks-mmap-file-read-random-detection.patch atomic-implement-generic-atomic_dec_if_positive.patch atomic-implement-generic-atomic_dec_if_positive-fix.patch swap-add-a-simple-detector-for-inappropriate-swapin-readahead.patch swap-add-a-simple-detector-for-inappropriate-swapin-readahead-fix.patch mm-compaction-abort-compaction-loop-if-lock-is-contended-or-run-too-long.patch mm-compaction-abort-compaction-loop-if-lock-is-contended-or-run-too-long-fix.patch mm-compaction-move-fatal-signal-check-out-of-compact_checklock_irqsave.patch mm-compaction-acquire-the-zone-lru_lock-as-late-as-possible.patch mm-compaction-acquire-the-zone-lock-as-late-as-possible.patch revert-mm-have-order-0-compaction-start-off-where-it-left.patch mm-compaction-cache-if-a-pageblock-was-scanned-and-no-pages-were-isolated.patch mm-compaction-restart-compaction-from-near-where-it-left-off.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html