lkml.org 
[lkml]   [2009]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] 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.

[dave@linux.vnet.ibm.com: His idea]
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
---
mm/hugetlb.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index af02ee8..a952cb8 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1238,6 +1238,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;
}

/*

\
 
 \ /
  Last update: 2009-12-02 15:19    [W:0.486 / U:0.920 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site