linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Adam Litke <agl@us.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 2/3 htlb-fault] Demand faulting for huge pages
Date: Wed, 28 Sep 2005 23:09:17 -0700	[thread overview]
Message-ID: <20050928230917.2be72d69.akpm@osdl.org> (raw)
In-Reply-To: <1127939538.26401.36.camel@localhost.localdomain>

Adam Litke <agl@us.ibm.com> wrote:
>
> +static struct page *find_get_huge_page(struct address_space *mapping,
>  +			unsigned long idx)
>  +{
>  +	struct page *page = NULL;
>  +
>  +retry:
>  +	page = find_get_page(mapping, idx);
>  +	if (page)
>  +		goto out;
>  +
>  +	if (hugetlb_get_quota(mapping))
>  +		goto out;
>  +	page = alloc_huge_page();
>  +	if (!page) {
>  +		hugetlb_put_quota(mapping);
>  +		goto out;
>  +	}
>  +
>  +	if (add_to_page_cache(page, mapping, idx, GFP_ATOMIC)) {
>  +		put_page(page);
>  +		hugetlb_put_quota(mapping);
>  +		goto retry;

If add_to_page_cache() fails due to failure in radix_tree_preload(), this
code will lock up.

A lame fix is to check for -ENOMEM and bale.  A better fix would be to use
GFP_KERNEL.

--
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:[~2005-09-29  6:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-28 20:25 [PATCH 0/3] " Adam Litke
2005-09-28 20:31 ` [PATCH 1/3 htlb-get_user_pages] " Adam Litke
2005-09-28 20:32 ` [PATCH 2/3 htlb-fault] " Adam Litke
2005-09-29  6:09   ` Andrew Morton [this message]
2005-09-29  6:10   ` Andrew Morton
2005-09-28 20:33 ` [PATCH 3/3 htlb-acct] " Adam Litke
2005-09-29  6:20   ` Andrew Morton
2005-09-29  9:45     ` Andi Kleen
2005-09-29 13:32 ` [PATCH 0/3] " Hugh Dickins
2005-10-06 15:22   ` Adam Litke

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=20050928230917.2be72d69.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=agl@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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