Subject: + mm-thp-avoid-excessive-compaction-latency-during-fault-fix.patch added to -mm tree To: rientjes@xxxxxxxxxx,gthelen@xxxxxxxxxx,hughd@xxxxxxxxxx,mgorman@xxxxxxx,n-horiguchi@xxxxxxxxxxxxx,vbabka@xxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Thu, 08 May 2014 15:36:08 -0700 The patch titled Subject: mm, thp: avoid excessive compaction latency during fault fix has been added to the -mm tree. Its filename is mm-thp-avoid-excessive-compaction-latency-during-fault-fix.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-thp-avoid-excessive-compaction-latency-during-fault-fix.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-thp-avoid-excessive-compaction-latency-during-fault-fix.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, thp: avoid excessive compaction latency during fault fix mm-thp-avoid-excessive-compaction-latency-during-fault.patch excludes sync compaction for all high order allocations other than thp. What we really want to do is suppress sync compaction for thp, but only during the page fault path. Orders greater than PAGE_ALLOC_COSTLY_ORDER aren't necessarily going to loop again so this is the only way to exhaust our capabilities before declaring that we can't allocate. Signed-off-by: David Rientjes <rientjes@xxxxxxxxxx> Reported-by: Hugh Dickins <hughd@xxxxxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxx> Cc: Greg Thelen <gthelen@xxxxxxxxxx> Cc: Naoya Horiguchi <n-horiguchi@xxxxxxxxxxxxx> Cc: Vlastimil Babka <vbabka@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/page_alloc.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff -puN mm/page_alloc.c~mm-thp-avoid-excessive-compaction-latency-during-fault-fix mm/page_alloc.c --- a/mm/page_alloc.c~mm-thp-avoid-excessive-compaction-latency-during-fault-fix +++ a/mm/page_alloc.c @@ -2576,16 +2576,13 @@ rebalance: if (page) goto got_pg; - if (gfp_mask & __GFP_NO_KSWAPD) { - /* - * Khugepaged is allowed to try MIGRATE_SYNC_LIGHT, the latency - * of this allocation isn't critical. Everything else, however, - * should only be allowed to do MIGRATE_ASYNC to avoid excessive - * stalls during fault. - */ - if ((current->flags & (PF_KTHREAD | PF_KSWAPD)) == PF_KTHREAD) - migration_mode = MIGRATE_SYNC_LIGHT; - } + /* + * It can become very expensive to allocate transparent hugepages at + * fault, so use asynchronous memory compaction for THP unless it is + * khugepaged trying to collapse. + */ + if (!(gfp_mask & __GFP_NO_KSWAPD) || (current->flags & PF_KTHREAD)) + migration_mode = MIGRATE_SYNC_LIGHT; /* * If compaction is deferred for high-order allocations, it is because _ Patches currently in -mm which might be from rientjes@xxxxxxxxxx are mm-slab-suppress-out-of-memory-warning-unless-debug-is-enabled.patch mm-memcontrol-remove-hierarchy-restrictions-for-swappiness-and-oom_control.patch mm-memcontrol-remove-hierarchy-restrictions-for-swappiness-and-oom_control-fix.patch hugetlb-prep_compound_gigantic_page-drop-__init-marker.patch hugetlb-add-hstate_is_gigantic.patch hugetlb-update_and_free_page-dont-clear-pg_reserved-bit.patch hugetlb-move-helpers-up-in-the-file.patch hugetlb-add-support-for-gigantic-page-allocation-at-runtime.patch mem-hotplug-implement-get-put_online_mems.patch slab-get_online_mems-for-kmem_cache_createdestroyshrink.patch mm-debug-make-bad_range-output-more-usable-and-readable.patch memcg-do-not-hang-on-oom-when-killed-by-userspace-oom-access-to-memory-reserves.patch mm-migration-add-destination-page-freeing-callback.patch mm-compaction-return-failed-migration-target-pages-back-to-freelist.patch mm-compaction-add-per-zone-migration-pfn-cache-for-async-compaction.patch mm-compaction-embed-migration-mode-in-compact_control.patch mm-thp-avoid-excessive-compaction-latency-during-fault.patch mm-thp-avoid-excessive-compaction-latency-during-fault-fix.patch mm-compaction-terminate-async-compaction-when-rescheduling.patch mm-compaction-do-not-count-migratepages-when-unnecessary.patch mm-compaction-avoid-rescanning-pageblocks-in-isolate_freepages.patch mm-utilc-add-kstrimdup.patch linux-next.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