linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <dave@linux.vnet.ibm.com>
To: Mel Gorman <mel@csn.ul.ie>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hugetlb: Abort a hugepage pool resize if a signal is pending
Date: Wed, 02 Dec 2009 07:24:35 -0800	[thread overview]
Message-ID: <1259767475.24696.2368.camel@nimitz> (raw)
In-Reply-To: <20091202141504.GE1457@csn.ul.ie>

On Wed, 2009-12-02 at 14:15 +0000, Mel Gorman wrote:
> 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;

Thanks, Mel!

This will help m unwedge my system the next time I fat-finger an extra
zero or two into my hugepage pool size.

-- Dave

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2009-12-02 15:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-02 14:15 Mel Gorman
2009-12-02 15:24 ` Dave Hansen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1259767475.24696.2368.camel@nimitz \
    --to=dave@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox