mirror of
https://github.com/S3NEO/android_kernel_samsung_msm8226.git
synced 2024-11-07 03:47:13 +00:00
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>
This commit is contained in:
parent
6927c1dd93
commit
536240f2bd
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue