From: Mel Gorman Date: Tue, 15 Dec 2009 01:59:56 +0000 (-0800) Subject: hugetlb: abort a hugepage pool resize if a signal is pending X-Git-Tag: tegra-10.11.0~3792 X-Git-Url: http://nv-tegra.nvidia.com/gitweb/?p=linux-2.6.git;a=commitdiff_plain;h=536240f2bde98216feac87b4891d19a536b8884a;hp=6927c1dd93fc982140f3a3742ac4b224cd3e02b2 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 Cc: Dave Hansen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 6df8065..65f38c2 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; } /*