The patch titled Subject: mm, hugetlb: abort __get_user_pages if current has been oom killed has been removed from the -mm tree. Its filename was mm-hugetlb-abort-__get_user_pages-if-current-has-been-oom-killed.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ From: David Rientjes <rientjes@xxxxxxxxxx> Subject: mm, hugetlb: abort __get_user_pages if current has been oom killed If __get_user_pages() is faulting a significant number of hugetlb pages, usually as the result of mmap(MAP_LOCKED), it can potentially allocate a very large amount of memory. If the process has been oom killed, this will cause a lot of memory to potentially deplete memory reserves. In the same way that commit 4779280d1ea4 ("mm: make get_user_pages() interruptible") aborted for pending SIGKILLs when faulting non-hugetlb memory, based on the premise of commit 462e00cc7151 ("oom: stop allocating user memory if TIF_MEMDIE is set"), hugetlb page faults now terminate when the process has been oom killed. Signed-off-by: David Rientjes <rientjes@xxxxxxxxxx> Acked-by: Rik van Riel <riel@xxxxxxxxxx> Acked-by: Greg Thelen <gthelen@xxxxxxxxxx> Cc: Naoya Horiguchi <n-horiguchi@xxxxxxxxxxxxx> Acked-by: Davidlohr Bueso <dave@xxxxxxxxxxxx> Acked-by: "Kirill A. Shutemov" <kirill@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/hugetlb.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff -puN mm/hugetlb.c~mm-hugetlb-abort-__get_user_pages-if-current-has-been-oom-killed mm/hugetlb.c --- a/mm/hugetlb.c~mm-hugetlb-abort-__get_user_pages-if-current-has-been-oom-killed +++ a/mm/hugetlb.c @@ -3278,6 +3278,15 @@ long follow_hugetlb_page(struct mm_struc struct page *page; /* + * If we have a pending SIGKILL, don't keep faulting pages and + * potentially allocating memory. + */ + if (unlikely(fatal_signal_pending(current))) { + remainder = 0; + break; + } + + /* * Some archs (sparc64, sh*) have multiple pte_ts to * each hugepage. We have to make sure we get the * first, for the page indexing below to work. _ Patches currently in -mm which might be from rientjes@xxxxxxxxxx are origin.patch cxgb4-drop-__gfp_nofail-allocation.patch jbd2-revert-must-not-fail-allocation-loops-back-to-gfp_nofail.patch slab-infrastructure-for-bulk-object-allocation-and-freeing-v3.patch slub-bulk-alloc-extract-objects-from-the-per-cpu-slab.patch slub-bulk-allocation-from-per-cpu-partial-pages.patch slub-bulk-allocation-from-per-cpu-partial-pages-fix.patch mm-refactor-zone_movable_is_highmem.patch mm-memory-failurec-define-page-types-for-action_result-in-one-place.patch page-flags-define-behavior-slb-related-flags-on-compound-pages.patch allow-compaction-of-unevictable-pages.patch document-interaction-between-compaction-and-the-unevictable-lru.patch document-interaction-between-compaction-and-the-unevictable-lru-fix.patch mm-memcg-sync-allocation-and-memcg-charge-gfp-flags-for-thp.patch mm-memcg-sync-allocation-and-memcg-charge-gfp-flags-for-thp-fix-fix.patch mm-compaction-reset-compaction-scanner-positions.patch hugetlbfs-add-minimum-size-tracking-fields-to-subpool-structure.patch hugetlbfs-add-minimum-size-accounting-to-subpools.patch hugetlbfs-accept-subpool-min_size-mount-option-and-setup-accordingly.patch hugetlbfs-document-min_size-mount-option-and-cleanup.patch mm-vmalloc-fix-possible-exhaustion-of-vmalloc-space-caused-by-vm_map_ram-allocator.patch mm-vmalloc-occupy-newly-allocated-vmap-block-just-after-allocation.patch mm-vmalloc-get-rid-of-dirty-bitmap-inside-vmap_block-structure.patch mremap-should-return-enomem-when-__vm_enough_memory-fail.patch clean-up-goto-just-return-err_ptr.patch fs-jfs-remove-slab-object-constructor.patch mm-mempool-disallow-mempools-based-on-slab-caches-with-constructors.patch mm-mempool-poison-elements-backed-by-slab-allocator.patch mm-mempool-poison-elements-backed-by-page-allocator.patch mm-mempool-poison-elements-backed-by-page-allocator-fix.patch mm-mempool-poison-elements-backed-by-page-allocator-fix-fix.patch mm-mempool-poison-elements-backed-by-page-allocator-fix-fix-fix.patch thp-handle-errors-in-hugepage_init-properly.patch thp-do-not-adjust-zone-water-marks-if-khugepaged-is-not-started.patch mm-doc-cleanup-and-clarify-munmap-behavior-for-hugetlb-memory.patch mm-doc-cleanup-and-clarify-munmap-behavior-for-hugetlb-memory-fix.patch mm-selftests-test-return-value-of-munmap-for-map_hugetlb-memory.patch mm-dont-call-__page_cache_release-for-hugetlb.patch mm-hugetlb-introduce-pagehugeactive-flag.patch mm-hugetlb-introduce-pagehugeactive-flag-fix.patch mm-hugetlb-cleanup-using-pagehugeactive-flag.patch mm-hugetlb-cleanup-using-pagehugeactive-flag-fix.patch thp-cleanup-khugepaged-startup.patch mm-mempool-kasan-poison-mempool-elements.patch hung_task-change-hung_taskc-to-use-for_each_process_thread.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