Subject: + mm-compactionc-periodically-schedule-when-freeing-pages.patch added to -mm tree To: rientjes@xxxxxxxxxx,liwanp@xxxxxxxxxxxxxxxxxx,mgorman@xxxxxxx,riel@xxxxxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Wed, 18 Sep 2013 15:34:32 -0700 The patch titled Subject: mm/compaction.c: periodically schedule when freeing pages has been added to the -mm tree. Its filename is mm-compactionc-periodically-schedule-when-freeing-pages.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-compactionc-periodically-schedule-when-freeing-pages.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-compactionc-periodically-schedule-when-freeing-pages.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: David Rientjes <rientjes@xxxxxxxxxx> Subject: mm/compaction.c: periodically schedule when freeing pages 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@xxxxxxxxxx> Reviewed-by: Rik van Riel <riel@xxxxxxxxxx> Reviewed-by: Wanpeng Li <liwanp@xxxxxxxxxxxxxxxxxx> Acked-by: Mel Gorman <mgorman@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/compaction.c | 7 +++++++ 1 file changed, 7 insertions(+) diff -puN mm/compaction.c~mm-compactionc-periodically-schedule-when-freeing-pages mm/compaction.c --- a/mm/compaction.c~mm-compactionc-periodically-schedule-when-freeing-pages +++ a/mm/compaction.c @@ -677,6 +677,13 @@ static void isolate_freepages(struct zon pfn -= pageblock_nr_pages) { unsigned long isolated; + /* + * This can iterate a massively long zone without finding any + * suitable migration targets, so periodically check if we need + * to schedule. + */ + cond_resched(); + if (!pfn_valid(pfn)) continue; _ Patches currently in -mm which might be from rientjes@xxxxxxxxxx are mm-compactionc-periodically-schedule-when-freeing-pages.patch mm-acpi-use-numa_no_node.patch x86-srat-use-numa_no_node.patch mm-vmalloc-use-numa_no_node.patch mm-vmalloc-dont-set-area-caller-twice.patch mm-vmalloc-revert-mm-vmallocc-emit-the-failure-message-before-return.patch mm-vmalloc-revert-mm-vmallocc-check-vm_uninitialized-flag-in-s_show-instead-of-show_numa_info.patch mm-vmalloc-fix-show-vmap_area-information-race-with-vmap_area-tear-down.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