diff --git a/mm/hugetlb.c b/mm/hugetlb.c index caad3c5a926fe434bccaea33b6bc781938757e50..8874c8ad55aaf3ae9e67b3bd8cc5bb5b290f7779 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -3277,6 +3277,15 @@ long follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma, int absent; 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