summaryrefslogtreecommitdiffstats
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
authorMel Gorman <mel@csn.ul.ie>2009-12-15 02:59:56 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-15 17:53:24 +0100
commit536240f2bde98216feac87b4891d19a536b8884a (patch)
treee4755bb36c232262a2ebadb055d8947acb39b672 /mm/hugetlb.c
parentmlock: replace stale comments in munlock_vma_page() (diff)
downloadlinux-536240f2bde98216feac87b4891d19a536b8884a.tar.xz
linux-536240f2bde98216feac87b4891d19a536b8884a.zip
hugetlb: abort a hugepage pool resize if a signal is pending
If a user asks for a hugepage pool resize but specified a large number, the machine can begin trashing. In response, they might hit ctrl-c but signals are ignored and the pool resize continues until it fails an allocation. This can take a considerable amount of time so this patch aborts a pool resize if a signal is pending. Suggested by Dave Hansen. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Cc: Dave Hansen <dave@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r--mm/hugetlb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 6df8065039eb..65f38c218207 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1278,6 +1278,9 @@ static unsigned long set_max_huge_pages(struct hstate *h, unsigned long count,
if (!ret)
goto out;
+ /* Bail for signals. Probably ctrl-c from user */
+ if (signal_pending(current))
+ goto out;
}
/*