Commits
David Rientjes authored and Konstantin Khorenko committed 9bdc45a8f82
ms/mm/compaction.c: periodically schedule when freeing pages Patchset description: compaction related stable backports These are some compaction related -stable backports that we missing. David Rientjes (9): ms/mm/compaction.c: periodically schedule when freeing pages ms/mm, compaction: avoid isolating pinned pages ms/mm, compaction: determine isolation mode only once ms/mm, compaction: ignore pageblock skip when manually invoking compaction ms/mm, migration: add destination page freeing callback ms/mm, compaction: return failed migration target pages back to freelist ms/mm, compaction: add per-zone migration pfn cache for async compaction ms/mm, compaction: embed migration mode in compact_control ms/mm, compaction: terminate async compaction when rescheduling Heesub Shin (1): ms/mm/compaction: clean up unused code lines Hugh Dickins (1): ms/mm: fix direct reclaim writeback regression Joonsoo Kim (6): ms/mm/compaction: disallow high-order page for migration target ms/mm/compaction: do not call suitable_migration_target() on every page ms/mm/compaction: change the timing to check to drop the spinlock ms/mm/compaction: check pageblock suitability once per pageblock ms/mm/compaction: clean-up code on success of ballon isolation ms/mm/compaction: fix wrong order check in compact_finished() Mel Gorman (1): ms/mm: compaction: trace compaction begin and end Vlastimil Babka (7): ms/mm: compaction: encapsulate defer reset logic ms/mm: compaction: do not mark unmovable pageblocks as skipped in async compaction ms/mm: compaction: reset scanner positions immediately when they meet ms/mm/compaction: cleanup isolate_freepages() ms/mm/compaction: do not count migratepages when unnecessary ms/mm/compaction: avoid rescanning pageblocks in isolate_freepages ms/mm, compaction: properly signal and act upon lock and need_sched() contention https://jira.sw.ru/browse/PSBM-81070 =================================================================== This patch description: We've been getting warnings about an excessive amount of time spent allocating pages for migration during memory compaction without scheduling. isolate_freepages_block() already periodically checks for contended locks or the need to schedule, but isolate_freepages() never does. When a zone is massively long and no suitable targets can be found, this iteration can be quite expensive without ever doing cond_resched(). Check periodically for the need to reschedule while the compaction free scanner iterates. Signed-off-by: David Rientjes <rientjes@google.com> Reviewed-by: Rik van Riel <riel@redhat.com> Reviewed-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Acked-by: Mel Gorman <mgorman@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> (cherry picked from commit f6ea3adb70b20ae36277a1b0eaaf4da9f6479a28) Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>